From patchwork Mon Aug 1 06:16:27 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Satheesh Paul Antonysamy X-Patchwork-Id: 114474 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 0FC20A00C3; Mon, 1 Aug 2022 08:16:45 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 92DF641101; Mon, 1 Aug 2022 08:16:44 +0200 (CEST) Received: from mx0b-0016f401.pphosted.com (mx0b-0016f401.pphosted.com [67.231.156.173]) by mails.dpdk.org (Postfix) with ESMTP id 0C4994067B; Mon, 1 Aug 2022 08:16:42 +0200 (CEST) Received: from pps.filterd (m0045851.ppops.net [127.0.0.1]) by mx0b-0016f401.pphosted.com (8.17.1.5/8.17.1.5) with ESMTP id 26VHTonw019459; Sun, 31 Jul 2022 23:16:42 -0700 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=marvell.com; h=from : to : cc : subject : date : message-id : mime-version : content-transfer-encoding : content-type; s=pfpt0220; bh=zW1/R6AnMWLtlLCtBYi42o0Wq7nQ9GGYq72lZuFg+hw=; b=PedSH+3uTM9OXwedRBwzSyWMh3pI7EyRUxt43eVsGiHYec5xyWq7yfhVpdGE9xIEoppk w3Poc/T8mBr32G0t6gtbm29tgJpo9nzUEBAj43RDHnXyXOF9R+j3FyFIsEKG2NBgYXtT CA+OEG23TWdp8anWiJlmnh1dBHiaBy3lmoOcwbFOGXVl4OuOpN1KmmULZnrc0W2FEx2j siuIyM+yT1CuSNkRz5X1NBphJBKv20tVIUNSQSL9zkuI9Gv64scuKj2EaeqiDPjBUA+1 X7KTtQZY6ucLfr6V8sQdJHwFwzwPBM4fpufJDRPryI54En89TeVflUbxHIFKhl6f1mgG kg== Received: from dc5-exch02.marvell.com ([199.233.59.182]) by mx0b-0016f401.pphosted.com (PPS) with ESMTPS id 3hn45m59h6-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-SHA384 bits=256 verify=NOT); Sun, 31 Jul 2022 23:16:42 -0700 Received: from DC5-EXCH01.marvell.com (10.69.176.38) by DC5-EXCH02.marvell.com (10.69.176.39) with Microsoft SMTP Server (TLS) id 15.0.1497.18; Sun, 31 Jul 2022 23:16:35 -0700 Received: from maili.marvell.com (10.69.176.80) by DC5-EXCH01.marvell.com (10.69.176.38) with Microsoft SMTP Server id 15.0.1497.2 via Frontend Transport; Sun, 31 Jul 2022 23:16:35 -0700 Received: from satheeshpaullabpc.. (unknown [10.28.34.33]) by maili.marvell.com (Postfix) with ESMTP id B49503F704E; Sun, 31 Jul 2022 23:16:32 -0700 (PDT) From: To: Nithin Dabilpuram , Kiran Kumar K , Sunil Kumar Kori , Satha Rao CC: , Satheesh Paul , Subject: [dpdk-dev] [PATCH 1/3] common/cnxk: fix printing disabled MKEX registers Date: Mon, 1 Aug 2022 11:46:27 +0530 Message-ID: <20220801061629.1862969-1-psatheesh@marvell.com> X-Mailer: git-send-email 2.35.3 MIME-Version: 1.0 X-Proofpoint-GUID: 6H-QgzZgRSrM-3V8UGBsV8Gm5j1Gzbkq X-Proofpoint-ORIG-GUID: 6H-QgzZgRSrM-3V8UGBsV8Gm5j1Gzbkq X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.205,Aquarius:18.0.883,Hydra:6.0.517,FMLib:17.11.122.1 definitions=2022-08-01_01,2022-07-28_02,2022-06-22_01 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: Satheesh Paul This patch skips printing disabled MKEX registers when dumping hardware flow MCAM entry data. Fixes: 9869c39918 ("common/cnxk: support flow entry dump") Cc: stable@dpdk.org Signed-off-by: Satheesh Paul Reviewed-by: Kiran Kumar K --- drivers/common/cnxk/roc_npc_mcam_dump.c | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/drivers/common/cnxk/roc_npc_mcam_dump.c b/drivers/common/cnxk/roc_npc_mcam_dump.c index 2aaf3ccd0b..16997bd38a 100644 --- a/drivers/common/cnxk/roc_npc_mcam_dump.c +++ b/drivers/common/cnxk/roc_npc_mcam_dump.c @@ -310,8 +310,10 @@ npc_flow_print_item(FILE *file, struct npc *npc, struct npc_xtract_info *xinfo, for (i = 0; i < NPC_MAX_LFL; i++) { lflags_info = npc->prx_fxcfg[intf][ld][i].xtract; - npc_flow_print_xtractinfo(file, lflags_info, flow, lid, - lt); + if (!lflags_info->enable) + continue; + + npc_flow_print_xtractinfo(file, lflags_info, flow, lid, lt); } } } @@ -620,7 +622,7 @@ roc_npc_flow_mcam_dump(FILE *file, struct roc_npc *roc_npc, mcam_read_req->entry = flow->mcam_id; rc = mbox_process_msg(npc->mbox, (void *)&mcam_read_rsp); if (rc) { - plt_err("Failed to fetch MCAM entry"); + plt_err("Failed to fetch MCAM entry:%d", flow->mcam_id); return; } From patchwork Mon Aug 1 06:16:28 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Satheesh Paul Antonysamy X-Patchwork-Id: 114475 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 616E2A00C3; Mon, 1 Aug 2022 08:16:50 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id A6EA742C79; Mon, 1 Aug 2022 08:16:45 +0200 (CEST) Received: from mx0b-0016f401.pphosted.com (mx0b-0016f401.pphosted.com [67.231.156.173]) by mails.dpdk.org (Postfix) with ESMTP id 55A8241101 for ; Mon, 1 Aug 2022 08:16:43 +0200 (CEST) Received: from pps.filterd (m0045851.ppops.net [127.0.0.1]) by mx0b-0016f401.pphosted.com (8.17.1.5/8.17.1.5) with ESMTP id 26VHTonx019459 for ; Sun, 31 Jul 2022 23:16:42 -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=Daoj3AEauuy5OsWDpOry2S/EPdv00d1/Lcoixglq4h4=; b=UaMyIvnshAENON+8IFZeD5dNcfL2NJSS0+mzRI+GkJIWy3BDz2RXsrZz3VHX8UYoQcBh caJF2xGrI8X1Nihe/soJRe5auXU3qMZZ0ftU6gECU2+zKSUDGEUlhpbnLXrcR7fm5lXe dxYgXdss9/szhlH8+o6pUxmBF5eGxGebH15tFgEbxFhX4DFLx2vPlpozxDjf2FsIegJF pjcyvnS5lUllB2Rn9CHOHdAE7qxI6EK7L9uvlQh24XfnnTnHL4BbEhn75SO/zqz96Bih xI+EL5P+//XV1FK02/aklaN++Upd0BddY3Y5MXBUuXuYIuhGhZ3u5c0tlq/0t9S5ml5i 1g== Received: from dc5-exch02.marvell.com ([199.233.59.182]) by mx0b-0016f401.pphosted.com (PPS) with ESMTPS id 3hn45m59h6-2 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-SHA384 bits=256 verify=NOT) for ; Sun, 31 Jul 2022 23:16:42 -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.18; Sun, 31 Jul 2022 23:16:40 -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.18 via Frontend Transport; Sun, 31 Jul 2022 23:16:40 -0700 Received: from satheeshpaullabpc.. (unknown [10.28.34.33]) by maili.marvell.com (Postfix) with ESMTP id BE90F3F70AA; Sun, 31 Jul 2022 23:16:37 -0700 (PDT) From: To: Nithin Dabilpuram , Kiran Kumar K , Sunil Kumar Kori , Satha Rao CC: , Satheesh Paul Subject: [dpdk-dev] [PATCH 2/3] common/cnxk: print counters along with flow dump Date: Mon, 1 Aug 2022 11:46:28 +0530 Message-ID: <20220801061629.1862969-2-psatheesh@marvell.com> X-Mailer: git-send-email 2.35.3 In-Reply-To: <20220801061629.1862969-1-psatheesh@marvell.com> References: <20220801061629.1862969-1-psatheesh@marvell.com> MIME-Version: 1.0 X-Proofpoint-GUID: GwyVC-oub5s-o1ny_vuOebqS3fpVPlCH X-Proofpoint-ORIG-GUID: GwyVC-oub5s-o1ny_vuOebqS3fpVPlCH X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.205,Aquarius:18.0.883,Hydra:6.0.517,FMLib:17.11.122.1 definitions=2022-08-01_01,2022-07-28_02,2022-06-22_01 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: Satheesh Paul When dumping hardware flow data, print any counter configured on the flow as well. Signed-off-by: Satheesh Paul Reviewed-by: Kiran Kumar K --- drivers/common/cnxk/roc_npc_mcam_dump.c | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/drivers/common/cnxk/roc_npc_mcam_dump.c b/drivers/common/cnxk/roc_npc_mcam_dump.c index 16997bd38a..fe57811a84 100644 --- a/drivers/common/cnxk/roc_npc_mcam_dump.c +++ b/drivers/common/cnxk/roc_npc_mcam_dump.c @@ -590,12 +590,19 @@ roc_npc_flow_mcam_dump(FILE *file, struct roc_npc *roc_npc, struct npc *npc = roc_npc_to_npc_priv(roc_npc); struct npc_mcam_read_entry_req *mcam_read_req; struct npc_mcam_read_entry_rsp *mcam_read_rsp; + uint64_t count = 0; bool is_rx = 0; int i, rc = 0; fprintf(file, "MCAM Index:%d\n", flow->mcam_id); - fprintf(file, "Interface :%s (%d)\n", intf_str[flow->nix_intf], - flow->nix_intf); + if (flow->ctr_id != NPC_COUNTER_NONE && flow->use_ctr) { + rc = roc_npc_mcam_read_counter(roc_npc, flow->ctr_id, &count); + if (rc) + return; + fprintf(file, "Hit count: %" PRIu64 "\n", count); + } + + fprintf(file, "Interface :%s (%d)\n", intf_str[flow->nix_intf], flow->nix_intf); fprintf(file, "Priority :%d\n", flow->priority); if (flow->nix_intf == NIX_INTF_RX) From patchwork Mon Aug 1 06:16:29 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Satheesh Paul Antonysamy X-Patchwork-Id: 114476 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 979FDA00C3; Mon, 1 Aug 2022 08:16:56 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id A45A442C71; Mon, 1 Aug 2022 08:16:49 +0200 (CEST) Received: from mx0b-0016f401.pphosted.com (mx0a-0016f401.pphosted.com [67.231.148.174]) by mails.dpdk.org (Postfix) with ESMTP id 3008C42C71 for ; Mon, 1 Aug 2022 08:16:47 +0200 (CEST) Received: from pps.filterd (m0045849.ppops.net [127.0.0.1]) by mx0a-0016f401.pphosted.com (8.17.1.5/8.17.1.5) with ESMTP id 26VKSENL006995 for ; Sun, 31 Jul 2022 23:16:46 -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=YnXRzYJyxv/IKik5M5D0/S+fXjqLyM1q88xi0D8xB7Q=; b=lDPR5NrcnijKcZXens6CcvR8dPW5SPOCGMxow2ScBvdv7waEasuCSEyuZe18wqHQX0No e4cP/u8pRwhztgED5Oz6L+psYT3S55YU/jyoEZg0xMSV5c05FmlENunF7ZVV56x1gk7r MJPz/+gO3rgRXvf28SYsaWi73iCKpoKJB9LfCSngetzNyf0XUbmdm3kcfxhj0IW7Vr2B FbG42WOPSYFoqxh7DpUp/LLxMxY81U/ZW6qRd4nprfMlTbJIOUl4Vnyk9a1s/TV0JZlL kpFE4fZUriU+2EGXQXSf75egMKlwgwQnfS3pYE/Kzn5OeOIMUCyrGN4PZ86fTToOugXq EA== Received: from dc5-exch02.marvell.com ([199.233.59.182]) by mx0a-0016f401.pphosted.com (PPS) with ESMTPS id 3hn20q5qpp-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-SHA384 bits=256 verify=NOT) for ; Sun, 31 Jul 2022 23:16:46 -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.18; Sun, 31 Jul 2022 23:16:44 -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.18 via Frontend Transport; Sun, 31 Jul 2022 23:16:44 -0700 Received: from satheeshpaullabpc.. (unknown [10.28.34.33]) by maili.marvell.com (Postfix) with ESMTP id 73E9D3F704E; Sun, 31 Jul 2022 23:16:42 -0700 (PDT) From: To: Nithin Dabilpuram , Kiran Kumar K , Sunil Kumar Kori , Satha Rao CC: , Satheesh Paul Subject: [dpdk-dev] [PATCH 3/3] common/cnxk: update MKEX capability flags Date: Mon, 1 Aug 2022 11:46:29 +0530 Message-ID: <20220801061629.1862969-3-psatheesh@marvell.com> X-Mailer: git-send-email 2.35.3 In-Reply-To: <20220801061629.1862969-1-psatheesh@marvell.com> References: <20220801061629.1862969-1-psatheesh@marvell.com> MIME-Version: 1.0 X-Proofpoint-GUID: fnoqNRyNzVIzqsP_NpadJPJ1cFrS8pA5 X-Proofpoint-ORIG-GUID: fnoqNRyNzVIzqsP_NpadJPJ1cFrS8pA5 X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.205,Aquarius:18.0.883,Hydra:6.0.517,FMLib:17.11.122.1 definitions=2022-08-01_01,2022-07-28_02,2022-06-22_01 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: Satheesh Paul Update MKEX capability flags to enable parsing VLAN PCP, DSCP and GTPv1 TEID. Signed-off-by: Satheesh Paul Reviewed-by: Kiran Kumar K --- drivers/common/cnxk/roc_npc_mcam.c | 86 ++++++++++++------------------ drivers/common/cnxk/roc_npc_priv.h | 12 +++-- 2 files changed, 44 insertions(+), 54 deletions(-) diff --git a/drivers/common/cnxk/roc_npc_mcam.c b/drivers/common/cnxk/roc_npc_mcam.c index 245eeb0107..a71f0c8b8a 100644 --- a/drivers/common/cnxk/roc_npc_mcam.c +++ b/drivers/common/cnxk/roc_npc_mcam.c @@ -232,80 +232,64 @@ npc_get_kex_capability(struct npc *npc) memset(&kex_cap, 0, sizeof(kex_cap)); /* Ethtype: Offset 12B, len 2B */ - kex_cap.bit.ethtype_0 = npc_is_kex_enabled( - npc, NPC_LID_LA, NPC_LT_LA_ETHER, 12 * 8, 2 * 8); + kex_cap.bit.ethtype_0 = npc_is_kex_enabled(npc, NPC_LID_LA, NPC_LT_LA_ETHER, 12 * 8, 2 * 8); /* QINQ VLAN Ethtype: offset 8B, len 2B */ - kex_cap.bit.ethtype_x = npc_is_kex_enabled( - npc, NPC_LID_LB, NPC_LT_LB_STAG_QINQ, 8 * 8, 2 * 8); + kex_cap.bit.ethtype_x = + npc_is_kex_enabled(npc, NPC_LID_LB, NPC_LT_LB_STAG_QINQ, 8 * 8, 2 * 8); /* VLAN ID0 : Outer VLAN: Offset 2B, len 2B */ - kex_cap.bit.vlan_id_0 = npc_is_kex_enabled( - npc, NPC_LID_LB, NPC_LT_LB_CTAG, 2 * 8, 2 * 8); - /* VLAN ID0 : Inner VLAN: offset 6B, len 2B */ - kex_cap.bit.vlan_id_x = npc_is_kex_enabled( - npc, NPC_LID_LB, NPC_LT_LB_STAG_QINQ, 6 * 8, 2 * 8); + kex_cap.bit.vlan_id_0 = npc_is_kex_enabled(npc, NPC_LID_LB, NPC_LT_LB_CTAG, 2 * 8, 2 * 8); + /* VLAN PCP0 : Outer VLAN: Offset 2B, len 1B */ + kex_cap.bit.vlan_pcp_0 = npc_is_kex_enabled(npc, NPC_LID_LB, NPC_LT_LB_CTAG, 2 * 8, 2 * 1); + /* VLAN IDX : Inner VLAN: offset 6B, len 2B */ + kex_cap.bit.vlan_id_x = + npc_is_kex_enabled(npc, NPC_LID_LB, NPC_LT_LB_STAG_QINQ, 6 * 8, 2 * 8); /* DMCA: offset 0B, len 6B */ - kex_cap.bit.dmac = npc_is_kex_enabled(npc, NPC_LID_LA, NPC_LT_LA_ETHER, - 0 * 8, 6 * 8); + kex_cap.bit.dmac = npc_is_kex_enabled(npc, NPC_LID_LA, NPC_LT_LA_ETHER, 0 * 8, 6 * 8); /* IP proto: offset 9B, len 1B */ - kex_cap.bit.ip_proto = - npc_is_kex_enabled(npc, NPC_LID_LC, NPC_LT_LC_IP, 9 * 8, 1 * 8); + kex_cap.bit.ip_proto = npc_is_kex_enabled(npc, NPC_LID_LC, NPC_LT_LC_IP, 9 * 8, 1 * 8); + /* IPv4 dscp: offset 1B, len 1B, IPv6 dscp: offset 0B, len 2B */ + kex_cap.bit.ip_dscp = npc_is_kex_enabled(npc, NPC_LID_LC, NPC_LT_LC_IP, 1 * 8, 1 * 8) & + npc_is_kex_enabled(npc, NPC_LID_LC, NPC_LT_LC_IP6, 0, 2 * 8); /* UDP dport: offset 2B, len 2B */ - kex_cap.bit.udp_dport = npc_is_kex_enabled(npc, NPC_LID_LD, - NPC_LT_LD_UDP, 2 * 8, 2 * 8); + kex_cap.bit.udp_dport = npc_is_kex_enabled(npc, NPC_LID_LD, NPC_LT_LD_UDP, 2 * 8, 2 * 8); /* UDP sport: offset 0B, len 2B */ - kex_cap.bit.udp_sport = npc_is_kex_enabled(npc, NPC_LID_LD, - NPC_LT_LD_UDP, 0 * 8, 2 * 8); + kex_cap.bit.udp_sport = npc_is_kex_enabled(npc, NPC_LID_LD, NPC_LT_LD_UDP, 0 * 8, 2 * 8); /* TCP dport: offset 2B, len 2B */ - kex_cap.bit.tcp_dport = npc_is_kex_enabled(npc, NPC_LID_LD, - NPC_LT_LD_TCP, 2 * 8, 2 * 8); + kex_cap.bit.tcp_dport = npc_is_kex_enabled(npc, NPC_LID_LD, NPC_LT_LD_TCP, 2 * 8, 2 * 8); /* TCP sport: offset 0B, len 2B */ - kex_cap.bit.tcp_sport = npc_is_kex_enabled(npc, NPC_LID_LD, - NPC_LT_LD_TCP, 0 * 8, 2 * 8); + kex_cap.bit.tcp_sport = npc_is_kex_enabled(npc, NPC_LID_LD, NPC_LT_LD_TCP, 0 * 8, 2 * 8); /* IP SIP: offset 12B, len 4B */ - kex_cap.bit.sip_addr = npc_is_kex_enabled(npc, NPC_LID_LC, NPC_LT_LC_IP, - 12 * 8, 4 * 8); + kex_cap.bit.sip_addr = npc_is_kex_enabled(npc, NPC_LID_LC, NPC_LT_LC_IP, 12 * 8, 4 * 8); /* IP DIP: offset 14B, len 4B */ - kex_cap.bit.dip_addr = npc_is_kex_enabled(npc, NPC_LID_LC, NPC_LT_LC_IP, - 14 * 8, 4 * 8); + kex_cap.bit.dip_addr = npc_is_kex_enabled(npc, NPC_LID_LC, NPC_LT_LC_IP, 14 * 8, 4 * 8); /* IP6 SIP: offset 8B, len 16B */ - kex_cap.bit.sip6_addr = npc_is_kex_enabled(npc, NPC_LID_LC, NPC_LT_LC_IP6, - 8 * 8, 16 * 8); + kex_cap.bit.sip6_addr = npc_is_kex_enabled(npc, NPC_LID_LC, NPC_LT_LC_IP6, 8 * 8, 16 * 8); /* IP6 DIP: offset 24B, len 16B */ - kex_cap.bit.dip6_addr = npc_is_kex_enabled( - npc, NPC_LID_LC, NPC_LT_LC_IP6, 24 * 8, 16 * 8); + kex_cap.bit.dip6_addr = npc_is_kex_enabled(npc, NPC_LID_LC, NPC_LT_LC_IP6, 24 * 8, 16 * 8); /* ESP SPI: offset 0B, len 4B */ - kex_cap.bit.ipsec_spi = npc_is_kex_enabled(npc, NPC_LID_LE, - NPC_LT_LE_ESP, 0 * 8, 4 * 8); + kex_cap.bit.ipsec_spi = npc_is_kex_enabled(npc, NPC_LID_LE, NPC_LT_LE_ESP, 0 * 8, 4 * 8); /* VXLAN VNI: offset 4B, len 3B */ - kex_cap.bit.ld_vni = npc_is_kex_enabled(npc, NPC_LID_LE, - NPC_LT_LE_VXLAN, 0 * 8, 3 * 8); + kex_cap.bit.ld_vni = npc_is_kex_enabled(npc, NPC_LID_LE, NPC_LT_LE_VXLAN, 0 * 8, 3 * 8); /* Custom L3 frame: varied offset and lengths */ - kex_cap.bit.custom_l3 = - npc_is_kex_enabled(npc, NPC_LID_LC, NPC_LT_LC_CUSTOM0, 0, 0); - kex_cap.bit.custom_l3 |= (uint64_t)npc_is_kex_enabled(npc, NPC_LID_LC, - NPC_LT_LC_CUSTOM1, 0, 0); + kex_cap.bit.custom_l3 = npc_is_kex_enabled(npc, NPC_LID_LC, NPC_LT_LC_CUSTOM0, 0, 0); + kex_cap.bit.custom_l3 |= + (uint64_t)npc_is_kex_enabled(npc, NPC_LID_LC, NPC_LT_LC_CUSTOM1, 0, 0); /* SCTP sport : offset 0B, len 2B */ - kex_cap.bit.sctp_sport = npc_is_kex_enabled( - npc, NPC_LID_LD, NPC_LT_LD_SCTP, 0 * 8, 2 * 8); + kex_cap.bit.sctp_sport = npc_is_kex_enabled(npc, NPC_LID_LD, NPC_LT_LD_SCTP, 0 * 8, 2 * 8); /* SCTP dport : offset 2B, len 2B */ - kex_cap.bit.sctp_dport = npc_is_kex_enabled( - npc, NPC_LID_LD, NPC_LT_LD_SCTP, 2 * 8, 2 * 8); + kex_cap.bit.sctp_dport = npc_is_kex_enabled(npc, NPC_LID_LD, NPC_LT_LD_SCTP, 2 * 8, 2 * 8); /* ICMP type : offset 0B, len 1B */ - kex_cap.bit.icmp_type = npc_is_kex_enabled( - npc, NPC_LID_LD, NPC_LT_LD_ICMP, 0 * 8, 1 * 8); + kex_cap.bit.icmp_type = npc_is_kex_enabled(npc, NPC_LID_LD, NPC_LT_LD_ICMP, 0 * 8, 1 * 8); /* ICMP code : offset 1B, len 1B */ - kex_cap.bit.icmp_code = npc_is_kex_enabled( - npc, NPC_LID_LD, NPC_LT_LD_ICMP, 1 * 8, 1 * 8); + kex_cap.bit.icmp_code = npc_is_kex_enabled(npc, NPC_LID_LD, NPC_LT_LD_ICMP, 1 * 8, 1 * 8); /* ICMP id : offset 4B, len 2B */ - kex_cap.bit.icmp_id = npc_is_kex_enabled(npc, NPC_LID_LD, - NPC_LT_LD_ICMP, 4 * 8, 2 * 8); + kex_cap.bit.icmp_id = npc_is_kex_enabled(npc, NPC_LID_LD, NPC_LT_LD_ICMP, 4 * 8, 2 * 8); /* IGMP grp_addr : offset 4B, len 4B */ - kex_cap.bit.igmp_grp_addr = npc_is_kex_enabled( - npc, NPC_LID_LD, NPC_LT_LD_IGMP, 4 * 8, 4 * 8); + kex_cap.bit.igmp_grp_addr = + npc_is_kex_enabled(npc, NPC_LID_LD, NPC_LT_LD_IGMP, 4 * 8, 4 * 8); /* GTPU teid : offset 4B, len 4B */ - kex_cap.bit.gtpu_teid = npc_is_kex_enabled( - npc, NPC_LID_LE, NPC_LT_LE_GTPU, 4 * 8, 4 * 8); + kex_cap.bit.gtpv1_teid = npc_is_kex_enabled(npc, NPC_LID_LE, NPC_LT_LE_GTPU, 4 * 8, 4 * 8); return kex_cap.all_bits; } diff --git a/drivers/common/cnxk/roc_npc_priv.h b/drivers/common/cnxk/roc_npc_priv.h index b08539d8f8..1a597280d1 100644 --- a/drivers/common/cnxk/roc_npc_priv.h +++ b/drivers/common/cnxk/roc_npc_priv.h @@ -100,6 +100,7 @@ enum npc_err_status { enum npc_mcam_intf { NPC_MCAM_RX, NPC_MCAM_TX }; typedef union npc_kex_cap_terms_t { + /** Packet Matching Rule term fields */ struct { /** Total length of received packet */ uint64_t len : 1; @@ -111,10 +112,14 @@ typedef union npc_kex_cap_terms_t { uint64_t vlan_id_0 : 1; /** Last VLAN ID (inner) */ uint64_t vlan_id_x : 1; + /** PCP in the first VLAN header */ + uint64_t vlan_pcp_0 : 1; /** destination MAC address */ uint64_t dmac : 1; /** IP Protocol or IPv6 Next Header */ uint64_t ip_proto : 1; + /** DSCP in IP header */ + uint64_t ip_dscp : 1; /** Destination UDP port, implies IPPROTO=17 */ uint64_t udp_dport : 1; /** Destination TCP port implies IPPROTO=6 */ @@ -155,12 +160,13 @@ typedef union npc_kex_cap_terms_t { uint64_t sctp_sport : 1; /** Destination SCTP port */ uint64_t sctp_dport : 1; - /** GTPU Tunnel endpoint identifier */ - uint64_t gtpu_teid : 1; - + /** GTPv1 tunnel endpoint identifier */ + uint64_t gtpv1_teid : 1; } bit; + /** All bits of the bit field structure */ uint64_t all_bits; + } npc_kex_cap_terms_t; struct npc_parse_item_info {