patches for DPDK stable branches
 help / color / mirror / Atom feed
* [PATCH] net/cnxk: fix promiscuous state after MAC change
@ 2024-05-28  8:32 Rahul Bhansali
  2024-05-28 17:43 ` Jerin Jacob
  0 siblings, 1 reply; 2+ messages in thread
From: Rahul Bhansali @ 2024-05-28  8:32 UTC (permalink / raw)
  To: dev, Nithin Dabilpuram, Kiran Kumar K, Sunil Kumar Kori,
	Satha Rao, Harman Kalra
  Cc: jerinj, Rahul Bhansali, stable

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")
Cc: stable@dpdk.org

Signed-off-by: Rahul Bhansali <rbhansali@marvell.com>
---
 drivers/net/cnxk/cnxk_ethdev_ops.c | 7 +++++++
 1 file changed, 7 insertions(+)

diff --git a/drivers/net/cnxk/cnxk_ethdev_ops.c b/drivers/net/cnxk/cnxk_ethdev_ops.c
index c8260fcb9c..b1093dd584 100644
--- a/drivers/net/cnxk/cnxk_ethdev_ops.c
+++ b/drivers/net/cnxk/cnxk_ethdev_ops.c
@@ -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


^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: [PATCH] net/cnxk: fix promiscuous state after MAC change
  2024-05-28  8:32 [PATCH] net/cnxk: fix promiscuous state after MAC change Rahul Bhansali
@ 2024-05-28 17:43 ` Jerin Jacob
  0 siblings, 0 replies; 2+ messages in thread
From: Jerin Jacob @ 2024-05-28 17:43 UTC (permalink / raw)
  To: Rahul Bhansali
  Cc: dev, Nithin Dabilpuram, Kiran Kumar K, Sunil Kumar Kori,
	Satha Rao, Harman Kalra, jerinj, stable

On Tue, May 28, 2024 at 2:18 PM Rahul Bhansali <rbhansali@marvell.com> wrote:
>
> 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")
> Cc: stable@dpdk.org
>
> Signed-off-by: Rahul Bhansali <rbhansali@marvell.com>

Applied to dpdk-next-net-mrvl/for-main. Thanks


> ---
>  drivers/net/cnxk/cnxk_ethdev_ops.c | 7 +++++++
>  1 file changed, 7 insertions(+)
>
> diff --git a/drivers/net/cnxk/cnxk_ethdev_ops.c b/drivers/net/cnxk/cnxk_ethdev_ops.c
> index c8260fcb9c..b1093dd584 100644
> --- a/drivers/net/cnxk/cnxk_ethdev_ops.c
> +++ b/drivers/net/cnxk/cnxk_ethdev_ops.c
> @@ -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
>

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2024-05-28 17:43 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2024-05-28  8:32 [PATCH] net/cnxk: fix promiscuous state after MAC change Rahul Bhansali
2024-05-28 17:43 ` Jerin Jacob

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).