From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id 43AE441D8D for ; Mon, 27 Feb 2023 08:09:11 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 3C07B410EE; Mon, 27 Feb 2023 08:09:11 +0100 (CET) Received: from NAM11-BN8-obe.outbound.protection.outlook.com (mail-bn8nam11on2040.outbound.protection.outlook.com [40.107.236.40]) by mails.dpdk.org (Postfix) with ESMTP id 718C740A7D for ; Mon, 27 Feb 2023 08:09:10 +0100 (CET) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=H4EdWtlgYTA/2TFL44CtUiFG9ldX03Lh1VotetqeUgqHv0YaMDnPGLpHq/r8Uct4HkAKBmTP1tAZ64a9X1n3/pturVfU5lC6xptmT/T7Px42gsdgc49YDljE/m9unlzr4PR4DVYTj7I2hDcWeiTBcUplDTa9BMvzPJrG6kettORPONdYgfSEIycDkhaRWcMeV0R/G58cfWlY3At7YqKx7GwkNzsk//cR5KgdV7nHopvg7AoTsVgLQhUBXsfOCZYlSBxhjPD7v6zEqgLC6nTmdWYi5qwkSPMYuyZH/6x3RAGYTRblCLKYiK/VbLq8lmKNsNn1LNYoxnQDMD90IkPGiA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=AETETpWzlesQ8sFcjGu4PAQWJdYXlOLYQor8YLme1o0=; b=eEsz1IlR6kRvozoA2FEis3GumcnPkpPnBp30QO0yUBRH6h5pLo7dxGkHnkXr92DGUxFcuzjW+uCDT0HJ2vN6r1+paTT3nWCTc1VqRt1PpRzdV8jgNkxigmBSIMNZYgB4FEoItV/RX85qoLVjOc0k9OYumSPSF/6/JZLKA63YiVvN2RvyfD1mrKRU607i3rgaqJ2SnA9UQ+MZQi8Cwr/DJRdD49GdMnzsoJoEuKZCbXAn9YrAcjM6pm4cQNcJLVxGlNoXZwp3v1KaTh1RKv14t8gkR1hQNznuPas2a90MVqzezz3f6cg4iKH0f9jlOv13Z8t2q6dxlN40TPhTPMKvQg== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 216.228.117.160) smtp.rcpttodomain=marvell.com smtp.mailfrom=nvidia.com; dmarc=pass (p=reject sp=reject pct=100) action=none header.from=nvidia.com; dkim=none (message not signed); arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=Nvidia.com; s=selector2; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=AETETpWzlesQ8sFcjGu4PAQWJdYXlOLYQor8YLme1o0=; b=qgCjyfLUxg0efg74+lTGjRMnHHnC2Ti82czhmyMYO8o/b2LPBVTU5H/JwHu6D8WGlPhBwNvXUMZoyjDJ30L7PEGqgKxpXA/VaqVS1Y4xCytdo0QBcXeSnBI9yjmAPYAhUTYy6AW7cRhMTZnoOYXW8WOEx/GKiXgw02Zn8kCf8G62mDHYSboGUFuhnkYkPxcbdTEqj+pezkzXOSrOxd1TGFymnv49EACoVa9UKXs3x4VU1pbQkh+L8ClP+pb0/I5Bfg4t+/+ddHBdYpYYIp5Dkd+H5+9T88YJS1/hb2zBD+k3E+fqrHEunFIJpaXeK4yg208UdA9j7GEgN5xaimII3Q== Received: from BN9PR03CA0650.namprd03.prod.outlook.com (2603:10b6:408:13b::25) by DM6PR12MB4137.namprd12.prod.outlook.com (2603:10b6:5:218::21) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6134.25; Mon, 27 Feb 2023 07:09:08 +0000 Received: from BN8NAM11FT030.eop-nam11.prod.protection.outlook.com (2603:10b6:408:13b:cafe::89) by BN9PR03CA0650.outlook.office365.com (2603:10b6:408:13b::25) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6134.29 via Frontend Transport; Mon, 27 Feb 2023 07:09:08 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 216.228.117.160) smtp.mailfrom=nvidia.com; dkim=none (message not signed) header.d=none;dmarc=pass action=none header.from=nvidia.com; Received-SPF: Pass (protection.outlook.com: domain of nvidia.com designates 216.228.117.160 as permitted sender) receiver=protection.outlook.com; client-ip=216.228.117.160; helo=mail.nvidia.com; pr=C Received: from mail.nvidia.com (216.228.117.160) by BN8NAM11FT030.mail.protection.outlook.com (10.13.177.146) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6156.14 via Frontend Transport; Mon, 27 Feb 2023 07:09:07 +0000 Received: from rnnvmail201.nvidia.com (10.129.68.8) by mail.nvidia.com (10.129.200.66) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.986.36; Sun, 26 Feb 2023 23:08:59 -0800 Received: from nvidia.com (10.126.230.37) by rnnvmail201.nvidia.com (10.129.68.8) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.986.37; Sun, 26 Feb 2023 23:08:56 -0800 From: Xueming Li To: Satheesh Paul CC: Kiran Kumar K , dpdk stable Subject: patch 'common/cnxk: fix dual VLAN parsing' has been queued to stable release 22.11.2 Date: Mon, 27 Feb 2023 14:59:40 +0800 Message-ID: <20230227070107.15664-72-xuemingl@nvidia.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20230227070107.15664-1-xuemingl@nvidia.com> References: <20230227062349.13764-1-xuemingl@nvidia.com> <20230227070107.15664-1-xuemingl@nvidia.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Type: text/plain X-Originating-IP: [10.126.230.37] X-ClientProxiedBy: rnnvmail202.nvidia.com (10.129.68.7) To rnnvmail201.nvidia.com (10.129.68.8) X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: BN8NAM11FT030:EE_|DM6PR12MB4137:EE_ X-MS-Office365-Filtering-Correlation-Id: 6d946d1c-d5ad-44d5-7f6a-08db189184d5 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: aMi2PMEUqM0bCsWgaj3U6gTpFnUeyZhVBgXOcv7BXctT7mUonzFDYjmqNSZXYu9lFwyo/1CxZXyB8lN0qvSH7uqZ0eCwzcmshgDlxucguue2LgR98J5dDtOK/nzREWWj3ibC6OS1Gkyu3vm6yRCCSBY6TJZjZQZBNt5n1pNLCbK22oy8i2aMuFpmoC7+DX/LqDQU3fvezzQCVkr2jI364fCV/IWffzKYEI/BN7j9Dx7EB4lwBx25J1UkZ3HyOktVuCSgNklXm+5ALmY+cBVvfqLWkEJoPSvdhF4fRBAkn0dQl3aDQhiOdyFshrBp6WltGPoVrv28gRu2dOE2/oIxnO7OMBGbxNVqKVW6K49kfDuAeTqpfuv3r0tOftPO3o1/nTnd86JbxQHjkeFlKX/Zj4t49ja5W3Hctu47GK0WTDJsFVtsTg7ERgDRVSgO0T31CDMiHhmcWT2l9kSYp8ziXatodXjsKC+GNtp8iV7SaY5dKLnGj5Oei/NWFu+LoblQZa6eH80dLzq8nafcPYxivr3jTw7zO+aCxMa3vNQQ9T8za5e1uNqceH9s2eYlsid4ggYnJJOLQ0mbfTmAtM0h7AKo41cslU7k2uZ+Xpw2tafjQ7JbPJ/dlDHR5g+5e2iQxvgLARsECChZ/dCcUeXv7s+Q5MUf/8qzMp9uAe9RKSuH8emiyO1JT5TOhqbanA1hUXOQ5sTyf4FBLLGyA5XUPoFc6pDtbK3SgGO/Nqpkk5UGVF9cy7kgaoSfD5wdIh9LB1riKKevQuYWWPTJWivZG6NnEyr8RfSWVLKfcgT+fMy7YpIIvbnl3hJYN1cqs+vb X-Forefront-Antispam-Report: CIP:216.228.117.160; CTRY:US; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:mail.nvidia.com; PTR:dc6edge1.nvidia.com; CAT:NONE; SFS:(13230025)(4636009)(39860400002)(346002)(396003)(376002)(136003)(451199018)(46966006)(36840700001)(40470700004)(41300700001)(8936002)(30864003)(2906002)(4326008)(6916009)(5660300002)(70206006)(70586007)(8676002)(54906003)(83380400001)(316002)(478600001)(40480700001)(6286002)(36756003)(966005)(40460700003)(53546011)(186003)(16526019)(1076003)(26005)(6666004)(426003)(55016003)(2616005)(34020700004)(336012)(82310400005)(82740400003)(7636003)(7696005)(36860700001)(47076005)(356005)(86362001); DIR:OUT; SFP:1101; X-OriginatorOrg: Nvidia.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 27 Feb 2023 07:09:07.8934 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 6d946d1c-d5ad-44d5-7f6a-08db189184d5 X-MS-Exchange-CrossTenant-Id: 43083d15-7273-40c1-b7db-39efd9ccc17a X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=43083d15-7273-40c1-b7db-39efd9ccc17a; Ip=[216.228.117.160]; Helo=[mail.nvidia.com] X-MS-Exchange-CrossTenant-AuthSource: BN8NAM11FT030.eop-nam11.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM6PR12MB4137 X-BeenThere: stable@dpdk.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: patches for DPDK stable branches List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: stable-bounces@dpdk.org Hi, FYI, your patch has been queued to stable release 22.11.2 Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet. It will be pushed if I get no objections before 03/01/23. So please shout if anyone has objections. Also note that after the patch there's a diff of the upstream commit vs the patch applied to the branch. This will indicate if there was any rebasing needed to apply to the stable branch. If there were code changes for rebasing (ie: not only metadata diffs), please double check that the rebase was correctly done. Queued patches are on a temporary branch at: https://git.dpdk.org/dpdk-stable/log/?h=22.11-staging This queued commit can be viewed at: https://git.dpdk.org/dpdk-stable/commit/?h=22.11-staging&id=5444957e577f1b9591662fbd4e2d2c4f2e1194c5 Thanks. Xueming Li --- >From 5444957e577f1b9591662fbd4e2d2c4f2e1194c5 Mon Sep 17 00:00:00 2001 From: Satheesh Paul Date: Wed, 11 Jan 2023 11:08:14 +0530 Subject: [PATCH] common/cnxk: fix dual VLAN parsing Cc: Xueming Li [ upstream commit 474124865694177da3d4e0a60c4686c6d5ac1e56 ] Flow parsing was not handling pattern matching on the fields of inner VLAN even though MKEX profile could be extracting inner VLAN fields. Code has been modified to handle matching fields on two VLAN tags. Fixes: c34ea71b878d ("common/cnxk: add NPC parsing API") Signed-off-by: Satheesh Paul Reviewed-by: Kiran Kumar K --- drivers/common/cnxk/roc_npc_parse.c | 240 +++++++++++++++++++++------- drivers/common/cnxk/roc_npc_priv.h | 16 +- drivers/common/cnxk/roc_npc_utils.c | 2 +- 3 files changed, 186 insertions(+), 72 deletions(-) diff --git a/drivers/common/cnxk/roc_npc_parse.c b/drivers/common/cnxk/roc_npc_parse.c index ff00c746d6..670f920117 100644 --- a/drivers/common/cnxk/roc_npc_parse.c +++ b/drivers/common/cnxk/roc_npc_parse.c @@ -238,10 +238,185 @@ npc_parse_la(struct npc_parse_state *pst) #define NPC_MAX_SUPPORTED_VLANS 3 +static int +npc_parse_vlan_count(const struct roc_npc_item_info *pattern, + const struct roc_npc_item_info **pattern_list, + const struct roc_npc_flow_item_vlan **vlan_items, int *vlan_count) +{ + *vlan_count = 0; + while (pattern->type == ROC_NPC_ITEM_TYPE_VLAN) { + if (*vlan_count > NPC_MAX_SUPPORTED_VLANS - 1) + return NPC_ERR_PATTERN_NOTSUP; + + /* Don't support ranges */ + if (pattern->last != NULL) + return NPC_ERR_INVALID_RANGE; + + /* If spec is NULL, both mask and last must be NULL, this + * makes it to match ANY value (eq to mask = 0). + * Setting either mask or last without spec is an error + */ + if (pattern->spec == NULL) { + if (pattern->last != NULL && pattern->mask != NULL) + return NPC_ERR_INVALID_SPEC; + } + + pattern_list[*vlan_count] = pattern; + vlan_items[*vlan_count] = pattern->spec; + (*vlan_count)++; + + pattern++; + pattern = npc_parse_skip_void_and_any_items(pattern); + } + + return 0; +} + +static int +npc_parse_vlan_ltype_get(struct npc_parse_state *pst, + const struct roc_npc_flow_item_vlan **vlan_item, int vlan_count, + int *ltype, int *lflags) +{ + switch (vlan_count) { + case 1: + *ltype = NPC_LT_LB_CTAG; + if (vlan_item[0] && vlan_item[0]->has_more_vlan) + *ltype = NPC_LT_LB_STAG_QINQ; + break; + case 2: + if (vlan_item[1] && vlan_item[1]->has_more_vlan) { + if (!(pst->npc->keyx_supp_nmask[pst->nix_intf] & + 0x3ULL << NPC_LFLAG_LB_OFFSET)) + return NPC_ERR_PATTERN_NOTSUP; + + /* This lflag value will match either one of + * NPC_F_LB_L_WITH_STAG_STAG, + * NPC_F_LB_L_WITH_QINQ_CTAG, + * NPC_F_LB_L_WITH_QINQ_QINQ and + * NPC_F_LB_L_WITH_ITAG (0b0100 to 0b0111). For + * NPC_F_LB_L_WITH_ITAG, ltype is NPC_LT_LB_ETAG + * hence will not match. + */ + + *lflags = NPC_F_LB_L_WITH_QINQ_CTAG & NPC_F_LB_L_WITH_QINQ_QINQ & + NPC_F_LB_L_WITH_STAG_STAG; + } + *ltype = NPC_LT_LB_STAG_QINQ; + break; + case 3: + if (vlan_item[2] && vlan_item[2]->has_more_vlan) + return NPC_ERR_PATTERN_NOTSUP; + if (!(pst->npc->keyx_supp_nmask[pst->nix_intf] & 0x3ULL << NPC_LFLAG_LB_OFFSET)) + return NPC_ERR_PATTERN_NOTSUP; + *ltype = NPC_LT_LB_STAG_QINQ; + *lflags = NPC_F_STAG_STAG_CTAG; + break; + default: + return NPC_ERR_PATTERN_NOTSUP; + } + + return 0; +} + +static int +npc_update_vlan_parse_state(struct npc_parse_state *pst, const struct roc_npc_item_info *pattern, + int lid, int lt, uint8_t lflags, int vlan_count) +{ + uint8_t vlan_spec[NPC_MAX_SUPPORTED_VLANS * sizeof(struct roc_vlan_hdr)]; + uint8_t vlan_mask[NPC_MAX_SUPPORTED_VLANS * sizeof(struct roc_vlan_hdr)]; + int rc = 0, i, offset = NPC_TPID_LENGTH; + struct npc_parse_item_info parse_info; + char hw_mask[NPC_MAX_EXTRACT_HW_LEN]; + + memset(vlan_spec, 0, sizeof(struct roc_vlan_hdr) * NPC_MAX_SUPPORTED_VLANS); + memset(vlan_mask, 0, sizeof(struct roc_vlan_hdr) * NPC_MAX_SUPPORTED_VLANS); + memset(&parse_info, 0, sizeof(parse_info)); + + if (vlan_count > 2) + vlan_count = 2; + + for (i = 0; i < vlan_count; i++) { + if (pattern[i].spec) + memcpy(vlan_spec + offset, pattern[i].spec, sizeof(struct roc_vlan_hdr)); + if (pattern[i].mask) + memcpy(vlan_mask + offset, pattern[i].mask, sizeof(struct roc_vlan_hdr)); + + offset += 4; + } + + parse_info.def_mask = NULL; + parse_info.spec = vlan_spec; + parse_info.mask = vlan_mask; + parse_info.def_mask = NULL; + parse_info.hw_hdr_len = 0; + + lid = NPC_LID_LB; + parse_info.hw_mask = hw_mask; + + if (lt == NPC_LT_LB_CTAG) + parse_info.len = sizeof(struct roc_vlan_hdr) + NPC_TPID_LENGTH; + + if (lt == NPC_LT_LB_STAG_QINQ) + parse_info.len = sizeof(struct roc_vlan_hdr) * 2 + NPC_TPID_LENGTH; + + memset(hw_mask, 0, sizeof(hw_mask)); + + parse_info.hw_mask = &hw_mask; + npc_get_hw_supp_mask(pst, &parse_info, lid, lt); + + rc = npc_mask_is_supported(parse_info.mask, parse_info.hw_mask, parse_info.len); + if (!rc) + return NPC_ERR_INVALID_MASK; + + /* Point pattern to last item consumed */ + pst->pattern = pattern; + return npc_update_parse_state(pst, &parse_info, lid, lt, lflags); +} + +static int +npc_parse_lb_vlan(struct npc_parse_state *pst) +{ + const struct roc_npc_flow_item_vlan *vlan_items[NPC_MAX_SUPPORTED_VLANS]; + const struct roc_npc_item_info *pattern_list[NPC_MAX_SUPPORTED_VLANS]; + const struct roc_npc_item_info *last_pattern; + int vlan_count = 0, rc = 0; + int lid, lt, lflags; + + lid = NPC_LID_LB; + lflags = 0; + last_pattern = pst->pattern; + + rc = npc_parse_vlan_count(pst->pattern, pattern_list, vlan_items, &vlan_count); + if (rc) + return rc; + + rc = npc_parse_vlan_ltype_get(pst, vlan_items, vlan_count, <, &lflags); + if (rc) + return rc; + + if (vlan_count == 3) { + if (pattern_list[2]->spec != NULL && pattern_list[2]->mask != NULL && + pattern_list[2]->last != NULL) + return NPC_ERR_PATTERN_NOTSUP; + + /* Matching can be done only for two tags. */ + vlan_count = 2; + last_pattern++; + } + + rc = npc_update_vlan_parse_state(pst, pattern_list[0], lid, lt, lflags, vlan_count); + if (rc) + return rc; + + if (vlan_count > 1) + pst->pattern = last_pattern + vlan_count; + + return 0; +} + int npc_parse_lb(struct npc_parse_state *pst) { - const struct roc_npc_flow_item_vlan *vlan_item[NPC_MAX_SUPPORTED_VLANS]; const struct roc_npc_item_info *pattern = pst->pattern; const struct roc_npc_item_info *last_pattern; const struct roc_npc_flow_item_raw *raw_spec; @@ -250,7 +425,6 @@ npc_parse_lb(struct npc_parse_state *pst) char hw_mask[NPC_MAX_EXTRACT_HW_LEN]; struct npc_parse_item_info info; int lid, lt, lflags, len = 0; - int nr_vlans = 0; int rc; info.def_mask = NULL; @@ -267,68 +441,10 @@ npc_parse_lb(struct npc_parse_state *pst) /* RTE vlan is either 802.1q or 802.1ad, * this maps to either CTAG/STAG. We need to decide * based on number of VLANS present. Matching is - * supported on first tag only. + * supported on first two tags. */ - info.hw_mask = NULL; - info.len = sizeof(vlan_item[0]->hdr); - - pattern = pst->pattern; - while (pattern->type == ROC_NPC_ITEM_TYPE_VLAN) { - if (nr_vlans > NPC_MAX_SUPPORTED_VLANS - 1) - return NPC_ERR_PATTERN_NOTSUP; - - vlan_item[nr_vlans] = pattern->spec; - nr_vlans++; - /* Basic validation of Second/Third vlan item */ - if (nr_vlans > 1) { - rc = npc_parse_item_basic(pattern, &info); - if (rc != 0) - return rc; - } - last_pattern = pattern; - pattern++; - pattern = npc_parse_skip_void_and_any_items(pattern); - } - - switch (nr_vlans) { - case 1: - lt = NPC_LT_LB_CTAG; - if (vlan_item[0] && vlan_item[0]->has_more_vlan) - lt = NPC_LT_LB_STAG_QINQ; - break; - case 2: - if (vlan_item[1] && vlan_item[1]->has_more_vlan) { - if (!(pst->npc->keyx_supp_nmask[pst->nix_intf] & - 0x3ULL << NPC_LFLAG_LB_OFFSET)) - return NPC_ERR_PATTERN_NOTSUP; - - /* This lflag value will match either one of - * NPC_F_LB_L_WITH_STAG_STAG, - * NPC_F_LB_L_WITH_QINQ_CTAG, - * NPC_F_LB_L_WITH_QINQ_QINQ and - * NPC_F_LB_L_WITH_ITAG (0b0100 to 0b0111). For - * NPC_F_LB_L_WITH_ITAG, ltype is NPC_LT_LB_ETAG - * hence will not match. - */ - - lflags = NPC_F_LB_L_WITH_QINQ_CTAG & - NPC_F_LB_L_WITH_QINQ_QINQ & - NPC_F_LB_L_WITH_STAG_STAG; - } else { - lflags = NPC_F_LB_L_WITH_CTAG; - } - lt = NPC_LT_LB_STAG_QINQ; - break; - case 3: - if (vlan_item[2] && vlan_item[2]->has_more_vlan) - return NPC_ERR_PATTERN_NOTSUP; - lt = NPC_LT_LB_STAG_QINQ; - lflags = NPC_F_STAG_STAG_CTAG; - break; - default: - return NPC_ERR_PATTERN_NOTSUP; - } + return npc_parse_lb_vlan(pst); } else if (pst->pattern->type == ROC_NPC_ITEM_TYPE_E_TAG) { /* we can support ETAG and match a subsequent CTAG * without any matching support. diff --git a/drivers/common/cnxk/roc_npc_priv.h b/drivers/common/cnxk/roc_npc_priv.h index 1a597280d1..23acb7b01d 100644 --- a/drivers/common/cnxk/roc_npc_priv.h +++ b/drivers/common/cnxk/roc_npc_priv.h @@ -416,17 +416,15 @@ int npc_mcam_alloc_entry(struct npc *npc, struct roc_npc_flow *mcam, int npc_mcam_alloc_entries(struct npc *npc, int ref_mcam, int *alloc_entry, int req_count, int prio, int *resp_count); -int npc_mcam_ena_dis_entry(struct npc *npc, struct roc_npc_flow *mcam, - bool enable); +int npc_mcam_ena_dis_entry(struct npc *npc, struct roc_npc_flow *mcam, bool enable); int npc_mcam_write_entry(struct npc *npc, struct roc_npc_flow *mcam); int npc_flow_enable_all_entries(struct npc *npc, bool enable); -int npc_update_parse_state(struct npc_parse_state *pst, - struct npc_parse_item_info *info, int lid, int lt, - uint8_t flags); -void npc_get_hw_supp_mask(struct npc_parse_state *pst, - struct npc_parse_item_info *info, int lid, int lt); -int npc_parse_item_basic(const struct roc_npc_item_info *item, - struct npc_parse_item_info *info); +int npc_update_parse_state(struct npc_parse_state *pst, struct npc_parse_item_info *info, int lid, + int lt, uint8_t flags); +void npc_get_hw_supp_mask(struct npc_parse_state *pst, struct npc_parse_item_info *info, int lid, + int lt); +int npc_mask_is_supported(const char *mask, const char *hw_mask, int len); +int npc_parse_item_basic(const struct roc_npc_item_info *item, struct npc_parse_item_info *info); int npc_parse_meta_items(struct npc_parse_state *pst); int npc_parse_mark_item(struct npc_parse_state *pst); int npc_parse_pre_l2(struct npc_parse_state *pst); diff --git a/drivers/common/cnxk/roc_npc_utils.c b/drivers/common/cnxk/roc_npc_utils.c index 8bdabc116d..fda3073cba 100644 --- a/drivers/common/cnxk/roc_npc_utils.c +++ b/drivers/common/cnxk/roc_npc_utils.c @@ -88,7 +88,7 @@ npc_get_hw_supp_mask(struct npc_parse_state *pst, } } -static inline int +inline int npc_mask_is_supported(const char *mask, const char *hw_mask, int len) { /* -- 2.25.1 --- Diff of the applied patch vs upstream commit (please double-check if non-empty: --- --- - 2023-02-27 14:08:43.226436400 +0800 +++ 0073-common-cnxk-fix-dual-VLAN-parsing.patch 2023-02-27 14:08:40.799237000 +0800 @@ -1 +1 @@ -From 474124865694177da3d4e0a60c4686c6d5ac1e56 Mon Sep 17 00:00:00 2001 +From 5444957e577f1b9591662fbd4e2d2c4f2e1194c5 Mon Sep 17 00:00:00 2001 @@ -4,0 +5,3 @@ +Cc: Xueming Li + +[ upstream commit 474124865694177da3d4e0a60c4686c6d5ac1e56 ] @@ -12 +14,0 @@ -Cc: stable@dpdk.org @@ -23 +25 @@ -index c1af5f3087..d8f9271fa8 100644 +index ff00c746d6..670f920117 100644 @@ -26 +28 @@ -@@ -239,10 +239,185 @@ npc_parse_la(struct npc_parse_state *pst) +@@ -238,10 +238,185 @@ npc_parse_la(struct npc_parse_state *pst) @@ -213 +215 @@ -@@ -251,7 +426,6 @@ npc_parse_lb(struct npc_parse_state *pst) +@@ -250,7 +425,6 @@ npc_parse_lb(struct npc_parse_state *pst) @@ -221 +223 @@ -@@ -268,68 +442,10 @@ npc_parse_lb(struct npc_parse_state *pst) +@@ -267,68 +441,10 @@ npc_parse_lb(struct npc_parse_state *pst) @@ -293 +295 @@ -index fe19329a7f..2a7d3137fb 100644 +index 1a597280d1..23acb7b01d 100644 @@ -296,3 +298,3 @@ -@@ -418,17 +418,15 @@ int npc_mcam_alloc_entry(struct npc *npc, struct roc_npc_flow *mcam, - int npc_mcam_alloc_entries(struct mbox *mbox, int ref_mcam, int *alloc_entry, int req_count, - int prio, int *resp_count, bool is_conti); +@@ -416,17 +416,15 @@ int npc_mcam_alloc_entry(struct npc *npc, struct roc_npc_flow *mcam, + int npc_mcam_alloc_entries(struct npc *npc, int ref_mcam, int *alloc_entry, + int req_count, int prio, int *resp_count); @@ -303 +305 @@ - int npc_mcam_write_entry(struct mbox *mbox, struct roc_npc_flow *mcam); + int npc_mcam_write_entry(struct npc *npc, struct roc_npc_flow *mcam);