DPDK patches and discussions
 help / color / mirror / Atom feed
* [PATCH] net/cnxk: fix promiscuous mode in multicast enable flow
@ 2021-12-01 10:29 skori
  2022-01-13  4:05 ` Jerin Jacob
  0 siblings, 1 reply; 2+ messages in thread
From: skori @ 2021-12-01 10:29 UTC (permalink / raw)
  To: Nithin Dabilpuram, Kiran Kumar K, Sunil Kumar Kori, Satha Rao
  Cc: dev, Asaf Ravid

From: Asaf Ravid <aravid@marvell.com>

When multicast promisc was being enabled it caused the unicast promisc
to be disabled. This fix resolves this by setting NIX_RX_MODE_PROMISC
when eth_dev->data->promiscuous is set, regardless.

ci: skip_checkpatch skip_roc_check

Fixes: 325d79c00a5a ("net/cnxk: support all multicast")

Signed-off-by: Asaf Ravid <aravid@marvell.com>
---
 drivers/common/cnxk/roc_nix_npc.c  | 2 +-
 drivers/net/cnxk/cnxk_ethdev_ops.c | 3 ++-
 2 files changed, 3 insertions(+), 2 deletions(-)

diff --git a/drivers/common/cnxk/roc_nix_npc.c b/drivers/common/cnxk/roc_nix_npc.c
index c0666c87d5..ad8839dde8 100644
--- a/drivers/common/cnxk/roc_nix_npc.c
+++ b/drivers/common/cnxk/roc_nix_npc.c
@@ -96,7 +96,7 @@ roc_nix_npc_mcast_config(struct roc_nix *roc_nix, bool mcast_enable,
 
 	if (mcast_enable)
 		req->mode = NIX_RX_MODE_ALLMULTI;
-	else if (prom_enable)
+	if (prom_enable)
 		req->mode = NIX_RX_MODE_PROMISC;
 
 	return mbox_process(mbox);
diff --git a/drivers/net/cnxk/cnxk_ethdev_ops.c b/drivers/net/cnxk/cnxk_ethdev_ops.c
index ce5f1f7240..34e4809650 100644
--- a/drivers/net/cnxk/cnxk_ethdev_ops.c
+++ b/drivers/net/cnxk/cnxk_ethdev_ops.c
@@ -517,7 +517,8 @@ cnxk_nix_allmulticast_enable(struct rte_eth_dev *eth_dev)
 {
 	struct cnxk_eth_dev *dev = cnxk_eth_pmd_priv(eth_dev);
 
-	return roc_nix_npc_mcast_config(&dev->nix, true, false);
+	return roc_nix_npc_mcast_config(&dev->nix, true,
+					eth_dev->data->promiscuous);
 }
 
 int
-- 
2.25.1


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

* Re: [PATCH] net/cnxk: fix promiscuous mode in multicast enable flow
  2021-12-01 10:29 [PATCH] net/cnxk: fix promiscuous mode in multicast enable flow skori
@ 2022-01-13  4:05 ` Jerin Jacob
  0 siblings, 0 replies; 2+ messages in thread
From: Jerin Jacob @ 2022-01-13  4:05 UTC (permalink / raw)
  To: Sunil Kumar Kori, Ferruh Yigit
  Cc: Nithin Dabilpuram, Kiran Kumar K, Satha Rao, dpdk-dev, Asaf Ravid

On Wed, Dec 1, 2021 at 4:00 PM <skori@marvell.com> wrote:
>
> From: Asaf Ravid <aravid@marvell.com>
>
> When multicast promisc was being enabled it caused the unicast promisc
> to be disabled. This fix resolves this by setting NIX_RX_MODE_PROMISC
> when eth_dev->data->promiscuous is set, regardless.
>
> ci: skip_checkpatch skip_roc_check
>
> Fixes: 325d79c00a5a ("net/cnxk: support all multicast")
>
> Signed-off-by: Asaf Ravid <aravid@marvell.com>

Acked-by: Jerin Jacob <jerinj@marvell.com>

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

Changed the git log to:

    net/cnxk: fix promiscuous mode in multicast enable flow

    When multicast promiscuous was being enabled it caused the unicast
    promiscuous to be disabled. This fix resolves this by setting
    NIX_RX_MODE_PROMISC when eth_dev->data->promiscuous is set, regardless.

    Fixes: 325d79c00a5a ("net/cnxk: support all multicast")
    Cc: stable@dpdk.org

    Signed-off-by: Asaf Ravid <aravid@marvell.com>
    Acked-by: Jerin Jacob <jerinj@marvell.com>


> ---
>  drivers/common/cnxk/roc_nix_npc.c  | 2 +-
>  drivers/net/cnxk/cnxk_ethdev_ops.c | 3 ++-
>  2 files changed, 3 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/common/cnxk/roc_nix_npc.c b/drivers/common/cnxk/roc_nix_npc.c
> index c0666c87d5..ad8839dde8 100644
> --- a/drivers/common/cnxk/roc_nix_npc.c
> +++ b/drivers/common/cnxk/roc_nix_npc.c
> @@ -96,7 +96,7 @@ roc_nix_npc_mcast_config(struct roc_nix *roc_nix, bool mcast_enable,
>
>         if (mcast_enable)
>                 req->mode = NIX_RX_MODE_ALLMULTI;
> -       else if (prom_enable)
> +       if (prom_enable)
>                 req->mode = NIX_RX_MODE_PROMISC;
>
>         return mbox_process(mbox);
> diff --git a/drivers/net/cnxk/cnxk_ethdev_ops.c b/drivers/net/cnxk/cnxk_ethdev_ops.c
> index ce5f1f7240..34e4809650 100644
> --- a/drivers/net/cnxk/cnxk_ethdev_ops.c
> +++ b/drivers/net/cnxk/cnxk_ethdev_ops.c
> @@ -517,7 +517,8 @@ cnxk_nix_allmulticast_enable(struct rte_eth_dev *eth_dev)
>  {
>         struct cnxk_eth_dev *dev = cnxk_eth_pmd_priv(eth_dev);
>
> -       return roc_nix_npc_mcast_config(&dev->nix, true, false);
> +       return roc_nix_npc_mcast_config(&dev->nix, true,
> +                                       eth_dev->data->promiscuous);
>  }
>
>  int
> --
> 2.25.1
>

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

end of thread, other threads:[~2022-01-13  4:06 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-12-01 10:29 [PATCH] net/cnxk: fix promiscuous mode in multicast enable flow skori
2022-01-13  4:05 ` 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).