diff options
Diffstat (limited to 'src/main_dpdk.cpp')
-rw-r--r-- | src/main_dpdk.cpp | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/src/main_dpdk.cpp b/src/main_dpdk.cpp index ebad39df..687cf457 100644 --- a/src/main_dpdk.cpp +++ b/src/main_dpdk.cpp @@ -1874,6 +1874,15 @@ int DpdkTRexPortAttr::set_promiscuous(bool enable){ return 0; } +int DpdkTRexPortAttr::set_multicast(bool enable){ + if (enable) { + rte_eth_allmulticast_enable(m_port_id); + }else{ + rte_eth_allmulticast_disable(m_port_id); + } + return 0; +} + int DpdkTRexPortAttr::set_link_up(bool up){ if (up) { return rte_eth_dev_set_link_up(m_port_id); @@ -1893,6 +1902,17 @@ bool DpdkTRexPortAttr::get_promiscuous(){ return ( ret?true:false); } +bool DpdkTRexPortAttr::get_multicast(){ + int ret=rte_eth_allmulticast_get(m_port_id); + if (ret<0) { + rte_exit(EXIT_FAILURE, "rte_eth_allmulticast_get: " + "err=%d, port=%u\n", + ret, m_port_id); + + } + return ( ret?true:false); +} + void DpdkTRexPortAttr::get_hw_src_mac(struct ether_addr *mac_addr){ rte_eth_macaddr_get(m_port_id , mac_addr); |