From patchwork Thu May 7 10:46:42 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Hemant Agrawal X-Patchwork-Id: 186294 Delivered-To: patch@linaro.org Received: by 2002:a92:8d81:0:0:0:0:0 with SMTP id w1csp3041495ill; Thu, 7 May 2020 03:49:51 -0700 (PDT) X-Google-Smtp-Source: APiQypKVmxdkPeP9/Ns30APpFb6J/tBmnZ9UfKJIiQRSWNSDyiUhZGcK9GlFX27Y9+8Pbot4tXjm X-Received: by 2002:a05:6402:1b91:: with SMTP id cc17mr10889087edb.46.1588848591176; Thu, 07 May 2020 03:49:51 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1588848591; cv=none; d=google.com; s=arc-20160816; b=acLD8HV+/6EZYREzLxAT/owFwD5JKlLGsFTNfuq1U2rX8E8pkUrY8NZ1o+aC14mtb0 bM5UmA3a6P8AYv/KEg5A3PBlHBdcfJDM/ZuoC9VYLaetXAgk+gmcmTJSQeBtd7MF7D3D 8P7x2oxCW+l70YvEHgMoWRJYpPidbqIRbsuCzllMMTq8Swh3suplseRTh1dPN59Rk7W3 exH2rVg+utb/hU3JU3k4/LOVRYIminhi8iWbhbxVB8gtVC5yBJ4IbwZ01LjSd6oxpay5 Ntz1ohuOL2QO60A8+DPvbGpv8Hu+3B28S8/c9QAwJRkCFiyl+roC3HQiaMQBkL2vP6Xt HCxg== 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=M+jaTfxICO4bFs7YS1QqzjlT1smYv3gtfnY6M7wgEBaG+UVTk8xDxUBaU7XihZlBoe CdPeKBym6wyXDLqJZiOilCv301gfF5TCbRd59xk2GPrY7ucFTWYagEQRL7S/ycYzkhNS a6dTwMo/sdy3QQy8rLEGbVCV6g4wGcNHpAM0rQWFiCXpb4eM9WxOH+H1Wt9ULCQD/3ZB LSxFHXqG7pTzAi+qAR/d77aKJFQ/1Ywa4tH87A2zTEabOB02HTxflGxOlIXTrODaH7nN eKwwOS+pZ75XWzmfpqgHGrPk2YbCv2RSD4WXj4ztXPuWNP4BaplSP55wmDojbGMvEN9V 45PQ== 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 p9si3121201ejn.415.2020.05.07.03.49.50; Thu, 07 May 2020 03:49:51 -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 043E91DC18; Thu, 7 May 2020 12:49:10 +0200 (CEST) Received: from inva021.nxp.com (inva021.nxp.com [92.121.34.21]) by dpdk.org (Postfix) with ESMTP id CFB5D1DBE1 for ; Thu, 7 May 2020 12:49:02 +0200 (CEST) Received: from inva021.nxp.com (localhost [127.0.0.1]) by inva021.eu-rdc02.nxp.com (Postfix) with ESMTP id B340A200FAC; Thu, 7 May 2020 12:49:02 +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 127752017FB; Thu, 7 May 2020 12:49:01 +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 8CE7140319; Thu, 7 May 2020 18:48:58 +0800 (SGT) From: Hemant Agrawal To: dev@dpdk.org, ferruh.yigit@intel.com Cc: Nipun Gupta Date: Thu, 7 May 2020 16:16:42 +0530 Message-Id: <20200507104645.31990-7-hemant.agrawal@nxp.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20200507104645.31990-1-hemant.agrawal@nxp.com> References: <20200504124118.22877-1-hemant.agrawal@nxp.com> <20200507104645.31990-1-hemant.agrawal@nxp.com> X-Virus-Scanned: ClamAV using ClamSMTP Subject: [dpdk-dev] [PATCH v4 6/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;