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 0E436459C6; Wed, 18 Sep 2024 09:56:56 +0200 (CEST) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 390E243287; Wed, 18 Sep 2024 09:52:01 +0200 (CEST) Received: from inva020.nxp.com (inva020.nxp.com [92.121.34.13]) by mails.dpdk.org (Postfix) with ESMTP id 4FD9542F05 for ; Wed, 18 Sep 2024 09:51:16 +0200 (CEST) Received: from inva020.nxp.com (localhost [127.0.0.1]) by inva020.eu-rdc02.nxp.com (Postfix) with ESMTP id 3433D1A1BE5; Wed, 18 Sep 2024 09:51:16 +0200 (CEST) Received: from aprdc01srsp001v.ap-rdc01.nxp.com (aprdc01srsp001v.ap-rdc01.nxp.com [165.114.16.16]) by inva020.eu-rdc02.nxp.com (Postfix) with ESMTP id EFC731A13B5; Wed, 18 Sep 2024 09:51:15 +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 70E3E183C481; Wed, 18 Sep 2024 15:51:15 +0800 (+08) From: vanshika.shukla@nxp.com To: dev@dpdk.org, Hemant Agrawal , Sachin Saxena Cc: Vanshika Shukla Subject: [v2 41/43] net/dpaa2: support VLAN traffic splitting Date: Wed, 18 Sep 2024 13:20:54 +0530 Message-Id: <20240918075056.1838654-42-vanshika.shukla@nxp.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20240918075056.1838654-1-vanshika.shukla@nxp.com> References: <20240913055959.3246917-1-vanshika.shukla@nxp.com> <20240918075056.1838654-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