From patchwork Mon May 4 12:41:16 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Hemant Agrawal X-Patchwork-Id: 186113 Delivered-To: patch@linaro.org Received: by 2002:a92:8d81:0:0:0:0:0 with SMTP id w1csp84430ill; Mon, 4 May 2020 05:44:21 -0700 (PDT) X-Google-Smtp-Source: APiQypKe7UjTSEtF/c6GjFRE9Rrle0+Q7OTRtyBhgBr8oty4qeEV2AGSt/mX8au+e/2Cui5AeD/s X-Received: by 2002:a17:907:43c2:: with SMTP id i2mr14785739ejs.185.1588596261464; Mon, 04 May 2020 05:44:21 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1588596261; cv=none; d=google.com; s=arc-20160816; b=gOBdHahOb1y3+E0tdLS//AZUpgWLVYtjae5stiwFUgrjqNpJVeYcA5xaiSGNfc1UT3 nQetpyjrK8NOAH0nIpirJT/iJylpBtkFYrYOrF+WceDCi2dUCg3E0lMhZEqX3KBJiu82 nsZeHZppp8sdkmWo5eucAkrNF9Uq3PgsUYj9RESKTnk3l9gqd7WcmIUWBAcgHMxgJMPa DAqVEHOivMpu8h6d2jlR8yZk21PgU7Lycotn2uDEPCH6T5/QxpG45hJo2A6cf2n8KPBc pIXnuU9yd0sxu3Bw/THAl+ClthA+M1Zbaz1xzjPHCIEfbWRlT6i/SQQwYIhymOpK2wD1 IJtQ== 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=detf2ZShkypYpSEj1Xl+N2HVfDlP2TzVBYX1bsGOeB/2aYeaqdRmlauOkeMvqfvZKE vVjPpS9rdbHZy1a2cvMC9R1r6CiidJISu/4sbqgPoWXOLJI/VbRAtfzYXd6eQ2u7thv0 5swNlPPLoaAfsqXgvMmBEYhZz5zp/R0z2+VtKvghiCSMGmOzPiXbCjvlRmHhZEnuoFIV x3Su6zxe7TB37m0hlU8bg2NUYi0OrckVRaUCxC6LkI7+ASs90gHTgmkdKO1ueynpqhkF pdMtRuY6NVXaVuSeOI/CPn3k0EbtsUgpYqMDWehneSCBrvFpnAeRZwTemLwqkbPkcAme kopg== 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 f3si6870464edy.68.2020.05.04.05.44.21; Mon, 04 May 2020 05:44:21 -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 A774B1D502; Mon, 4 May 2020 14:43:33 +0200 (CEST) Received: from inva020.nxp.com (inva020.nxp.com [92.121.34.13]) by dpdk.org (Postfix) with ESMTP id E3B061D160 for ; Mon, 4 May 2020 14:43:27 +0200 (CEST) Received: from inva020.nxp.com (localhost [127.0.0.1]) by inva020.eu-rdc02.nxp.com (Postfix) with ESMTP id C6ED61A02EA; Mon, 4 May 2020 14:43:27 +0200 (CEST) Received: from invc005.ap-rdc01.nxp.com (invc005.ap-rdc01.nxp.com [165.114.16.14]) by inva020.eu-rdc02.nxp.com (Postfix) with ESMTP id 26AE61A0367; Mon, 4 May 2020 14:43:26 +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 A3DCE402BF; Mon, 4 May 2020 20:43:23 +0800 (SGT) From: Hemant Agrawal To: dev@dpdk.org, ferruh.yigit@intel.com Cc: Nipun Gupta Date: Mon, 4 May 2020 18:11:16 +0530 Message-Id: <20200504124118.22877-7-hemant.agrawal@nxp.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20200504124118.22877-1-hemant.agrawal@nxp.com> References: <20200306095742.18080-1-hemant.agrawal@nxp.com> <20200504124118.22877-1-hemant.agrawal@nxp.com> X-Virus-Scanned: ClamAV using ClamSMTP Subject: [dpdk-dev] [PATCH v3 6/8] 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;