DPDK patches and discussions
 help / color / mirror / Atom feed
From: Nithin Dabilpuram <ndabilpuram@marvell.com>
To: Nithin Dabilpuram <ndabilpuram@marvell.com>,
	Kiran Kumar K <kirankumark@marvell.com>,
	Sunil Kumar Kori <skori@marvell.com>,
	Satha Rao <skoteshwar@marvell.com>
Cc: <jerinj@marvell.com>, <dev@dpdk.org>,
	Rahul Bhansali <rbhansali@marvell.com>
Subject: [PATCH 06/31] common/cnxk: fixes CGX promisc toggling
Date: Fri, 11 Aug 2023 14:27:40 +0530	[thread overview]
Message-ID: <20230811085805.441256-6-ndabilpuram@marvell.com> (raw)
In-Reply-To: <20230811085805.441256-1-ndabilpuram@marvell.com>

From: Rahul Bhansali <rbhansali@marvell.com>

This will allow CGX promisc toggling even when exact
match feature is enabled.
Also, In case of exact feature, CGX promisc enable/disable mbox
response returns failure code -1101 in case if no change in the state.
This failure code can be ignored and proceed further.

Fixes: a90649722b51 ("common/cnxk: skip CGX promisc mode with NPC exact match")

Signed-off-by: Rahul Bhansali <rbhansali@marvell.com>
---
 drivers/common/cnxk/roc_dev.c     | 13 ++++++++++++-
 drivers/common/cnxk/roc_mbox.h    | 15 +++++++++++++++
 drivers/common/cnxk/roc_nix_mac.c |  8 --------
 3 files changed, 27 insertions(+), 9 deletions(-)

diff --git a/drivers/common/cnxk/roc_dev.c b/drivers/common/cnxk/roc_dev.c
index 4b0ba218ed..128b9751e4 100644
--- a/drivers/common/cnxk/roc_dev.c
+++ b/drivers/common/cnxk/roc_dev.c
@@ -451,7 +451,6 @@ process_msgs(struct dev *dev, struct mbox *mbox)
 			 * while PFC already configured on other VFs. This is
 			 * not an error but a warning which can be ignored.
 			 */
