diff mbox series

net/cnxk: fix promiscuous mode in multicast enable flow

Message ID 20211201102954.2453386-1-skori@marvell.com (mailing list archive)
State Accepted
Delegated to: Jerin Jacob
Headers show
Series net/cnxk: fix promiscuous mode in multicast enable flow | expand

Checks

Context Check Description
ci/iol-x86_64-compile-testing success Testing PASS
ci/iol-x86_64-unit-testing success Testing PASS
ci/iol-aarch64-compile-testing success Testing PASS
ci/iol-aarch64-unit-testing success Testing PASS
ci/github-robot: build success github build: passed
ci/iol-intel-Performance success Performance Testing PASS
ci/iol-intel-Functional fail Functional Testing issues
ci/iol-broadcom-Functional success Functional Testing PASS
ci/iol-mellanox-Performance success Performance Testing PASS
ci/iol-broadcom-Performance success Performance Testing PASS
ci/intel-Testing success Testing PASS
ci/Intel-compilation success Compilation OK
ci/checkpatch success coding style OK

Commit Message

Sunil Kumar Kori Dec. 1, 2021, 10:29 a.m. UTC
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(-)

Comments

Jerin Jacob Jan. 13, 2022, 4:05 a.m. UTC | #1
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
>
diff mbox series

Patch

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