[28/34] common/cnxk: enable allmulti mode on rpm/cgx VF

Message ID 20250131080530.3224977-28-ndabilpuram@marvell.com (mailing list archive)
State Changes Requested
Delegated to: Jerin Jacob
Headers
Series [01/34] net/cnxk: allow duplicate SPI in outbound IPsec |

Checks

Context Check Description
ci/checkpatch success coding style OK

Commit Message

Nithin Dabilpuram Jan. 31, 2025, 8:05 a.m. UTC
From: Monendra Singh Kushwaha <kmonendra@marvell.com>

This patch enables allmulti mode on rpm/cgx vf devices.

Signed-off-by: Monendra Singh Kushwaha <kmonendra@marvell.com>
---
 .mailmap                          |  1 +
 drivers/common/cnxk/roc_mbox.h    |  1 +
 drivers/common/cnxk/roc_nix_npc.c | 10 +++++++---
 3 files changed, 9 insertions(+), 3 deletions(-)
  

Patch

diff --git a/.mailmap b/.mailmap
index e2486bf7b5..05b581e0b0 100644
--- a/.mailmap
+++ b/.mailmap
@@ -1050,6 +1050,7 @@  Mohammed Gamal <mgamal@redhat.com>
 Mohsin Kazmi <mohsin.kazmi14@gmail.com>
 Mohsin Mazhar Shaikh <mohsinmazhar_shaikh@trendmicro.com>
 Mohsin Shaikh <mohsinshaikh@niometrics.com>
+Monendra Singh Kushwaha <kmonendra@marvell.com>
 Morten Brørup <mb@smartsharesystems.com>
 Moti Haimovsky <motih@mellanox.com>
 Muhammad Ahmad <muhammad.ahmad@emumba.com>
diff --git a/drivers/common/cnxk/roc_mbox.h b/drivers/common/cnxk/roc_mbox.h
index df9a629403..b87ddf872a 100644
--- a/drivers/common/cnxk/roc_mbox.h
+++ b/drivers/common/cnxk/roc_mbox.h
@@ -1848,6 +1848,7 @@  struct nix_rx_mode {
 #define NIX_RX_MODE_UCAST    BIT(0)
 #define NIX_RX_MODE_PROMISC  BIT(1)
 #define NIX_RX_MODE_ALLMULTI BIT(2)
+#define NIX_RX_MODE_USE_MCE  BIT(3)
 	uint16_t __io mode;
 };
 
diff --git a/drivers/common/cnxk/roc_nix_npc.c b/drivers/common/cnxk/roc_nix_npc.c
index 8c4a5753ee..1d445c0d92 100644
--- a/drivers/common/cnxk/roc_nix_npc.c
+++ b/drivers/common/cnxk/roc_nix_npc.c
@@ -101,7 +101,7 @@  roc_nix_npc_mcast_config(struct roc_nix *roc_nix, bool mcast_enable,
 	struct nix_rx_mode *req;
 	int rc = -ENOSPC;
 
-	if (roc_nix_is_vf_or_sdp(roc_nix)) {
+	if (roc_nix_is_sdp(roc_nix) || roc_nix_is_lbk(roc_nix)) {
 		rc = 0;
 		goto exit;
 	}
@@ -110,9 +110,13 @@  roc_nix_npc_mcast_config(struct roc_nix *roc_nix, bool mcast_enable,
 	if (req == NULL)
 		goto exit;
 
-	if (mcast_enable)
+	if (mcast_enable) {
 		req->mode = NIX_RX_MODE_ALLMULTI;
-	if (prom_enable)
+		if (dev_is_vf(&nix->dev))
+			req->mode |= NIX_RX_MODE_USE_MCE;
+	}
+
+	if (prom_enable && !dev_is_vf(&nix->dev))
 		req->mode = NIX_RX_MODE_PROMISC;
 
 	rc = mbox_process(mbox);