From patchwork Thu May 25 09:58:58 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Nithin Dabilpuram X-Patchwork-Id: 127422 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 DA0B842B9A; Thu, 25 May 2023 12:37:06 +0200 (CEST) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id B426E40DF8; Thu, 25 May 2023 12:37:06 +0200 (CEST) Received: from mx0b-0016f401.pphosted.com (mx0b-0016f401.pphosted.com [67.231.156.173]) by mails.dpdk.org (Postfix) with ESMTP id EEF6740DDB for ; Thu, 25 May 2023 12:37:04 +0200 (CEST) Received: from pps.filterd (m0045851.ppops.net [127.0.0.1]) by mx0b-0016f401.pphosted.com (8.17.1.19/8.17.1.19) with ESMTP id 34P9fed7030891 for ; Thu, 25 May 2023 03:37:04 -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=NW+saCGBXwOTrekbjaVdFI5ao0v6J64Q845zbvBVPAw=; b=a4pm7nDmua/Erk9XUzj1cCYVpjuyDT8QQtyzBDTJc8R/McXlzml5u/NpRIUCKGj+5Lyy ctxAWGRUxLttfbpiOckBh8UGCOkSzRDIe6HS3P0ilxfo9UiXMZWSP8MhcqQMfE3edAe9 uoxUWTMP4HcyZe3zXshXjDSl2EFLKV5McgWLDFW81/WtaQjM0V7VKssos9aUFvEalDYD TPBRfIIrZtkKlJN4UfARQNEMiC9KQ3HIN6a/GIrIobq1gGWLngcrs2M6AC0CQX4t1dw+ eIsOA/PYRo3P/nEzPvweUgeo4Jz23AoSE5SC8ZBBCPK5ugajhoT7P9Kqpx+JHC+DOb74 lA== Received: from dc5-exch01.marvell.com ([199.233.59.181]) by mx0b-0016f401.pphosted.com (PPS) with ESMTPS id 3qsspt2cm4-2 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-SHA384 bits=256 verify=NOT) for ; Thu, 25 May 2023 03:37:04 -0700 Received: from DC5-EXCH02.marvell.com (10.69.176.39) by DC5-EXCH01.marvell.com (10.69.176.38) with Microsoft SMTP Server (TLS) id 15.0.1497.48; Thu, 25 May 2023 03:37:02 -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; Thu, 25 May 2023 03:37:02 -0700 Received: from hyd1588t430.caveonetworks.com (unknown [10.29.52.204]) by maili.marvell.com (Postfix) with ESMTP id 71ED05B6E9B; Thu, 25 May 2023 03:00:34 -0700 (PDT) From: Nithin Dabilpuram To: Nithin Kumar Dabilpuram , Kiran Kumar K , Sunil Kumar Kori , Satha Rao CC: , Subject: [PATCH v3 26/32] common/cnxk: skip CGX promisc mode with NPC exact match Date: Thu, 25 May 2023 15:28:58 +0530 Message-ID: <20230525095904.3967080-26-ndabilpuram@marvell.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20230525095904.3967080-1-ndabilpuram@marvell.com> References: <20230411091144.1087887-1-ndabilpuram@marvell.com> <20230525095904.3967080-1-ndabilpuram@marvell.com> MIME-Version: 1.0 X-Proofpoint-GUID: UGmRASBbK_3jiBLkjfkErj4xjLwxCThq X-Proofpoint-ORIG-GUID: UGmRASBbK_3jiBLkjfkErj4xjLwxCThq X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.254,Aquarius:18.0.957,Hydra:6.0.573,FMLib:17.11.176.26 definitions=2023-05-25_06,2023-05-24_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 When NPC exact match is enabled, we cannot use CGX promisc mode as CGX filtering is permanently disabled. Hence skip calling it to avoid mbox errors. Signed-off-by: Nithin Dabilpuram Signed-off-by: Kiran Kumar K --- drivers/common/cnxk/roc_nix_mac.c | 8 ++++++++ drivers/common/cnxk/roc_nix_priv.h | 1 + drivers/common/cnxk/roc_npc.c | 1 + drivers/common/cnxk/roc_npc_mcam.c | 1 + drivers/common/cnxk/roc_npc_priv.h | 1 + 5 files changed, 12 insertions(+) diff --git a/drivers/common/cnxk/roc_nix_mac.c b/drivers/common/cnxk/roc_nix_mac.c index ac30fb52d1..754d75ac73 100644 --- a/drivers/common/cnxk/roc_nix_mac.c +++ b/drivers/common/cnxk/roc_nix_mac.c @@ -201,6 +201,14 @@ 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 diff --git a/drivers/common/cnxk/roc_nix_priv.h b/drivers/common/cnxk/roc_nix_priv.h index 6872630dc8..ea4211dfed 100644 --- a/drivers/common/cnxk/roc_nix_priv.h +++ b/drivers/common/cnxk/roc_nix_priv.h @@ -130,6 +130,7 @@ struct nix { struct nix_qint *cints_mem; uint8_t configured_qints; uint8_t configured_cints; + uint8_t exact_match_ena; struct roc_nix_rq **rqs; struct roc_nix_sq **sqs; uint16_t vwqe_interval; diff --git a/drivers/common/cnxk/roc_npc.c b/drivers/common/cnxk/roc_npc.c index 1baa71fc45..d88c4d3bd6 100644 --- a/drivers/common/cnxk/roc_npc.c +++ b/drivers/common/cnxk/roc_npc.c @@ -272,6 +272,7 @@ roc_npc_init(struct roc_npc *roc_npc) roc_npc->rx_parse_nibble = npc->keyx_supp_nmask[NPC_MCAM_RX]; npc->mcam_entries = npc_mcam_tot_entries() >> npc->keyw[NPC_MCAM_RX]; + nix->exact_match_ena = npc->exact_match_ena; /* Free, free_rev, live and live_rev entries */ bmap_sz = plt_bitmap_get_memory_footprint(npc->mcam_entries); diff --git a/drivers/common/cnxk/roc_npc_mcam.c b/drivers/common/cnxk/roc_npc_mcam.c index e0019818c7..62e0ce21b2 100644 --- a/drivers/common/cnxk/roc_npc_mcam.c +++ b/drivers/common/cnxk/roc_npc_mcam.c @@ -542,6 +542,7 @@ npc_mcam_fetch_kex_cfg(struct npc *npc) mbox_memcpy((char *)npc->profile_name, kex_rsp->mkex_pfl_name, MKEX_NAME_LEN); + npc->exact_match_ena = (kex_rsp->rx_keyx_cfg >> 40) & 0xF; npc_mcam_process_mkex_cfg(npc, kex_rsp); done: diff --git a/drivers/common/cnxk/roc_npc_priv.h b/drivers/common/cnxk/roc_npc_priv.h index 6f41df18bb..30274e837b 100644 --- a/drivers/common/cnxk/roc_npc_priv.h +++ b/drivers/common/cnxk/roc_npc_priv.h @@ -404,6 +404,7 @@ struct npc { struct npc_prio_flow_list_head *prio_flow_list; struct plt_bitmap *rss_grp_entries; struct npc_flow_list ipsec_list; + uint8_t exact_match_ena; }; #define NPC_HASH_FIELD_LEN 16