From patchwork Fri May 8 12:59:30 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Hemant Agrawal X-Patchwork-Id: 186329 Delivered-To: patch@linaro.org Received: by 2002:a92:8d81:0:0:0:0:0 with SMTP id w1csp4155626ill; Fri, 8 May 2020 06:02:44 -0700 (PDT) X-Google-Smtp-Source: APiQypKx+yHmVUhM+zbCvuFszghTTZ8GCEIkcH7uR1Agg698sOLYMukJR3TNwVTqZcA5oYpbg91c X-Received: by 2002:aa7:c453:: with SMTP id n19mr2046593edr.218.1588942964546; Fri, 08 May 2020 06:02:44 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1588942964; cv=none; d=google.com; s=arc-20160816; b=AjD+srlwMDFu2k0Gx7CboCMLyTf0hGZAeo4VE20FsR4WrVOZeNx+NPgNOvCWP6cptq 5H2yspkepCTPTAdJ+nUDtYrIK0neq/ZNGZsMfJ19iFcq6+qygtGtRTF5HQqi3RJCMbxl NGK4G4O5vK7jeGc8nTZBAI4d3CEEsS3x++xHG9vxQ6k/N00rpUSnj8IVMXhk8/QbeSAZ efWGnUQfEWMxnT4LVjSiSX/HbrBcukSD+oZ6jJQKHaMIN6jFtszc6QdOthK2XJ2yMuJm MIFPV4oYX0Sf+Md900+1FM0RILl2CSZM/jJbHtg/+XSl6c5KbvOhIlYVfF7T6G8TySg+ gEHA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:subject:references:in-reply-to :message-id:date:cc:to:from; bh=OTbQjgtpMPdyFi9bqeqocwgjatvRKLx/YSlE7sUyxqI=; b=g/7w8QEjnX34kt5UFPI5X6yKWxGQ70r3eI9rC3cH5118qicnNrpwA1JQw8iiVRo1Ls mhRxDuT4u0CTsPzQfJjcpxeNrbRcio4Z9z/1jia4wU8wJSiTtspapvoqINLXtWL9N+F9 w8NOuZKTvJ/sC0hsDa0IrcJngHJqkJP8SC7EavddOBPt7p2N05Vs0ov+USSgqkac5Hb6 YVsXp+S/U/rhxjH1nBe4Z8oL3JF/wAV8I6EXuKP7bxIAGD7U2f7LRea3l1BWh4NFa0MT pOj4PrNRWj/jdg4KHQr7RGAysEiBonF5O+gsq/qxOH1aBJ9O5N3MU4CFyiedb95AT8be X+FA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of dev-bounces@dpdk.org designates 92.243.14.124 as permitted sender) smtp.mailfrom=dev-bounces@dpdk.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=nxp.com Return-Path: Received: from dpdk.org (dpdk.org. [92.243.14.124]) by mx.google.com with ESMTP id j9si933856ejo.308.2020.05.08.06.02.44; Fri, 08 May 2020 06:02:44 -0700 (PDT) Received-SPF: pass (google.com: domain of dev-bounces@dpdk.org designates 92.243.14.124 as permitted sender) client-ip=92.243.14.124; Authentication-Results: mx.google.com; spf=pass (google.com: domain of dev-bounces@dpdk.org designates 92.243.14.124 as permitted sender) smtp.mailfrom=dev-bounces@dpdk.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=nxp.com Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id AB5971DB2E; Fri, 8 May 2020 15:02:02 +0200 (CEST) Received: from inva021.nxp.com (inva021.nxp.com [92.121.34.21]) by dpdk.org (Postfix) with ESMTP id E9A001DAD0 for ; Fri, 8 May 2020 15:01:52 +0200 (CEST) Received: from inva021.nxp.com (localhost [127.0.0.1]) by inva021.eu-rdc02.nxp.com (Postfix) with ESMTP id 9844620100F; Fri, 8 May 2020 15:01:52 +0200 (CEST) Received: from invc005.ap-rdc01.nxp.com (invc005.ap-rdc01.nxp.com [165.114.16.14]) by inva021.eu-rdc02.nxp.com (Postfix) with ESMTP id EB40D201389; Fri, 8 May 2020 15:01:50 +0200 (CEST) Received: from bf-netperf1.ap.freescale.net (bf-netperf1.ap.freescale.net [10.232.133.63]) by invc005.ap-rdc01.nxp.com (Postfix) with ESMTP id 6E36C4030E; Fri, 8 May 2020 21:01:48 +0800 (SGT) From: Hemant Agrawal To: dev@dpdk.org, ferruh.yigit@intel.com Cc: Nipun Gupta Date: Fri, 8 May 2020 18:29:30 +0530 Message-Id: <20200508125934.14255-6-hemant.agrawal@nxp.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20200508125934.14255-1-hemant.agrawal@nxp.com> References: <20200507104645.31990-1-hemant.agrawal@nxp.com> <20200508125934.14255-1-hemant.agrawal@nxp.com> X-Virus-Scanned: ClamAV using ClamSMTP Subject: [dpdk-dev] [PATCH v5 5/9] net/dpaa2: support UDP dst port based muxing X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" From: Nipun Gupta This change adds DPDMUX support to bifurcate traffic on the basis of UDP destination port. Signed-off-by: Nipun Gupta --- drivers/net/dpaa2/dpaa2_mux.c | 24 +++++++++++++++++++++++- 1 file changed, 23 insertions(+), 1 deletion(-) -- 2.17.1 diff --git a/drivers/net/dpaa2/dpaa2_mux.c b/drivers/net/dpaa2/dpaa2_mux.c index af90adb828..9ac8806faf 100644 --- a/drivers/net/dpaa2/dpaa2_mux.c +++ b/drivers/net/dpaa2/dpaa2_mux.c @@ -1,5 +1,5 @@ /* SPDX-License-Identifier: BSD-3-Clause - * Copyright 2018-2019 NXP + * Copyright 2018-2020 NXP */ #include @@ -99,6 +99,7 @@ rte_pmd_dpaa2_mux_flow_create(uint32_t dpdmux_id, case RTE_FLOW_ITEM_TYPE_IPV4: { const struct rte_flow_item_ipv4 *spec; + kg_cfg.extracts[0].extract.from_hdr.prot = NET_PROT_IP; kg_cfg.extracts[0].extract.from_hdr.field = NH_FLD_IP_PROTO; kg_cfg.extracts[0].type = DPKG_EXTRACT_FROM_HDR; @@ -113,10 +114,31 @@ rte_pmd_dpaa2_mux_flow_create(uint32_t dpdmux_id, } break; + case RTE_FLOW_ITEM_TYPE_UDP: + { + const struct rte_flow_item_udp *spec; + uint16_t udp_dst_port; + + kg_cfg.extracts[0].extract.from_hdr.prot = NET_PROT_UDP; + kg_cfg.extracts[0].extract.from_hdr.field = NH_FLD_UDP_PORT_DST; + kg_cfg.extracts[0].type = DPKG_EXTRACT_FROM_HDR; + kg_cfg.extracts[0].extract.from_hdr.type = DPKG_FULL_FIELD; + kg_cfg.num_extracts = 1; + + spec = (const struct rte_flow_item_udp *)pattern[0]->spec; + udp_dst_port = rte_constant_bswap16(spec->hdr.dst_port); + memcpy((void *)key_iova, (const void *)&udp_dst_port, + sizeof(rte_be16_t)); + memcpy(mask_iova, pattern[0]->mask, sizeof(uint16_t)); + key_size = sizeof(uint16_t); + } + break; + case RTE_FLOW_ITEM_TYPE_ETH: { const struct rte_flow_item_eth *spec; uint16_t eth_type; + kg_cfg.extracts[0].extract.from_hdr.prot = NET_PROT_ETH; kg_cfg.extracts[0].extract.from_hdr.field = NH_FLD_ETH_TYPE; kg_cfg.extracts[0].type = DPKG_EXTRACT_FROM_HDR;