-#define LMAC_AF_ERR_PERM_DENIED -1103
 			if (msg->rc) {
 				if (msg->rc == LMAC_AF_ERR_PERM_DENIED) {
 					plt_mbox_dbg(
@@ -464,6 +463,18 @@ process_msgs(struct dev *dev, struct mbox *mbox)
 				}
 			}
 			break;
+		case MBOX_MSG_CGX_PROMISC_DISABLE:
+		case MBOX_MSG_CGX_PROMISC_ENABLE:
+			if (msg->rc) {
+				if (msg->rc == LMAC_AF_ERR_INVALID_PARAM) {
+					plt_mbox_dbg("Already in same promisc state");
+					msg->rc = 0;
+				} else {
+					plt_err("Message (%s) response has err=%d",
+						mbox_id2name(msg->id), msg->rc);
+				}
+			}
+			break;
 
 		default:
 			if (msg->rc)
diff --git a/drivers/common/cnxk/roc_mbox.h b/drivers/common/cnxk/roc_mbox.h
index f038d3e02b..2fd01cd710 100644
--- a/drivers/common/cnxk/roc_mbox.h
+++ b/drivers/common/cnxk/roc_mbox.h
@@ -540,6 +540,21 @@ struct lmtst_tbl_setup_req {
 };
 
 /* CGX mbox message formats */
+/* CGX mailbox error codes
+ * Range 1101 - 1200.
+ */
+enum cgx_af_status {
+	LMAC_AF_ERR_INVALID_PARAM = -1101,
+	LMAC_AF_ERR_PF_NOT_MAPPED = -1102,
+	LMAC_AF_ERR_PERM_DENIED = -1103,
+	LMAC_AF_ERR_PFC_ENADIS_PERM_DENIED = -1104,
+	LMAC_AF_ERR_8023PAUSE_ENADIS_PERM_DENIED = -1105,
+	LMAC_AF_ERR_CMD_TIMEOUT = -1106,
+	LMAC_AF_ERR_FIRMWARE_DATA_NOT_MAPPED = -1107,
+	LMAC_AF_ERR_EXACT_MATCH_TBL_ADD_FAILED = -1108,
+	LMAC_AF_ERR_EXACT_MATCH_TBL_DEL_FAILED = -1109,
+	LMAC_AF_ERR_EXACT_MATCH_TBL_LOOK_UP_FAILED = -1110,
+};
 
 struct cgx_stats_rsp {
 	struct mbox_msghdr hdr;
diff --git a/drivers/common/cnxk/roc_nix_mac.c b/drivers/common/cnxk/roc_nix_mac.c
index 754d75ac73..ac30fb52d1 100644
--- a/drivers/common/cnxk/roc_nix_mac.c
+++ b/drivers/common/cnxk/roc_nix_mac.c
@@ -201,14 +201,6 @@ roc_nix_mac_promisc_mode_enable(struct roc_nix *roc_nix, int enable)
 		goto exit;
 	}
 
-	/* Skip CGX promisc toggling if NPC exact match is enabled as
-	 * CGX filtering is disabled permanently.
-	 */
-	if (nix->exact_match_ena) {
-		rc = 0;
-		goto exit;
-	}
-
 	if (enable)
 		mbox_alloc_msg_cgx_promisc_enable(mbox);
 	else
-- 
2.25.1


  parent reply	other threads:[~2023-08-11  8:58 UTC|newest]

Thread overview: 32+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-08-11  8:57 [PATCH 01/31] common/cnxk: add aura ref count mechanism Nithin Dabilpuram
2023-08-11  8:57 ` [PATCH 02/31] common/cnxk: optimize time while configuring fc on VF Nithin Dabilpuram
2023-08-11  8:57 ` [PATCH 03/31] common/cnxk: use only user sqb slack when provided Nithin Dabilpuram
2023-08-11  8:57 ` [PATCH 04/31] common/cnxk: add workaround for CPT ctx fetch issue Nithin Dabilpuram
2023-08-11  8:57 ` [PATCH 05/31] common/cnxk: support rate limit on PFC TM tree Nithin Dabilpuram
2023-08-11  8:57 ` Nithin Dabilpuram [this message]
2023-08-11  8:57 ` [PATCH 07/31] common/cnxk: fix xstats for different packet sizes Nithin Dabilpuram
2023-08-11  8:57 ` [PATCH 08/31] common/cnxk: disable BP on SDP link while closing SQ Nithin Dabilpuram
2023-08-11  8:57 ` [PATCH 09/31] common/cnxk: fix leak in error path Nithin Dabilpuram
2023-08-11  8:57 ` [PATCH 10/31] common/cnxk: fix different size bit operations Nithin Dabilpuram
2023-08-11  8:57 ` [PATCH 11/31] " Nithin Dabilpuram
2023-08-11  8:57 ` [PATCH 12/31] common/cnxk: remove unnecessory ROC API calls Nithin Dabilpuram
2023-08-11  8:57 ` [PATCH 13/31] common/cnxk: sync MAC addr set mailbox structure Nithin Dabilpuram
2023-08-11  8:57 ` [PATCH 14/31] common/cnxk: add API to get Rx chan count from NIX Nithin Dabilpuram
2023-08-11  8:57 ` [PATCH 15/31] common/cnxk: fix BP threshold calculation Nithin Dabilpuram
2023-08-11  8:57 ` [PATCH 16/31] common/cnxk: allow same TC on multiple RQs Nithin Dabilpuram
2023-08-11  8:57 ` [PATCH 17/31] common/cnxk: expose different params for bp config Nithin Dabilpuram
2023-08-11  8:57 ` [PATCH 18/31] common/cnxk: enable CQ stashing Nithin Dabilpuram
2023-08-11  8:57 ` [PATCH 19/31] common/cnxk: fix incorrect aura ID Nithin Dabilpuram
2023-08-11  8:57 ` [PATCH 20/31] net/cnxk: fix CQ allocation Nithin Dabilpuram
2023-08-11  8:57 ` [PATCH 21/31] net/cnxk: fix issue with GCC 4.8 Nithin Dabilpuram
2023-08-11  8:57 ` [PATCH 22/31] net/cnxk: add mapping of DMAC address indexes Nithin Dabilpuram
2023-08-11  8:57 ` [PATCH 23/31] net/cnxk: support rate limit in PFC TM tree Nithin Dabilpuram
2023-08-11  8:57 ` [PATCH 24/31] net/cnxk: move MAC address set from init to configure Nithin Dabilpuram
2023-08-11  8:57 ` [PATCH 25/31] net/cnxk: update different size bit operations Nithin Dabilpuram
2023-08-11  8:58 ` [PATCH 26/31] net/cnxk: fix uninitialized variable Nithin Dabilpuram
2023-08-11  8:58 ` [PATCH 27/31] net/cnxk: fix usage of mbuf rearm data Nithin Dabilpuram
2023-08-11  8:58 ` [PATCH 28/31] net/cnxk: fix uninitialized variable Nithin Dabilpuram
2023-08-11  8:58 ` [PATCH 29/31] net/cnxk: check returned value for null Nithin Dabilpuram
2023-08-11  8:58 ` [PATCH 30/31] net/cnxk: add flag check for extension header when used Nithin Dabilpuram
2023-08-11  8:58 ` [PATCH 31/31] net/cnxk: fixes for IPv6 header in reassembly Nithin Dabilpuram
2023-08-14 12:07   ` Jerin Jacob

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20230811085805.441256-6-ndabilpuram@marvell.com \
    --to=ndabilpuram@marvell.com \
    --cc=dev@dpdk.org \
    --cc=jerinj@marvell.com \
    --cc=kirankumark@marvell.com \
    --cc=rbhansali@marvell.com \
    --cc=skori@marvell.com \
    --cc=skoteshwar@marvell.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).