From patchwork Thu Oct 17 12:43:55 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Nipun Gupta X-Patchwork-Id: 176593 Delivered-To: patch@linaro.org Received: by 2002:a92:7e96:0:0:0:0:0 with SMTP id q22csp885916ill; Thu, 17 Oct 2019 05:59:56 -0700 (PDT) X-Google-Smtp-Source: APXvYqwP1cjs7Jzp/uVg4BiQocrWDxagDI3CuT4q7JxKUl1G0DZA/JyXGVbQPOaG4dVCwYXh4wLr X-Received: by 2002:a17:906:11d8:: with SMTP id o24mr3359216eja.224.1571317196290; Thu, 17 Oct 2019 05:59:56 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1571317196; cv=none; d=google.com; s=arc-20160816; b=kwb37Tun9rOcQRGGWU+2Yw9rhbmpT+U589BWS7Kyl7RYx3Ofza1LB01bZxH0j+kYsJ HTFUErHaa+m4qBwAw30FB1xxAXcjFUZBHTC1aIsrtBvnQcs+51se3mvtowQz3mk271TH Ep/OseFKJUnV75A7miwpz+NAKEvTcAT8pI41RVu8CMqFXBDGSdQKZEJGqFfQTGgVVim8 UCsmaca6n3Iw0p4Ba/qmydMJjyZ6FhS4v2WrbEx0cwq0U+BEu+t8yA7j8JeknWpgTv35 emPNCdcIPWywDRZ0Q5FTnJ3cD7cJkzQhfsWvnzCGzPSyMP/g2+qrsoMLX2aYIue1RHbn X8Cg== 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=4PQxUYVHc31fXi6GhFh1NY25Q34bmhIlOI25TkoffW8=; b=ypSsGgMuMdF9cfUTuXPgRiCxF9NqWnTGtcwYs/1FXQjmS2JNME49Ggzj8KwrqVsllU OxkX3dqOTPTlAPutWy1MgBoG9pYXyoYqedJ2HFd0KJLMrQEDj/8mLmxlO0QSeb2+OYaf kZbSW3BaC4zj6zyC+TjdFr6Jnx3iVi5quBtGXg4YVLjql15IWgW5BIMVMn1V8H3+PkbF zv40aJMbSNXxM5VIWK1GuPYecfdUDNPDe/onSVbaAgaTGgsj/PJFHKpxEeWeh99zjyX2 xOYD/nW940uxJOSiZRZpE8gLhku63X2E0FuIPKGlb4R5WQ+cBsyfxHLSX1noiw0tXOul smUw== 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 n17si1369428edo.143.2019.10.17.05.59.56; Thu, 17 Oct 2019 05:59:56 -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 D195E1E99D; Thu, 17 Oct 2019 14:59:52 +0200 (CEST) Received: from inva021.nxp.com (inva021.nxp.com [92.121.34.21]) by dpdk.org (Postfix) with ESMTP id D40F21E993; Thu, 17 Oct 2019 14:59:49 +0200 (CEST) Received: from inva021.nxp.com (localhost [127.0.0.1]) by inva021.eu-rdc02.nxp.com (Postfix) with ESMTP id 700DF200673; Thu, 17 Oct 2019 14:59:49 +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 6058A2000C2; Thu, 17 Oct 2019 14:59:46 +0200 (CEST) Received: from GDB1.ap.freescale.net (gdb1.ap.freescale.net [10.232.132.179]) by invc005.ap-rdc01.nxp.com (Postfix) with ESMTP id 8B9D2402B7; Thu, 17 Oct 2019 20:59:42 +0800 (SGT) From: Nipun Gupta To: dev@dpdk.org Cc: ferruh.yigit@intel.com, hemant.agrawal@nxp.com, sachin.saxena@nxp.com, stable@dpdk.org, Nipun Gupta Date: Thu, 17 Oct 2019 18:13:55 +0530 Message-Id: <20191017124403.26734-2-nipun.gupta@nxp.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20191017124403.26734-1-nipun.gupta@nxp.com> References: <20191011054657.21931-1-nipun.gupta@nxp.com> <20191017124403.26734-1-nipun.gupta@nxp.com> X-Virus-Scanned: ClamAV using ClamSMTP Subject: [dpdk-dev] [PATCH 1/9 v2] net/dpaa: fix supported RSS types 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" This patch fixes the supported RSS types on DPAA platform Fixes: 15aa2a1b02e6 ("net/dpaa: update RSS offload types") Cc: stable@dpdk.org Signed-off-by: Nipun Gupta Acked-by: Hemant Agrawal --- drivers/net/dpaa/dpaa_ethdev.h | 13 +++++-------- 1 file changed, 5 insertions(+), 8 deletions(-) -- 2.17.1 diff --git a/drivers/net/dpaa/dpaa_ethdev.h b/drivers/net/dpaa/dpaa_ethdev.h index 182becac1..7e51b0e68 100644 --- a/drivers/net/dpaa/dpaa_ethdev.h +++ b/drivers/net/dpaa/dpaa_ethdev.h @@ -76,14 +76,11 @@ #define DPAA_DEBUG_FQ_TX_ERROR 1 #define DPAA_RSS_OFFLOAD_ALL ( \ - ETH_RSS_FRAG_IPV4 | \ - ETH_RSS_NONFRAG_IPV4_TCP | \ - ETH_RSS_NONFRAG_IPV4_UDP | \ - ETH_RSS_NONFRAG_IPV4_SCTP | \ - ETH_RSS_FRAG_IPV6 | \ - ETH_RSS_NONFRAG_IPV6_TCP | \ - ETH_RSS_NONFRAG_IPV6_UDP | \ - ETH_RSS_NONFRAG_IPV6_SCTP) + ETH_RSS_L2_PAYLOAD | \ + ETH_RSS_IP | \ + ETH_RSS_UDP | \ + ETH_RSS_TCP | \ + ETH_RSS_SCTP) #define DPAA_TX_CKSUM_OFFLOAD_MASK ( \ PKT_TX_IP_CKSUM | \ From patchwork Thu Oct 17 12:43:56 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Nipun Gupta X-Patchwork-Id: 176594 Delivered-To: patch@linaro.org Received: by 2002:a92:7e96:0:0:0:0:0 with SMTP id q22csp886150ill; Thu, 17 Oct 2019 06:00:07 -0700 (PDT) X-Google-Smtp-Source: APXvYqzuMc4LD6Hqj9A0MhvKplulZpxLA4ucZjwNOYf5+Rmz4RcX6TdqyC1VWtHlBYw/w8ehcild X-Received: by 2002:a17:906:a294:: with SMTP id i20mr3223874ejz.165.1571317206911; Thu, 17 Oct 2019 06:00:06 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1571317206; cv=none; d=google.com; s=arc-20160816; b=ErhRNTWLnPhbwQk0IFKTHZ7Sm72Tz69Lva8X1GdQ2qfR0YAp7DrBJqS4sdWDjFUEgw Cw0dpfSTFvbs5yhgf7iBB5Mmq0oCZKdQuZoXb+D4uOLtQ2vmh4ngyXXQHyDRRCTJfB4E GLQsMfxhPHOOcooaMcNFLRMP9BDF48L6NWtv3Y8eojyTBNrrPUVL9XcqLzEG+tySKAZj pt7IuRDV0ieXSw0IVv8n8+QWMytdr1FRvAD9YMER3075dEDNe6FsgG/ojlUg2sh4nt+O uefzCh+7MM6eZp8J5aLpNJy1FyvOWPKT5BD6b5ZUW5DkPH2kBi7lt2vYhXb+JwsoPPD5 cqvQ== 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=KY2fP0FC27tTu8F2mdIbcBJATnFlSII8cRZDWGoI0WU=; b=BkB5DJkR0A8/LunCyu05D2ephKg4+Vtsy4iSGs2nfNjFiCkR2F4YTR/CZBBZvaUq84 ByMf1w02YHkKluOxZjrSm9xZIW2KpyPF82Yrug+icSa7eBrRjAv8r1ymP0gpW33EuUmr PUYbA5dhwe0G3JcALGEFHZTqrThBXVlLS86gbrO/2fPEbtAouLrUYqXpc6z3jhaMyAIg 2dRQUauL+aHPfc72xpK4zLNdX6zOrb5C3amQb8E0Pgu3aegmt+8V/UXYFczWw30mZcAm SqoxwukmxaXSl9aGlBgq+jk6qU9KKqEMtiCUYwyyODYP1KO1S3/SJJaD+97j5oNUJPsV c25g== 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 g3si1372592edu.432.2019.10.17.06.00.06; Thu, 17 Oct 2019 06:00:06 -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 691651E9B1; Thu, 17 Oct 2019 14:59:56 +0200 (CEST) Received: from inva021.nxp.com (inva021.nxp.com [92.121.34.21]) by dpdk.org (Postfix) with ESMTP id 2ABB11E995; Thu, 17 Oct 2019 14:59:51 +0200 (CEST) Received: from inva021.nxp.com (localhost [127.0.0.1]) by inva021.eu-rdc02.nxp.com (Postfix) with ESMTP id B5824200668; Thu, 17 Oct 2019 14:59:50 +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 A64F22002C1; Thu, 17 Oct 2019 14:59:47 +0200 (CEST) Received: from GDB1.ap.freescale.net (gdb1.ap.freescale.net [10.232.132.179]) by invc005.ap-rdc01.nxp.com (Postfix) with ESMTP id 6EAE0402AE; Thu, 17 Oct 2019 20:59:43 +0800 (SGT) From: Nipun Gupta To: dev@dpdk.org Cc: ferruh.yigit@intel.com, hemant.agrawal@nxp.com, sachin.saxena@nxp.com, stable@dpdk.org, Nipun Gupta Date: Thu, 17 Oct 2019 18:13:56 +0530 Message-Id: <20191017124403.26734-3-nipun.gupta@nxp.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20191017124403.26734-1-nipun.gupta@nxp.com> References: <20191011054657.21931-1-nipun.gupta@nxp.com> <20191017124403.26734-1-nipun.gupta@nxp.com> X-Virus-Scanned: ClamAV using ClamSMTP Subject: [dpdk-dev] [PATCH 2/9 v2] net/dpaa: fix LS1043 alignment check 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" On LS1043, we are good to check 128 byte alignment of offset to transmit out the packet Fixes: 9eba4a60c2f5 ("net/dpaa: support scatter gather in Tx for non DPAA buffer") Cc: stable@dpdk.org Signed-off-by: Nipun Gupta Acked-by: Hemant Agrawal --- drivers/net/dpaa/dpaa_rxtx.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) -- 2.17.1 diff --git a/drivers/net/dpaa/dpaa_rxtx.c b/drivers/net/dpaa/dpaa_rxtx.c index bbe615099..5dba1db8b 100644 --- a/drivers/net/dpaa/dpaa_rxtx.c +++ b/drivers/net/dpaa/dpaa_rxtx.c @@ -927,7 +927,7 @@ dpaa_eth_queue_tx(void *q, struct rte_mbuf **bufs, uint16_t nb_bufs) * the buffer in such case. */ if (dpaa_svr_family == SVR_LS1043A_FAMILY && - (mbuf->data_off & 0xFF) != 0x0) + (mbuf->data_off & 0x7F) != 0x0) realloc_mbuf = 1; seqn = mbuf->seqn; if (seqn != DPAA_INVALID_MBUF_SEQN) { From patchwork Thu Oct 17 12:43:57 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Nipun Gupta X-Patchwork-Id: 176595 Delivered-To: patch@linaro.org Received: by 2002:a92:7e96:0:0:0:0:0 with SMTP id q22csp886371ill; Thu, 17 Oct 2019 06:00:17 -0700 (PDT) X-Google-Smtp-Source: APXvYqyRsprpLvtpypD4NNytYDdFfV4d4ou91C2x+IlGKRsvuuwBDt4JFNEZHlHrQLV8yPnuZnQp X-Received: by 2002:aa7:c38d:: with SMTP id k13mr3649747edq.34.1571317217167; Thu, 17 Oct 2019 06:00:17 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1571317217; cv=none; d=google.com; s=arc-20160816; b=Zbcg9ymsdo3ceVmjbKwDXe6MuqY4oW6OEPJSCL5yI3FdyaoB8ldYk08TGTZttqH/vI s1S7NZge4CKAkwfQSAW2gkiXbi+qpD9KfTiXrou5Be36uM83zA6YtCRBUtDlfDUu6px2 S/dFNYDlbOeu7fo7DSbShZVoN1xulnihoKGi9WiSxOTxxyEb8iUQalovnIty8oceQg7E sPvea4i2UibXeNxnm8CTcNwVZzCidE86bNLpvY5UEYDdNKkK3aMwWYT0eSXmFRp+Nccm iQ6HulJzFbkfVVmO7vcmqX5VSwjhrgEXZz6jOqL++iIj3RUVWgGk7uSs9VlpOz9bHizD Yctg== 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=usMVH81zX6+WfJeGvBcjjYMsDqypoCJwV6mzVyIGDqY=; b=PdK70NRUoeCSSZKsqwIqWe50gFjy3h9hzh4RyEe40cW5EiXH9S4g+7MJ4dNQvANBx3 Pnxu9ossipZo8cI2qB1O/LGrNzwl8xVtb//WpIPc7aUfmzpPJooGz+1xFw6S7YaUG9pJ 9BloSLRgLvOKRYaci+DYORTsoEJH3p63JioSBdUmSKFgsnAChbRzFh2grSRa9Z/ucW54 7H+XzMempkTIEf0bx9P6GiIwwEvyGPamjWNP3sQ5MQXqaXJDUNozGizzRt7fFTkZbyS3 dvlbBrcZ0H9fbVV/L2Np6tX38EHFyky3+41mCn+q/ugiEDfrS46ygqEIH69Mnei6wFvl RFHw== 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 f41si1465402edf.113.2019.10.17.06.00.16; Thu, 17 Oct 2019 06:00:17 -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 5F5901E9C6; Thu, 17 Oct 2019 14:59:59 +0200 (CEST) Received: from inva021.nxp.com (inva021.nxp.com [92.121.34.21]) by dpdk.org (Postfix) with ESMTP id D13921E99A; Thu, 17 Oct 2019 14:59:51 +0200 (CEST) Received: from inva021.nxp.com (localhost [127.0.0.1]) by inva021.eu-rdc02.nxp.com (Postfix) with ESMTP id 8F207200676; Thu, 17 Oct 2019 14:59:51 +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 7FDD220011A; Thu, 17 Oct 2019 14:59:48 +0200 (CEST) Received: from GDB1.ap.freescale.net (gdb1.ap.freescale.net [10.232.132.179]) by invc005.ap-rdc01.nxp.com (Postfix) with ESMTP id 525ED4030C; Thu, 17 Oct 2019 20:59:44 +0800 (SGT) From: Nipun Gupta To: dev@dpdk.org Cc: ferruh.yigit@intel.com, hemant.agrawal@nxp.com, sachin.saxena@nxp.com, stable@dpdk.org, Nipun Gupta Date: Thu, 17 Oct 2019 18:13:57 +0530 Message-Id: <20191017124403.26734-4-nipun.gupta@nxp.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20191017124403.26734-1-nipun.gupta@nxp.com> References: <20191011054657.21931-1-nipun.gupta@nxp.com> <20191017124403.26734-1-nipun.gupta@nxp.com> X-Virus-Scanned: ClamAV using ClamSMTP Subject: [dpdk-dev] [PATCH 3/9 v2] common/dpaax: fallback to check separate memory node for VM 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" In Virtual Machine the memory node in the device tree is at '/proc/device-tree/memory/reg' which is separate from the memory node path on the host. This patch enables check on both the paths. Fixes: 2f3d633aa593 ("common/dpaax: add library for PA/VA translation table") Cc: stable@dpdk.org Signed-off-by: Nipun Gupta --- drivers/common/dpaax/dpaax_iova_table.c | 7 +++++-- drivers/common/dpaax/dpaax_iova_table.h | 2 ++ 2 files changed, 7 insertions(+), 2 deletions(-) -- 2.17.1 diff --git a/drivers/common/dpaax/dpaax_iova_table.c b/drivers/common/dpaax/dpaax_iova_table.c index 43c9c72e6..98b076e09 100644 --- a/drivers/common/dpaax/dpaax_iova_table.c +++ b/drivers/common/dpaax/dpaax_iova_table.c @@ -68,9 +68,12 @@ read_memory_node(unsigned int *count) *count = 0; ret = glob(MEM_NODE_PATH_GLOB, 0, NULL, &result); + if (ret != 0) + ret = glob(MEM_NODE_PATH_GLOB_VM, 0, NULL, &result); + if (ret != 0) { - DPAAX_DEBUG("Unable to glob device-tree memory node: (%s)(%d)", - MEM_NODE_PATH_GLOB, ret); + DPAAX_DEBUG("Unable to glob device-tree memory node (err: %d)", + ret); goto out; } diff --git a/drivers/common/dpaax/dpaax_iova_table.h b/drivers/common/dpaax/dpaax_iova_table.h index 138827e7b..fef97f6dd 100644 --- a/drivers/common/dpaax/dpaax_iova_table.h +++ b/drivers/common/dpaax/dpaax_iova_table.h @@ -45,6 +45,8 @@ extern struct dpaax_iova_table *dpaax_iova_table_p; * is SoC dependent, or even Uboot fixup dependent. */ #define MEM_NODE_PATH_GLOB "/proc/device-tree/memory[@0-9]*/reg" +/* For Virtual Machines memory node is at different path (below) */ +#define MEM_NODE_PATH_GLOB_VM "/proc/device-tree/memory/reg" /* Device file should be multiple of 16 bytes, each containing 8 byte of addr * and its length. Assuming max of 5 entries. */ From patchwork Thu Oct 17 12:43:58 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Nipun Gupta X-Patchwork-Id: 176597 Delivered-To: patch@linaro.org Received: by 2002:a92:7e96:0:0:0:0:0 with SMTP id q22csp886792ill; Thu, 17 Oct 2019 06:00:37 -0700 (PDT) X-Google-Smtp-Source: APXvYqwGzD+y0DUWzY8UBTMCxaBeaIeY7CedaInMVdYY49LIB2IZwLrJc+q1Lq5u+xekWEVtCH+7 X-Received: by 2002:a17:906:2961:: with SMTP id x1mr3303325ejd.91.1571317237371; Thu, 17 Oct 2019 06:00:37 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1571317237; cv=none; d=google.com; s=arc-20160816; b=hDkBQGFKIBYxLBFVasKaoIWkVRwQ9SwUERLEhXiogVoR5b6morzsiwLfQPNwn9J06x wS46kY+eKy3u+gfIpfLKvB/YO/q7b+9jkBTCT6EarrmQqvk8fWcbzItxV3PhDbQ2bLSK qR2NMM2j+rEugFQRGNqHFTgJIOWR0OXAx2KR0gUXicAXGDhVYl71pmqgjse5bh3I/v5s fNcOjSwIarq/FxSqSn3rW1WH010ni/R4BuMdLgZ7wK0TlqdbGmJOsA2olRXkUy0udw+j sZWSFdQDsMk+U02tGWdmAFaE2cONGCKwUG4W5WlIwJXzOMd7DL/qwUUQuzoeDFJAEA1U +1iQ== 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=/t6/3iwqA00pLAonAjFFFeKxB6HhF0G7U6O4YFopAoY=; b=Mx2u3gkFHD/ZM15h14J9QX03EytkTJvxZxASAxyvZDfYQ7RU0dkDR9ARQ3NckWAJt7 kF3Hqf965MerNaAXjKOCglAVzSGVHXjure3iZsJAB8xKq8l2R0T5/Nh+z2wu79y8paHM 3deYUber8tChUmtbVZUfNECBmCgcLDiVrdM22W3W/IT+C0oxToSQ0HUzTab4jeYe+pUf RX9iZmb/IU3zkuUO/7MN8XERgICGFUhd3l/jKHYDB4VasCnzHkQgsuEGxmmKJxtfw1PU 05oy1QQ0TAjIYafRxZA12ygqUhWAs0b2OlZvt6rD35UEYm3EabxarkhuFmrvvEQ9maDL qLrA== 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 v10si1481843edc.224.2019.10.17.06.00.37; Thu, 17 Oct 2019 06:00:37 -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 335AC1E9CE; Thu, 17 Oct 2019 15:00:08 +0200 (CEST) Received: from inva021.nxp.com (inva021.nxp.com [92.121.34.21]) by dpdk.org (Postfix) with ESMTP id A54FA1E9A6; Thu, 17 Oct 2019 14:59:53 +0200 (CEST) Received: from inva021.nxp.com (localhost [127.0.0.1]) by inva021.eu-rdc02.nxp.com (Postfix) with ESMTP id 89193200663; Thu, 17 Oct 2019 14:59:53 +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 D07D32000C2; Thu, 17 Oct 2019 14:59:49 +0200 (CEST) Received: from GDB1.ap.freescale.net (gdb1.ap.freescale.net [10.232.132.179]) by invc005.ap-rdc01.nxp.com (Postfix) with ESMTP id 2C0014031B; Thu, 17 Oct 2019 20:59:45 +0800 (SGT) From: Nipun Gupta To: dev@dpdk.org Cc: ferruh.yigit@intel.com, hemant.agrawal@nxp.com, sachin.saxena@nxp.com, stable@dpdk.org, Nipun Gupta , Radu Bulie Date: Thu, 17 Oct 2019 18:13:58 +0530 Message-Id: <20191017124403.26734-5-nipun.gupta@nxp.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20191017124403.26734-1-nipun.gupta@nxp.com> References: <20191011054657.21931-1-nipun.gupta@nxp.com> <20191017124403.26734-1-nipun.gupta@nxp.com> X-Virus-Scanned: ClamAV using ClamSMTP Subject: [dpdk-dev] [PATCH 4/9 v2] net/dpaa2: add retry and timeout in packet enqueue API 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" In the packet transmit, if the QBMAN is not able to process the packets, the Tx function loops infinitely to send the packet out. This patch changes the logic retry for some time (count) and then return. Fixes: cd9935cec873 ("net/dpaa2: enable Rx and Tx operations") Fixes: 16c4a3c46ab7 ("bus/fslmc: add enqueue response read in qbman") Cc: stable@dpdk.org Signed-off-by: Nipun Gupta Signed-off-by: Radu Bulie --- drivers/bus/fslmc/portal/dpaa2_hw_pvt.h | 2 + drivers/net/dpaa2/dpaa2_rxtx.c | 72 ++++++++++++++++++++----- 2 files changed, 60 insertions(+), 14 deletions(-) -- 2.17.1 diff --git a/drivers/bus/fslmc/portal/dpaa2_hw_pvt.h b/drivers/bus/fslmc/portal/dpaa2_hw_pvt.h index 5087f68c6..d28c7159f 100644 --- a/drivers/bus/fslmc/portal/dpaa2_hw_pvt.h +++ b/drivers/bus/fslmc/portal/dpaa2_hw_pvt.h @@ -59,6 +59,8 @@ #define DPAA2_SWP_CINH_REGION 1 #define DPAA2_SWP_CENA_MEM_REGION 2 +#define DPAA2_MAX_TX_RETRY_COUNT 10000 + #define MC_PORTAL_INDEX 0 #define NUM_DPIO_REGIONS 2 #define NUM_DQS_PER_QUEUE 2 diff --git a/drivers/net/dpaa2/dpaa2_rxtx.c b/drivers/net/dpaa2/dpaa2_rxtx.c index b7b2d8652..52d913d9e 100644 --- a/drivers/net/dpaa2/dpaa2_rxtx.c +++ b/drivers/net/dpaa2/dpaa2_rxtx.c @@ -1135,15 +1135,28 @@ dpaa2_dev_tx(void *queue, struct rte_mbuf **bufs, uint16_t nb_pkts) #endif bufs++; } + loop = 0; + retry_count = 0; while (loop < frames_to_send) { - loop += qbman_swp_enqueue_multiple(swp, &eqdesc, + ret = qbman_swp_enqueue_multiple(swp, &eqdesc, &fd_arr[loop], &flags[loop], frames_to_send - loop); + if (unlikely(ret < 0)) { + retry_count++; + if (retry_count > DPAA2_MAX_TX_RETRY_COUNT) { + num_tx += loop; + nb_pkts -= loop; + goto send_n_return; + } + } else { + loop += ret; + retry_count = 0; + } } - num_tx += frames_to_send; - nb_pkts -= frames_to_send; + num_tx += loop; + nb_pkts -= loop; } dpaa2_q->tx_pkts += num_tx; return num_tx; @@ -1153,13 +1166,22 @@ dpaa2_dev_tx(void *queue, struct rte_mbuf **bufs, uint16_t nb_pkts) if (loop) { unsigned int i = 0; + retry_count = 0; while (i < loop) { - i += qbman_swp_enqueue_multiple(swp, &eqdesc, - &fd_arr[i], - &flags[loop], - loop - i); + ret = qbman_swp_enqueue_multiple(swp, &eqdesc, + &fd_arr[i], + &flags[i], + loop - i); + if (unlikely(ret < 0)) { + retry_count++; + if (retry_count > DPAA2_MAX_TX_RETRY_COUNT) + break; + } else { + i += ret; + retry_count = 0; + } } - num_tx += loop; + num_tx += i; } skip_tx: dpaa2_q->tx_pkts += num_tx; @@ -1365,15 +1387,28 @@ dpaa2_dev_tx_ordered(void *queue, struct rte_mbuf **bufs, uint16_t nb_pkts) } bufs++; } + loop = 0; + retry_count = 0; while (loop < frames_to_send) { - loop += qbman_swp_enqueue_multiple_desc(swp, + ret = qbman_swp_enqueue_multiple_desc(swp, &eqdesc[loop], &fd_arr[loop], frames_to_send - loop); + if (unlikely(ret < 0)) { + retry_count++; + if (retry_count > DPAA2_MAX_TX_RETRY_COUNT) { + num_tx += loop; + nb_pkts -= loop; + goto send_n_return; + } + } else { + loop += ret; + retry_count = 0; + } } - num_tx += frames_to_send; - nb_pkts -= frames_to_send; + num_tx += loop; + nb_pkts -= loop; } dpaa2_q->tx_pkts += num_tx; return num_tx; @@ -1383,11 +1418,20 @@ dpaa2_dev_tx_ordered(void *queue, struct rte_mbuf **bufs, uint16_t nb_pkts) if (loop) { unsigned int i = 0; + retry_count = 0; while (i < loop) { - i += qbman_swp_enqueue_multiple_desc(swp, &eqdesc[loop], - &fd_arr[i], loop - i); + ret = qbman_swp_enqueue_multiple_desc(swp, + &eqdesc[loop], &fd_arr[i], loop - i); + if (unlikely(ret < 0)) { + retry_count++; + if (retry_count > DPAA2_MAX_TX_RETRY_COUNT) + break; + } else { + i += ret; + retry_count = 0; + } } - num_tx += loop; + num_tx += i; } skip_tx: dpaa2_q->tx_pkts += num_tx; From patchwork Thu Oct 17 12:43:59 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Nipun Gupta X-Patchwork-Id: 176596 Delivered-To: patch@linaro.org Received: by 2002:a92:7e96:0:0:0:0:0 with SMTP id q22csp886569ill; Thu, 17 Oct 2019 06:00:26 -0700 (PDT) X-Google-Smtp-Source: APXvYqxybI4XatPW8n4/VW9d0yp1gv2ZRoa7cF4pVFB0xaJlQOshmY8tZ8Hgix8pO2wzwmqF1vLK X-Received: by 2002:a05:6402:1a33:: with SMTP id be19mr3542509edb.197.1571317226693; Thu, 17 Oct 2019 06:00:26 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1571317226; cv=none; d=google.com; s=arc-20160816; b=VLAbq71ydBwJHG43cJzFwLbwFhSHnLbeZFSeywozwTLE8LUhuZD0sY7daTZYXrc6RK 4afRc/Oxg0LzgQjbQOqJV5fkVZlIFmvzyj9goH/f1oIAn15SB8JvUd34Q14TX0MNJ/x5 ET+9eTWgRJdrzsRRX/T5MRXsuRQerl4T/T3RwvKwfuBrAp64phPfekTjSye/vVKDr/jK 2NFM2KhxfENG3uadkGCK8bgOmyhuctK/Fqp1rdkBqePBrAbI878cpabPiir2pDrSC3xh WdC7CHpM85vUyuqSWBcIgin2n9cl7wq0iCF8qxfx48ra2djI5D7nYOsE5Ij+3kN74z1X upKg== 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=kjYd53ukk4K1Apqg5hKr+qkFJtnpA1QHaTVqiuBaQsI=; b=h0aPxAU3qLnJhAuz+Y7QNcr00DvbKPg+3mqQX9RHeRqORXhqonKy1iBWlsHrF0eaYn 903DezpR4r4z48k0qXjwdZeIWdhesr5cxPJdys1mB7xgIjjQPTkEf0yCS0jVOAuHiqX1 R1HmnJRcbGtNUzVt0n86W3YsZ90jjRKvY1d6x66V8hX6xLVhMMC4W7yKgMB0A1vft3QM k3JKWnmqinZ/QcReKUpghxPhEcJokk/qv3pHp/WGPJ4S6ExnF4UTos/PVRN8RfbsjEJI xMtUbesFP00/GWPV+6RxdY7M1jbIqDPExVRGfkpgL9BT96Xw+O1wqMc1SgfeT7KZZlGM CWsg== 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 pj21si1314966ejb.64.2019.10.17.06.00.26; Thu, 17 Oct 2019 06:00:26 -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 56B571E9BF; Thu, 17 Oct 2019 15:00:04 +0200 (CEST) Received: from inva020.nxp.com (inva020.nxp.com [92.121.34.13]) by dpdk.org (Postfix) with ESMTP id 5ECFF1E979; Thu, 17 Oct 2019 14:59:53 +0200 (CEST) Received: from inva020.nxp.com (localhost [127.0.0.1]) by inva020.eu-rdc02.nxp.com (Postfix) with ESMTP id F1A191A067A; Thu, 17 Oct 2019 14:59:52 +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 E39E31A0660; Thu, 17 Oct 2019 14:59:49 +0200 (CEST) Received: from GDB1.ap.freescale.net (gdb1.ap.freescale.net [10.232.132.179]) by invc005.ap-rdc01.nxp.com (Postfix) with ESMTP id 198D54031D; Thu, 17 Oct 2019 20:59:46 +0800 (SGT) From: Nipun Gupta To: dev@dpdk.org Cc: ferruh.yigit@intel.com, hemant.agrawal@nxp.com, sachin.saxena@nxp.com, stable@dpdk.org, Nipun Gupta Date: Thu, 17 Oct 2019 18:13:59 +0530 Message-Id: <20191017124403.26734-6-nipun.gupta@nxp.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20191017124403.26734-1-nipun.gupta@nxp.com> References: <20191011054657.21931-1-nipun.gupta@nxp.com> <20191017124403.26734-1-nipun.gupta@nxp.com> X-Virus-Scanned: ClamAV using ClamSMTP Subject: [dpdk-dev] [PATCH 5/9 v2] raw/dpaa2_qdma: add retry and timeout in packet enqueue API 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" This patch adds the logic in the DPAA2 QDMA packet enqueue API Fixes: 4d9a3f2a0159 ("raw/dpaa2_qdma: support RBP mode") Cc: stable@dpdk.org Signed-off-by: Nipun Gupta Acked-by: Hemant Agrawal --- drivers/raw/dpaa2_qdma/dpaa2_qdma.c | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) -- 2.17.1 diff --git a/drivers/raw/dpaa2_qdma/dpaa2_qdma.c b/drivers/raw/dpaa2_qdma/dpaa2_qdma.c index a391913b0..af678273d 100644 --- a/drivers/raw/dpaa2_qdma/dpaa2_qdma.c +++ b/drivers/raw/dpaa2_qdma/dpaa2_qdma.c @@ -541,13 +541,21 @@ dpdmai_dev_enqueue_multi(struct dpaa2_dpdmai_dev *dpdmai_dev, } /* Enqueue the packet to the QBMAN */ - uint32_t enqueue_loop = 0; + uint32_t enqueue_loop = 0, retry_count = 0; while (enqueue_loop < loop) { - enqueue_loop += qbman_swp_enqueue_multiple(swp, + ret = qbman_swp_enqueue_multiple(swp, &eqdesc, &fd[enqueue_loop], NULL, loop - enqueue_loop); + if (unlikely(ret < 0)) { + retry_count++; + if (retry_count > DPAA2_MAX_TX_RETRY_COUNT) + return num_tx - (loop - enqueue_loop); + } else { + enqueue_loop += ret; + retry_count = 0; + } } nb_jobs -= loop; } From patchwork Thu Oct 17 12:44:00 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Nipun Gupta X-Patchwork-Id: 176598 Delivered-To: patch@linaro.org Received: by 2002:a92:7e96:0:0:0:0:0 with SMTP id q22csp887081ill; Thu, 17 Oct 2019 06:00:48 -0700 (PDT) X-Google-Smtp-Source: APXvYqyiiHuDZ8vq600GUawzz0Z4KfiE0FjUaXiyzpBlQoOeCPa0ueps1pNATGSS949VRkYCkLY3 X-Received: by 2002:a05:6402:a4f:: with SMTP id bt15mr3596597edb.121.1571317248249; Thu, 17 Oct 2019 06:00:48 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1571317248; cv=none; d=google.com; s=arc-20160816; b=MKTqiAz39Le94P8aN+/nuglCUisJS3McO4viztS3WoK3Oc6ZY7+tg2Xmeie4GVnjIQ X5ixXHl834TjRyDY6SHASjtGsfVkFoDASRlLPE6q91bbvd6Hm9X/ojSeHj2pLR9s0qRr 3gVYxbaeKNfQ2gNP30Bc+zpMujmgT2KB9rLOjJtuMTJysCXZ3P8eB5wDXXaFz1iIGEvz +aNoS9/EkiGEi8nEwdicg1cGmZ4zlalQHQkZlX8A6KfUZqYyZb2aWfD1aRrcYVijsWv6 U4YH41aLnSSlcQPeL0q/+eMmP0gBIKWqWPKdffbM3TO7LlPTn6hvUqhiuZDzBEgxCMEW BQtg== 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=6ppxzN1ewA70JijZ7R+NLSRlDaoKyUzohLuUg2I/QAM=; b=BEQSMMsrzrTu8ieDv4flXsIU4e2uWioBop+Vlvtve3xFa3PI7wf9wRrZRG1p5ziB91 Wvf4A1/Zi33lfbnzQ7OHLtZMNn4EjnfcERWEXtVMrEOVZVXlNVOsEfZoFl40Gj2uabUl U2PJhvcWVRMMJ8vXJ9Ojb3j4DS1WfNl+lHU/Zl3m0B+1rOyeDXEnwznQ2O5d3VlxXJWX BIh6Z4Sk6cHZgR/EvqK4zHnQEcEUJaWQDvKj4n5q1tjNCZiPQZevpBmnhfl3vWUolPI/ zuZFRxW3QFfM7MynhL/SC5nnA+K+nT3/2xngdVzmnwYCJoLUq0PQfWMfEQY8fzZmWEF7 /ffA== 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 i20si1346769edy.426.2019.10.17.06.00.48; Thu, 17 Oct 2019 06:00:48 -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 8D5941E9E6; Thu, 17 Oct 2019 15:00:11 +0200 (CEST) Received: from inva021.nxp.com (inva021.nxp.com [92.121.34.21]) by dpdk.org (Postfix) with ESMTP id 622151E979; Thu, 17 Oct 2019 14:59:54 +0200 (CEST) Received: from inva021.nxp.com (localhost [127.0.0.1]) by inva021.eu-rdc02.nxp.com (Postfix) with ESMTP id 47DC82000C2; Thu, 17 Oct 2019 14:59:54 +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 3933D200674; Thu, 17 Oct 2019 14:59:51 +0200 (CEST) Received: from GDB1.ap.freescale.net (gdb1.ap.freescale.net [10.232.132.179]) by invc005.ap-rdc01.nxp.com (Postfix) with ESMTP id F195A402C7; Thu, 17 Oct 2019 20:59:46 +0800 (SGT) From: Nipun Gupta To: dev@dpdk.org Cc: ferruh.yigit@intel.com, hemant.agrawal@nxp.com, sachin.saxena@nxp.com, stable@dpdk.org, Nipun Gupta Date: Thu, 17 Oct 2019 18:14:00 +0530 Message-Id: <20191017124403.26734-7-nipun.gupta@nxp.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20191017124403.26734-1-nipun.gupta@nxp.com> References: <20191011054657.21931-1-nipun.gupta@nxp.com> <20191017124403.26734-1-nipun.gupta@nxp.com> X-Virus-Scanned: ClamAV using ClamSMTP Subject: [dpdk-dev] [PATCH 6/9 v2] raw/dpaa2_cmdif: add retry and timeout in packet enqueue API 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" This patch adds retry in the DPAA2 CMDIF packet enqueue API Fixes: 53c71586c789 ("raw/dpaa2_cmdif: support enqueue/dequeue operations") Cc: stable@dpdk.org Signed-off-by: Nipun Gupta Acked-by: Hemant Agrawal --- drivers/raw/dpaa2_cmdif/dpaa2_cmdif.c | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) -- 2.17.1 diff --git a/drivers/raw/dpaa2_cmdif/dpaa2_cmdif.c b/drivers/raw/dpaa2_cmdif/dpaa2_cmdif.c index 3f42da1fe..ae53114b5 100644 --- a/drivers/raw/dpaa2_cmdif/dpaa2_cmdif.c +++ b/drivers/raw/dpaa2_cmdif/dpaa2_cmdif.c @@ -62,6 +62,7 @@ dpaa2_cmdif_enqueue_bufs(struct rte_rawdev *dev, struct qbman_fd fd; struct qbman_eq_desc eqdesc; struct qbman_swp *swp; + uint32_t retry_count = 0; int ret; RTE_SET_USED(count); @@ -100,11 +101,15 @@ dpaa2_cmdif_enqueue_bufs(struct rte_rawdev *dev, ret = qbman_swp_enqueue_multiple(swp, &eqdesc, &fd, NULL, 1); if (ret < 0 && ret != -EBUSY) DPAA2_CMDIF_ERR("Transmit failure with err: %d\n", ret); - } while (ret == -EBUSY); + retry_count++; + } while ((ret == -EBUSY) && (retry_count < DPAA2_MAX_TX_RETRY_COUNT)); + + if (ret < 0) + return ret; DPAA2_CMDIF_DP_DEBUG("Successfully transmitted a packet\n"); - return 0; + return 1; } static int From patchwork Thu Oct 17 12:44:01 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Nipun Gupta X-Patchwork-Id: 176600 Delivered-To: patch@linaro.org Received: by 2002:a92:7e96:0:0:0:0:0 with SMTP id q22csp887582ill; Thu, 17 Oct 2019 06:01:08 -0700 (PDT) X-Google-Smtp-Source: APXvYqylkPvACrONvADiA4vXxLh9jpl6rPDvJCqgMFONzjHuZgBHeYh0cCnhT8zkpc80NFMMUDRw X-Received: by 2002:a50:e40c:: with SMTP id d12mr3520829edm.256.1571317268574; Thu, 17 Oct 2019 06:01:08 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1571317268; cv=none; d=google.com; s=arc-20160816; b=EGpLTWdr6i7Ie/+VqfpLlIS2e6Z5QYKMF7rQTJ7zUNBbUFpZ50AJOu5jtAMRWkxjOM OVloNFN60yoTUeoSdCJlx1J+As9yG7tkwvHcLqeGcfKjuJw3cHZhJwzRBze89r0u98j2 c3iNMUUB7cF80D2aqcH1F8p2P7039ShuhfE79OIaDXAr1xm2flSORcCUGuWvbeET2zz/ zlUjee+qd9RuBB6N0uyLfDHMcx6OwJKwWG6B358l/KmAHNo4BpoDLVTi3sUOlaIiFwp2 Mi+kDJX5UejNqk693BaiWq9+D3B8FJXt2hklHQWJG/4XfeY2SBOOPLYxfua4O3TgNLSz 1miQ== 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=F/1Ivn8X3SivPo7ohP4KSSLUAKT+VFSTfGTp5Dy0BmE=; b=WK3j6ZSyRPXKpTR5fjiCu4ETllaDt3Kr6TZsBaLXYSziOEGBzQXjeiNCodnI7H1o3Y +LZY+9IkVyfLcFSpX50XdOxrD8wT4c69r//ZULctJWWSfPs3c4KBMYHVy9UK2xUBkjr2 sKp4v0f9bAlEmymIOcAuolIMJ4BxtxQ6DDTmy5MyH8RZ8w3t5DcuoteLIhJLl+k0Xy3t /sQTJ/2U0ojtcVU1syvjfYzru2eGdQy31OIneJagmw6xigAKpq2EOCdycDEhg5LwLwtX NX7jXSP9Ff9KUZGU4atGysKiEO6OBNWF91E5MS7a9M5ut0zqMYwR4y9BbedJtaSAZrf6 bjhg== 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 n8si1320070eju.311.2019.10.17.06.01.08; Thu, 17 Oct 2019 06:01:08 -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 5CAF51EA01; Thu, 17 Oct 2019 15:00:18 +0200 (CEST) Received: from inva021.nxp.com (inva021.nxp.com [92.121.34.21]) by dpdk.org (Postfix) with ESMTP id C98161E979; Thu, 17 Oct 2019 14:59:54 +0200 (CEST) Received: from inva021.nxp.com (localhost [127.0.0.1]) by inva021.eu-rdc02.nxp.com (Postfix) with ESMTP id AE7D520067C; Thu, 17 Oct 2019 14:59:54 +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 A00F820067B; Thu, 17 Oct 2019 14:59:51 +0200 (CEST) Received: from GDB1.ap.freescale.net (gdb1.ap.freescale.net [10.232.132.179]) by invc005.ap-rdc01.nxp.com (Postfix) with ESMTP id D42A740305; Thu, 17 Oct 2019 20:59:47 +0800 (SGT) From: Nipun Gupta To: dev@dpdk.org Cc: ferruh.yigit@intel.com, hemant.agrawal@nxp.com, sachin.saxena@nxp.com, stable@dpdk.org, Radu Bulie Date: Thu, 17 Oct 2019 18:14:01 +0530 Message-Id: <20191017124403.26734-8-nipun.gupta@nxp.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20191017124403.26734-1-nipun.gupta@nxp.com> References: <20191011054657.21931-1-nipun.gupta@nxp.com> <20191017124403.26734-1-nipun.gupta@nxp.com> X-Virus-Scanned: ClamAV using ClamSMTP Subject: [dpdk-dev] [PATCH 7/9 v2] mempool/dpaa2: panic on endless loop in mbuf release 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: Radu Bulie When BMAN is not able to accept more buffers, it could be that there are no FBPR's (internal mem provided to bman) left. Panic in such conditions. Fixes: 5dc43d22b5ad ("mempool/dpaa2: add hardware offloaded mempool") Cc: stable@dpdk.org Signed-off-by: Radu Bulie --- drivers/mempool/dpaa2/dpaa2_hw_mempool.c | 23 +++++++++++++++-------- 1 file changed, 15 insertions(+), 8 deletions(-) -- 2.17.1 diff --git a/drivers/mempool/dpaa2/dpaa2_hw_mempool.c b/drivers/mempool/dpaa2/dpaa2_hw_mempool.c index f26c30b00..7e815a1ce 100644 --- a/drivers/mempool/dpaa2/dpaa2_hw_mempool.c +++ b/drivers/mempool/dpaa2/dpaa2_hw_mempool.c @@ -192,7 +192,7 @@ rte_dpaa2_mbuf_release(struct rte_mempool *pool __rte_unused, struct qbman_release_desc releasedesc; struct qbman_swp *swp; int ret; - int i, n; + int i, n, retry_count; uint64_t bufs[DPAA2_MBUF_MAX_ACQ_REL]; if (unlikely(!DPAA2_PER_LCORE_DPIO)) { @@ -225,9 +225,13 @@ rte_dpaa2_mbuf_release(struct rte_mempool *pool __rte_unused, } /* feed them to bman */ - do { - ret = qbman_swp_release(swp, &releasedesc, bufs, n); - } while (ret == -EBUSY); + retry_count = 0; + while ((ret = qbman_swp_release(swp, &releasedesc, bufs, n)) == + -EBUSY) { + retry_count++; + if (retry_count > DPAA2_MAX_TX_RETRY_COUNT) + rte_panic("bman release retry exceeded, low fbpr?\n"); + } aligned: /* if there are more buffers to free */ @@ -243,10 +247,13 @@ rte_dpaa2_mbuf_release(struct rte_mempool *pool __rte_unused, #endif } - do { - ret = qbman_swp_release(swp, &releasedesc, bufs, - DPAA2_MBUF_MAX_ACQ_REL); - } while (ret == -EBUSY); + retry_count = 0; + while ((ret = qbman_swp_release(swp, &releasedesc, bufs, + DPAA2_MBUF_MAX_ACQ_REL)) == -EBUSY) { + retry_count++; + if (retry_count > DPAA2_MAX_TX_RETRY_COUNT) + rte_panic("bman release retry exceeded, low fbpr?\n"); + } n += DPAA2_MBUF_MAX_ACQ_REL; } } From patchwork Thu Oct 17 12:44:02 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Nipun Gupta X-Patchwork-Id: 176599 Delivered-To: patch@linaro.org Received: by 2002:a92:7e96:0:0:0:0:0 with SMTP id q22csp887281ill; Thu, 17 Oct 2019 06:00:57 -0700 (PDT) X-Google-Smtp-Source: APXvYqxplJ5JHe3wcQP4adBiXoIPvFmFWBWR+eYEA1tU3sCqLt15757zn6ytYfzkeloCHX/ciRy7 X-Received: by 2002:aa7:d358:: with SMTP id m24mr3618349edr.204.1571317257147; Thu, 17 Oct 2019 06:00:57 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1571317257; cv=none; d=google.com; s=arc-20160816; b=T+Bwe2JEWKRhNTItEDsXRnVaORm6ZbrFspvrxPwIDgszG0z0xTU6J8Inka5ziZiEco UDAFjVoij65INwwCU3DIEwcP1BiCnvsj93WKzZDC6vyhIbrUYNDeJrLdQ5IzH9YtvO0v WPRi/pxdfzmUZj9IoDZvs67RCjzHMU/0VeFVgNCQ/3Ovor6T6nz1g20Rv8JdHlyS/pPP iSvCYVtJIWRROwUoqRbQR5SXXFQPskbCy91fHGYYqpPM8pAI5cbRIFElqXXaUbu26MqS R0i7dNP5rcKnu7hkhhU/LL6aef4YpDm+3ZVCLhOcWANkTEXinU0eRBOGnasbtMGHU1IF C88g== 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=Ixq9O7INfnX99LQZKpcAInS5bv3U5jDMDj4nSoE6F8k=; b=yKnYZ8Bh8r8xPr/NrrXviBDn9snqWpMqOdkWiOirzW2dbHQD1Ovsh4a2ymLdaZpI5U fAFBmTueCjzs9TyqHMLZZUxlM56nmnrV0MsFFusSGUsGuy3vUKhHPIK0kiMx/DCRucuu GpdEaBhyIcShBI+BuRB1SIC5Sk/g/jZpH/pVsFOcpvBo2u91ZqiPvZnGtxIUkpeGxBSt ZOGzSfq28ffKkz/pg6ctNvQqh60h5lb4/JUCeUGf+XCvsoFT4DzSduBGvRPnVVPqrxPw bgHBJXSEm1O/FnzT0t0hLT+l1DgWWGBaQ/eH4mpHRoIdT1iF6hgouJarJ8QLnStMvgMi yDCw== 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 p2si1455569edx.106.2019.10.17.06.00.56; Thu, 17 Oct 2019 06:00:57 -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 6DBF91E9D1; Thu, 17 Oct 2019 15:00:14 +0200 (CEST) Received: from inva020.nxp.com (inva020.nxp.com [92.121.34.13]) by dpdk.org (Postfix) with ESMTP id 867BA1E9A6 for ; Thu, 17 Oct 2019 14:59:54 +0200 (CEST) Received: from inva020.nxp.com (localhost [127.0.0.1]) by inva020.eu-rdc02.nxp.com (Postfix) with ESMTP id 66C541A0654; Thu, 17 Oct 2019 14:59:54 +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 E1CF01A0663; Thu, 17 Oct 2019 14:59:51 +0200 (CEST) Received: from GDB1.ap.freescale.net (gdb1.ap.freescale.net [10.232.132.179]) by invc005.ap-rdc01.nxp.com (Postfix) with ESMTP id AD5354031C; Thu, 17 Oct 2019 20:59:48 +0800 (SGT) From: Nipun Gupta To: dev@dpdk.org Cc: ferruh.yigit@intel.com, hemant.agrawal@nxp.com, sachin.saxena@nxp.com Date: Thu, 17 Oct 2019 18:14:02 +0530 Message-Id: <20191017124403.26734-9-nipun.gupta@nxp.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20191017124403.26734-1-nipun.gupta@nxp.com> References: <20191011054657.21931-1-nipun.gupta@nxp.com> <20191017124403.26734-1-nipun.gupta@nxp.com> X-Virus-Scanned: ClamAV using ClamSMTP Subject: [dpdk-dev] [PATCH 8/9 v2] bus/dpaa: moving qbman global init to bus 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: Hemant Agrawal DPAA SEC shall be able to work independent of DPAA ETH driver. This patch moves qbman init to bus, so that any driver can use them even when no eth resources are present or none of the eth devices are probed. Signed-off-by: Hemant Agrawal --- drivers/bus/dpaa/dpaa_bus.c | 21 +++++++++++++++++++-- drivers/bus/dpaa/rte_bus_dpaa_version.map | 2 -- drivers/crypto/dpaa_sec/dpaa_sec.c | 8 ++++++++ drivers/net/dpaa/dpaa_ethdev.c | 14 -------------- 4 files changed, 27 insertions(+), 18 deletions(-) -- 2.17.1 Acked-by: Akhil Goyal diff --git a/drivers/bus/dpaa/dpaa_bus.c b/drivers/bus/dpaa/dpaa_bus.c index d028ef3be..f27820db3 100644 --- a/drivers/bus/dpaa/dpaa_bus.c +++ b/drivers/bus/dpaa/dpaa_bus.c @@ -561,8 +561,24 @@ rte_dpaa_bus_probe(void) return 0; /* Device list creation is only done once */ - if (!process_once) + if (!process_once) { rte_dpaa_bus_dev_build(); + if (rte_eal_process_type() == RTE_PROC_PRIMARY) { + /* One time load of Qman/Bman drivers */ + ret = qman_global_init(); + if (ret) { + DPAA_PMD_ERR("QMAN initialization failed: %d", + ret); + return ret; + } + ret = bman_global_init(); + if (ret) { + DPAA_PMD_ERR("BMAN initialization failed: %d", + ret); + return ret; + } + } + } process_once = 1; /* If no device present on DPAA bus nothing needs to be done */ @@ -600,7 +616,8 @@ rte_dpaa_bus_probe(void) RTE_DEV_WHITELISTED)) { ret = drv->probe(drv, dev); if (ret) { - DPAA_BUS_ERR("Unable to probe.\n"); + DPAA_BUS_ERR("unable to probe:%s", + dev->name); } else { dev->driver = drv; dev->device.driver = &drv->driver; diff --git a/drivers/bus/dpaa/rte_bus_dpaa_version.map b/drivers/bus/dpaa/rte_bus_dpaa_version.map index 97f4f622d..cf428a54d 100644 --- a/drivers/bus/dpaa/rte_bus_dpaa_version.map +++ b/drivers/bus/dpaa/rte_bus_dpaa_version.map @@ -4,7 +4,6 @@ DPDK_17.11 { bman_acquire; bman_free_pool; bman_get_params; - bman_global_init; bman_new_pool; bman_query_free_buffers; bman_release; @@ -48,7 +47,6 @@ DPDK_17.11 { qman_enqueue_multi; qman_fq_fqid; qman_fq_state; - qman_global_init; qman_init_fq; qman_poll_dqrr; qman_query_fq_np; diff --git a/drivers/crypto/dpaa_sec/dpaa_sec.c b/drivers/crypto/dpaa_sec/dpaa_sec.c index 1e4f55b11..1db9bc381 100644 --- a/drivers/crypto/dpaa_sec/dpaa_sec.c +++ b/drivers/crypto/dpaa_sec/dpaa_sec.c @@ -3050,6 +3050,14 @@ cryptodev_dpaa_sec_probe(struct rte_dpaa_driver *dpaa_drv __rte_unused, } } + if (unlikely(!RTE_PER_LCORE(dpaa_io))) { + retval = rte_dpaa_portal_init((void *)1); + if (retval) { + DPAA_SEC_ERR("Unable to initialize portal"); + return retval; + } + } + /* Invoke PMD device initialization function */ retval = dpaa_sec_dev_init(cryptodev); if (retval == 0) diff --git a/drivers/net/dpaa/dpaa_ethdev.c b/drivers/net/dpaa/dpaa_ethdev.c index caf255d67..16b52b5e1 100644 --- a/drivers/net/dpaa/dpaa_ethdev.c +++ b/drivers/net/dpaa/dpaa_ethdev.c @@ -1576,20 +1576,6 @@ rte_dpaa_probe(struct rte_dpaa_driver *dpaa_drv __rte_unused, } if (!is_global_init && (rte_eal_process_type() == RTE_PROC_PRIMARY)) { - /* One time load of Qman/Bman drivers */ - ret = qman_global_init(); - if (ret) { - DPAA_PMD_ERR("QMAN initialization failed: %d", - ret); - return ret; - } - ret = bman_global_init(); - if (ret) { - DPAA_PMD_ERR("BMAN initialization failed: %d", - ret); - return ret; - } - if (access("/tmp/fmc.bin", F_OK) == -1) { RTE_LOG(INFO, PMD, "* FMC not configured.Enabling default mode\n"); From patchwork Thu Oct 17 12:44:03 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Nipun Gupta X-Patchwork-Id: 176601 Delivered-To: patch@linaro.org Received: by 2002:a92:7e96:0:0:0:0:0 with SMTP id q22csp887822ill; Thu, 17 Oct 2019 06:01:18 -0700 (PDT) X-Google-Smtp-Source: APXvYqx1kfuOXC74V41fuQu11N1XMU6ex5+ra4njx01VWT21EgeBXtdGkE98ZzL0GfCF5TV5RLJc X-Received: by 2002:a17:906:184e:: with SMTP id w14mr3345685eje.10.1571317278476; Thu, 17 Oct 2019 06:01:18 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1571317278; cv=none; d=google.com; s=arc-20160816; b=OP0xcayXfQsk8ZTgc0h5/hvpZKzL82Cf5ZG/gcqd9l9NAELPtXpjpbRVdW9JSKODuc xj+rQaqcZzxJGVhIdsNMq9A9MJrUgKFiXRVHncHcUfM4ahWU77inrWxjpjxRxEO58r3A x2t2q9U2p7mG6LFTXours6AB+1grCto8pBHDCZAUt75DaWqGH2/wCuPucwhr8I4DfTff rvGkYtAwXwRzZMhugF1bNbZSpqWYy7qsca/RQy3nrWjF0QGAR32iakENoUDkYIEV+S7+ /yURwpy+XkQ4XdxCFmVCFKTVAKX9Gmp8SZYMA0vZMiCAYs81yoPcYPWPHT9RkbdVrgzK 8FHg== 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=XMegJTQVwCOmgSW6+YxbGfzTtqdRLOfdrwVo05QnLE0=; b=zXV1b/pKUKDD0+wscCHQcw23lx6Uy2oJ+uhaW6xwxMbEpNyox42SmkA36EKoA/hCKR 2sUNuutl57alKj3JE8HX9LIzxqkht19wwio3g8SAdQl/7a8/2OB4duuKxn5Bi/CEa1WX n5EuG7l/S2jZWqHtN6qkVZMToz5YxrksTwg6oNDNBD2fAo5XhLpEst7ODN/OmQxXw4jG Z6DkeCeed/NHsDP1AjuIJvTOLZi+32u2zNg9Hbrn3fEWM3XBN9cWCPXTdjpx07Qk/lw3 SODHHKO3yNPHNWWzv8kACXKaYzxqsYtSoq2n3mYi35MqiD6O4BvfnxbgXq4R20OPK7cP 8xEg== 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 v13si1394293eds.375.2019.10.17.06.01.17; Thu, 17 Oct 2019 06:01:18 -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 74CB61EA0D; Thu, 17 Oct 2019 15:00:22 +0200 (CEST) Received: from inva021.nxp.com (inva021.nxp.com [92.121.34.21]) by dpdk.org (Postfix) with ESMTP id 727241E9AB for ; Thu, 17 Oct 2019 14:59:55 +0200 (CEST) Received: from inva021.nxp.com (localhost [127.0.0.1]) by inva021.eu-rdc02.nxp.com (Postfix) with ESMTP id 540BE20067B; Thu, 17 Oct 2019 14:59:55 +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 A6DD520011A; Thu, 17 Oct 2019 14:59:52 +0200 (CEST) Received: from GDB1.ap.freescale.net (gdb1.ap.freescale.net [10.232.132.179]) by invc005.ap-rdc01.nxp.com (Postfix) with ESMTP id 5DB324031F; Thu, 17 Oct 2019 20:59:49 +0800 (SGT) From: Nipun Gupta To: dev@dpdk.org Cc: ferruh.yigit@intel.com, hemant.agrawal@nxp.com, sachin.saxena@nxp.com, Shreyansh Jain Date: Thu, 17 Oct 2019 18:14:03 +0530 Message-Id: <20191017124403.26734-10-nipun.gupta@nxp.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20191017124403.26734-1-nipun.gupta@nxp.com> References: <20191011054657.21931-1-nipun.gupta@nxp.com> <20191017124403.26734-1-nipun.gupta@nxp.com> X-Virus-Scanned: ClamAV using ClamSMTP Subject: [dpdk-dev] [PATCH 9/9 v2] bus/fslmc: sanitize device name parsing for clarity 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: Shreyansh Jain remove unnecessary dup and free Signed-off-by: Shreyansh Jain --- drivers/bus/fslmc/fslmc_bus.c | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) -- 2.17.1 diff --git a/drivers/bus/fslmc/fslmc_bus.c b/drivers/bus/fslmc/fslmc_bus.c index 4116552c6..b3e964aa9 100644 --- a/drivers/bus/fslmc/fslmc_bus.c +++ b/drivers/bus/fslmc/fslmc_bus.c @@ -235,8 +235,9 @@ rte_fslmc_parse(const char *name, void *addr) { uint16_t dev_id; char *t_ptr; - char *sep = NULL; + const char *sep; uint8_t sep_exists = 0; + int ret = -1; DPAA2_BUS_DEBUG("Parsing dev=(%s)", name); @@ -266,10 +267,11 @@ rte_fslmc_parse(const char *name, void *addr) } else { DPAA2_BUS_DEBUG("Invalid device for matching (%s).", name); + ret = -EINVAL; goto err_out; } } else - sep = strdup(name); + sep = name; jump_out: /* Validate device name */ @@ -283,23 +285,23 @@ rte_fslmc_parse(const char *name, void *addr) strncmp("dpdmai", sep, 6) && strncmp("dpdmux", sep, 6)) { DPAA2_BUS_DEBUG("Unknown or unsupported device (%s)", sep); + ret = -EINVAL; goto err_out; } t_ptr = strchr(sep, '.'); if (!t_ptr || sscanf(t_ptr + 1, "%hu", &dev_id) != 1) { DPAA2_BUS_ERR("Missing device id in device name (%s)", sep); + ret = -EINVAL; goto err_out; } if (addr) strcpy(addr, sep); - return 0; + ret = 0; err_out: - if (!sep_exists && sep) - free(sep); - return -EINVAL; + return ret; } static int