From patchwork Fri Aug 11 08:57:40 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Nithin Dabilpuram X-Patchwork-Id: 130120 X-Patchwork-Delegate: jerinj@marvell.com Return-Path: X-Original-To: patchwork@inbox.dpdk.org Delivered-To: patchwork@inbox.dpdk.org Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id 4995743032; Fri, 11 Aug 2023 10:58:46 +0200 (CEST) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 088794326C; Fri, 11 Aug 2023 10:58:30 +0200 (CEST) Received: from mx0b-0016f401.pphosted.com (mx0a-0016f401.pphosted.com [67.231.148.174]) by mails.dpdk.org (Postfix) with ESMTP id 6B39A43264 for ; Fri, 11 Aug 2023 10:58:28 +0200 (CEST) Received: from pps.filterd (m0045849.ppops.net [127.0.0.1]) by mx0a-0016f401.pphosted.com (8.17.1.19/8.17.1.19) with ESMTP id 37AMjx5O001610 for ; Fri, 11 Aug 2023 01:58:27 -0700 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=marvell.com; h=from : to : cc : subject : date : message-id : in-reply-to : references : mime-version : content-transfer-encoding : content-type; s=pfpt0220; bh=VScEcG8DDwsq44tUr3fLcQveePexiv2ET2mKdUNpqOI=; b=iksv8CJVu8AO6mB1cIqdpt/w49fC43z5E3y3Cdr4ijY0M9QOIDYTKmicZ+MadPNQlEE6 OcZvqXaxo2om1LQpnB7e/jw6+6OwfuQTTdw6h1mAmJQGLqfqOwTAIgW6WN4iBYKUaQSM faxNpREfcdjAMsACAynDnAnr3/yOqQ7Jsq/iVsXu6xmY2AxWAHxBn/k6814ym8viL7aW 2pDwCfuuZCo9EWvxVxlL1zyqJIY8ZDluiQRpSkEj1zrtAfpH6r0ioSG2LV9tzR4zbbtE fA4Y7kQNMLF3so+qDg7jZYUorlIrWqUm4deR96UyooW3NoNfPUP944RTHdPUnsJ7urWK uw== Received: from dc5-exch02.marvell.com ([199.233.59.182]) by mx0a-0016f401.pphosted.com (PPS) with ESMTPS id 3sd8yp9r6c-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-SHA384 bits=256 verify=NOT) for ; Fri, 11 Aug 2023 01:58:27 -0700 Received: from DC5-EXCH02.marvell.com (10.69.176.39) by DC5-EXCH02.marvell.com (10.69.176.39) with Microsoft SMTP Server (TLS) id 15.0.1497.48; Fri, 11 Aug 2023 01:58:25 -0700 Received: from maili.marvell.com (10.69.176.80) by DC5-EXCH02.marvell.com (10.69.176.39) with Microsoft SMTP Server id 15.0.1497.48 via Frontend Transport; Fri, 11 Aug 2023 01:58:25 -0700 Received: from hyd1588t430.caveonetworks.com (unknown [10.29.52.204]) by maili.marvell.com (Postfix) with ESMTP id 790183F706B; Fri, 11 Aug 2023 01:58:23 -0700 (PDT) From: Nithin Dabilpuram To: Nithin Dabilpuram , Kiran Kumar K , Sunil Kumar Kori , Satha Rao CC: , , Rahul Bhansali Subject: [PATCH 06/31] common/cnxk: fixes CGX promisc toggling Date: Fri, 11 Aug 2023 14:27:40 +0530 Message-ID: <20230811085805.441256-6-ndabilpuram@marvell.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20230811085805.441256-1-ndabilpuram@marvell.com> References: <20230811085805.441256-1-ndabilpuram@marvell.com> MIME-Version: 1.0 X-Proofpoint-ORIG-GUID: 6ZvSjBKVN55ZmGyW3spREuHB1xD0w9aC X-Proofpoint-GUID: 6ZvSjBKVN55ZmGyW3spREuHB1xD0w9aC X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.267,Aquarius:18.0.957,Hydra:6.0.591,FMLib:17.11.176.26 definitions=2023-08-10_20,2023-08-10_01,2023-05-22_02 X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org From: Rahul Bhansali 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 --- 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