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 8273645977; Fri, 13 Sep 2024 08:06:02 +0200 (CEST) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 92A85432DE; Fri, 13 Sep 2024 08:01:05 +0200 (CEST) Received: from inva021.nxp.com (inva021.nxp.com [92.121.34.21]) by mails.dpdk.org (Postfix) with ESMTP id 310CE42DE9 for ; Fri, 13 Sep 2024 08:00:19 +0200 (CEST) Received: from inva021.nxp.com (localhost [127.0.0.1]) by inva021.eu-rdc02.nxp.com (Postfix) with ESMTP id 0478D20031C; Fri, 13 Sep 2024 08:00:19 +0200 (CEST) Received: from aprdc01srsp001v.ap-rdc01.nxp.com (aprdc01srsp001v.ap-rdc01.nxp.com [165.114.16.16]) by inva021.eu-rdc02.nxp.com (Postfix) with ESMTP id 8B1DF200345; Fri, 13 Sep 2024 08:00:18 +0200 (CEST) Received: from lsv03379.swis.in-blr01.nxp.com (lsv03379.swis.in-blr01.nxp.com [92.120.147.188]) by aprdc01srsp001v.ap-rdc01.nxp.com (Postfix) with ESMTP id D8B15183DC05; Fri, 13 Sep 2024 14:00:17 +0800 (+08) From: vanshika.shukla@nxp.com To: dev@dpdk.org, Hemant Agrawal , Sachin Saxena Cc: Vanshika Shukla Subject: [v1 41/43] net/dpaa2: support VLAN traffic splitting Date: Fri, 13 Sep 2024 11:29:57 +0530 Message-Id: <20240913055959.3246917-42-vanshika.shukla@nxp.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20240913055959.3246917-1-vanshika.shukla@nxp.com> References: <20240913055959.3246917-1-vanshika.shukla@nxp.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Virus-Scanned: ClamAV using ClamSMTP 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: Vanshika Shukla This patch adds support for adding rules in DPDMUX to split VLAN traffic based on VLAN ids. Signed-off-by: Vanshika Shukla --- drivers/net/dpaa2/dpaa2_mux.c | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/drivers/net/dpaa2/dpaa2_mux.c b/drivers/net/dpaa2/dpaa2_mux.c index 3c9e155b23..c35baf4cde 100644 --- a/drivers/net/dpaa2/dpaa2_mux.c +++ b/drivers/net/dpaa2/dpaa2_mux.c @@ -118,6 +118,26 @@ rte_pmd_dpaa2_mux_flow_create(uint32_t dpdmux_id, } break; + case RTE_FLOW_ITEM_TYPE_VLAN: + { + const struct rte_flow_item_vlan *spec; + + kg_cfg.extracts[0].type = DPKG_EXTRACT_FROM_HDR; + kg_cfg.extracts[0].extract.from_hdr.prot = NET_PROT_VLAN; + kg_cfg.extracts[0].extract.from_hdr.field = NH_FLD_VLAN_TCI; + kg_cfg.extracts[0].extract.from_hdr.type = DPKG_FROM_FIELD; + kg_cfg.extracts[0].extract.from_hdr.offset = 1; + kg_cfg.extracts[0].extract.from_hdr.size = 1; + kg_cfg.num_extracts = 1; + + spec = (const struct rte_flow_item_vlan *)pattern[0]->spec; + memcpy((void *)key_iova, (const void *)(&spec->hdr.vlan_tci), + sizeof(uint16_t)); + memcpy(mask_iova, pattern[0]->mask, sizeof(uint16_t)); + key_size = sizeof(uint16_t); + } + break; + case RTE_FLOW_ITEM_TYPE_UDP: { const struct rte_flow_item_udp *spec; -- 2.25.1