net/cnxk: fix promiscuous state after MAC change
PATCH 1/1 net/cnxk: fix promiscuous state after MAC change
If promiscuous mode is enabled and default MAC address is set again then promiscuous mode gets disabled in hardware.
This change will restore promiscuous behavior after configuring default MAC address.
Fixes 5fe86db2a0dd ("net/cnxk: support MAC address set")
Signed-off-by Rahul Bhansali <[email protected]>
--- drivers/net/cnxk/cnxk_ethdev_ops.c | 7 +++++++ 1 file changed, 7 insertions(+)
drivers/net/cnxk/cnxk_ethdev_ops.c +7 -0
@@ -451,6 +451,13 @@ cnxk_nix_mac_addr_set(struct rte_eth_dev *eth_dev, struct rte_ether_addr *addr)roc_nix_npc_mac_addr_set (nix, dev->mac_addr); goto exit; } + +if (eth_dev->data->promiscuous) { + rc =roc_nix_mac_promisc_mode_enable (nix, true); +if (rc) +plt_err ("Failed to setup promisc mode in mac, rc=%d(%s)" , rc, +roc_error_msg_get (rc)); + } }/* Update mac address to cnxk ethernet device */
Signature · 1 line
2.25.1
Jerin Jacob
AppliedQuoted 11 lines · Rahul Bhansali
If promiscuous mode is enabled and default MAC address is set again then promiscuous mode gets disabled in hardware.
This change will restore promiscuous behavior after configuring default MAC address.
Fixes 5fe86db2a0dd ("net/cnxk: support MAC address set")Signed-off-by Rahul Bhansali <[email protected]>
Applied to dpdk-next-net-mrvl/for-main. Thanks
Quoted 25 lines
--- drivers/net/cnxk/cnxk_ethdev_ops.c | 7 +++++++ 1 file changed, 7 insertions(+)drivers/net/cnxk/cnxk_ethdev_ops.c +7
-1@@ -451,6 +451,13 @@ cnxk_nix_mac_addr_set(struct rte_eth_dev *eth_dev, struct rte_ether_addr *addr)roc_nix_npc_mac_addr_set (nix, dev->mac_addr); goto exit; } + +if (eth_dev->data->promiscuous) { + rc =roc_nix_mac_promisc_mode_enable (nix, true); +if (rc) +plt_err ("Failed to setup promisc mode in mac, rc=%d(%s)" , rc, +roc_error_msg_get (rc)); + } }/* Update mac address to cnxk ethernet device */ --2.25.1