summaryrefslogtreecommitdiffstats
path: root/src/main_dpdk.cpp
diff options
context:
space:
mode:
authorimarom <imarom@cisco.com>2016-11-03 16:33:52 +0200
committerimarom <imarom@cisco.com>2016-11-03 16:33:52 +0200
commit234779fd32e747f4ac918f3c39e59618dde0f2d7 (patch)
tree2ba641354b6d6c751f94de44f9453dcbec0e19aa /src/main_dpdk.cpp
parent0ed685e077e8533ffe6d96f5d1fefcdd42626763 (diff)
moved RX filter feature to port attr
Signed-off-by: imarom <imarom@cisco.com>
Diffstat (limited to 'src/main_dpdk.cpp')
-rw-r--r--src/main_dpdk.cpp25
1 files changed, 17 insertions, 8 deletions
diff --git a/src/main_dpdk.cpp b/src/main_dpdk.cpp
index ecf09b46..fcee6a58 100644
--- a/src/main_dpdk.cpp
+++ b/src/main_dpdk.cpp
@@ -4175,6 +4175,8 @@ CGlobalTRex:: publish_async_port_attr_changed(uint8_t port_id) {
data["attr"]["speed"] = _attr->get_link_speed();
data["attr"]["promiscuous"]["enabled"] = _attr->get_promiscuous();
data["attr"]["link"]["up"] = _attr->is_link_up();
+ data["attr"]["rx_filter_mode"] = _attr->get_rx_filter_mode();
+
int mode;
int ret = _attr->get_flow_ctrl(mode);
if (ret != 0) {
@@ -6595,6 +6597,21 @@ TRexPortAttr *TrexDpdkPlatformApi::getPortAttrObj(uint8_t port_id) const {
return g_trex.m_ports[port_id].get_port_attr();
}
+
+int DpdkTRexPortAttr::set_rx_filter_mode(rx_filter_mode_e rx_filter_mode) {
+
+ CPhyEthIF *_if = &g_trex.m_ports[m_port_id];
+ bool recv_all = (rx_filter_mode == RX_FILTER_MODE_ALL);
+ int rc = CTRexExtendedDriverDb::Ins()->get_drv()->set_rcv_all(_if, recv_all);
+ if (rc != 0) {
+ return (rc);
+ }
+
+ m_rx_filter_mode = rx_filter_mode;
+
+ return (0);
+}
+
/**
* marks the control plane for a total server shutdown
*
@@ -6605,12 +6622,4 @@ void TrexDpdkPlatformApi::mark_for_shutdown() const {
}
-void TrexDpdkPlatformApi::set_rx_filter_mode(uint8_t port_id, rx_filter_mode_e filter_mode) const {
-
- CPhyEthIF *_if = &g_trex.m_ports[port_id];
-
- bool recv_all = (filter_mode == RX_FILTER_MODE_ALL);
- CTRexExtendedDriverDb::Ins()->get_drv()->set_rcv_all(_if, recv_all);
-}
-