From patchwork Tue Nov 5 14:23:13 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Nipun Gupta X-Patchwork-Id: 178521 Delivered-To: patch@linaro.org Received: by 2002:a92:38d5:0:0:0:0:0 with SMTP id g82csp845902ilf; Tue, 5 Nov 2019 06:39:52 -0800 (PST) X-Google-Smtp-Source: APXvYqz4JN046R/2eKZCUjIXZYy19FMtF5kGGcubWZnFYXlVIfDuFL7pD+Bz2127yXsMSqpWcJCu X-Received: by 2002:a05:6402:382:: with SMTP id o2mr3449446edv.61.1572964792328; Tue, 05 Nov 2019 06:39:52 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1572964792; cv=none; d=google.com; s=arc-20160816; b=dxvwfTOMOUjUy0Rdk8FsUmSrLk/Kh1R8j2zyJC0y8o1V3CNnqCCTduWugQ1SeiPkGb 7UbxcdSbIYqKQkwAzhvskeBoFOJ2Id3stAOt8NH7Pco0KrDava0yaQehIgU6n8Udo93s 7CcuG6x/bvWncjcUtG6tQBe/uRYFSX0ler81U04MVTmJsle/q7F4ToxJcto9NpqHaZ8p IxQPePKTruKNKjPsf8QGJno1AOh5JE5mmBuCPCbPnw3wiF+CNAZNoy1P1mg22xb0QfHe zDuihUKpPH5GMMbzmOg2bjBxLkna4ZSp6RDH3gQnwhQ5uyPb4zs+bTbYqNTrJKpOqDJL DJGg== 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=JWvQsQ1fN8FsnY1R9vB+bWcsuwv4B7ZTFb1lgdE4V7oFVamTzI0b9+o1Y5E1mQo6Ua gElKgsqJL5VFC5W5SlbVf2GeSH0vvnfE3A/WGghjsaEA/IDcOHgKB/4AIgWTOiIBi1MW 6f9q99LjXKbUMKGZfpEMhL5tbeUffdzqAc4l08/XhwQVeTr4p/hgr7JNmfPv+39MPBug fd/qI1afXH+fjEs+lRucO7MTMLkqmSmusHpUCiBtPl5EhUtqxZz8lnUSrlyMU4FfemV3 vqF9rbMFIa7jZh4EyWCPenMXbzsUdC/T3L/5queaoRQ5EqI3EfjP48ruKdDbNFLqatqQ E2dw== 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 l15si13183738ejp.114.2019.11.05.06.39.52; Tue, 05 Nov 2019 06:39:52 -0800 (PST) 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 9514F1BF00; Tue, 5 Nov 2019 15:39:46 +0100 (CET) Received: from inva021.nxp.com (inva021.nxp.com [92.121.34.21]) by dpdk.org (Postfix) with ESMTP id 761BB1BEFA; Tue, 5 Nov 2019 15:39:45 +0100 (CET) Received: from inva021.nxp.com (localhost [127.0.0.1]) by inva021.eu-rdc02.nxp.com (Postfix) with ESMTP id 56A282000EA; Tue, 5 Nov 2019 15:39:45 +0100 (CET) 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 016AF200522; Tue, 5 Nov 2019 15:39:42 +0100 (CET) Received: from GDB1.ap.freescale.net (gdb1.ap.freescale.net [10.232.132.179]) by invc005.ap-rdc01.nxp.com (Postfix) with ESMTP id 68683402AD; Tue, 5 Nov 2019 22:39:37 +0800 (SGT) From: Nipun Gupta To: dev@dpdk.org Cc: thomas@monjalon.net, ferruh.yigit@intel.com, hemant.agrawal@nxp.com, sachin.saxena@nxp.com, stable@dpdk.org, Nipun Gupta Date: Tue, 5 Nov 2019 19:53:13 +0530 Message-Id: <20191105142321.7478-2-nipun.gupta@nxp.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20191105142321.7478-1-nipun.gupta@nxp.com> References: <20191011054657.21931-1-nipun.gupta@nxp.com> <20191105142321.7478-1-nipun.gupta@nxp.com> X-Virus-Scanned: ClamAV using ClamSMTP Subject: [dpdk-dev] [PATCH 1/9 v4] 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 Tue Nov 5 14:23:14 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Nipun Gupta X-Patchwork-Id: 178522 Delivered-To: patch@linaro.org Received: by 2002:a92:38d5:0:0:0:0:0 with SMTP id g82csp846118ilf; Tue, 5 Nov 2019 06:40:02 -0800 (PST) X-Google-Smtp-Source: APXvYqzT3iHLFpMKrInt0GfZsCxQJNzUkToSKqMVT9rTc8kPyWDXv6HpInZypmEhHUakbhSYKgAH X-Received: by 2002:a50:d7c9:: with SMTP id m9mr36721830edj.93.1572964802835; Tue, 05 Nov 2019 06:40:02 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1572964802; cv=none; d=google.com; s=arc-20160816; b=Cxy9fRBrElEms4ubk3sIXtmLnz9obNkXExAxejevfpqVsa6YNYZvUCPqRTVM7FxTGi 5KFxAIlQ0/WQ75R3diUw7wO/ZbOU0mUKQdvfGC/9OypSIcCGYPFOMMNhPoAuAd1ZlL71 /4fTu6JQUga23fCaJS+VrJHTD4XJ3dAgZb4ODQf0kPsqJiLabSGtiJI2IpRJ9sMRdkGq Sz8xQPrpJOe6B+YReiZVnPPdgLmNlHNSfiU0Fu5Q8seMlNXa7N0Mi19zcLpDZgTNK7gA YGB68uY8Y/cWT8ZIcdxip876wcQFqKA/Ff32n+UMl9j1cR/3UmhWiIu3mZ6DUvScIB8F gsBQ== 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=wcrPhNO/pSnWzoNW7sTkw4DeXmQBBBRbmzBqxAqTXDM=; b=nO0AzDOnP3iHKEA0IllscZr6vfxjQ6onkowDH1EjYrpDo8v2po5SojcQPPGG4EA2GS yb6112g5zzEQUnNWXMS1dGf+ru+PnXYpRRYTJYqIj4vZM1X91ngZfZeu+IZwb3t6cIbV Rjsn/j339bvGP5Ck7mD5s7yb9vEp7ekgPzHR8V/Z92auDI2eVd7XFNeBZNp7Z4n4OT3O H06KzihKHNEpIrWp4I3Kf0YkZv5GQaTcMx/+qkDS70l4RUEpyamzXv8sfo9OHYG9OCzm hb102K10w2B8lHzIrRUuSWguZ1qaiP2cqx+Y3DL43hmeb+rFSwvbh3lkQciJUujfsJna cMKg== 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 x11si2964156edq.31.2019.11.05.06.40.02; Tue, 05 Nov 2019 06:40:02 -0800 (PST) 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 37A6D1BF10; Tue, 5 Nov 2019 15:39:48 +0100 (CET) Received: from inva020.nxp.com (inva020.nxp.com [92.121.34.13]) by dpdk.org (Postfix) with ESMTP id B20AB1BF06; Tue, 5 Nov 2019 15:39:46 +0100 (CET) Received: from inva020.nxp.com (localhost [127.0.0.1]) by inva020.eu-rdc02.nxp.com (Postfix) with ESMTP id 5231B1A01F1; Tue, 5 Nov 2019 15:39:46 +0100 (CET) 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 F233C1A084E; Tue, 5 Nov 2019 15:39:42 +0100 (CET) Received: from GDB1.ap.freescale.net (gdb1.ap.freescale.net [10.232.132.179]) by invc005.ap-rdc01.nxp.com (Postfix) with ESMTP id 60E7A402B4; Tue, 5 Nov 2019 22:39:38 +0800 (SGT) From: Nipun Gupta To: dev@dpdk.org Cc: thomas@monjalon.net, ferruh.yigit@intel.com, hemant.agrawal@nxp.com, sachin.saxena@nxp.com, stable@dpdk.org, Nipun Gupta Date: Tue, 5 Nov 2019 19:53:14 +0530 Message-Id: <20191105142321.7478-3-nipun.gupta@nxp.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20191105142321.7478-1-nipun.gupta@nxp.com> References: <20191011054657.21931-1-nipun.gupta@nxp.com> <20191105142321.7478-1-nipun.gupta@nxp.com> X-Virus-Scanned: ClamAV using ClamSMTP Subject: [dpdk-dev] [PATCH 2/9 v4] 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: f8c7a17a48c9 ("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 Tue Nov 5 14:23:15 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Nipun Gupta X-Patchwork-Id: 178523 Delivered-To: patch@linaro.org Received: by 2002:a92:38d5:0:0:0:0:0 with SMTP id g82csp846396ilf; Tue, 5 Nov 2019 06:40:18 -0800 (PST) X-Google-Smtp-Source: APXvYqx2XHPMR0+Fg5WI6NMMTlG+EYnNEFSzMWOnjOSh0Shgpppyk6ZdAQI/mwv5hLyiqlgNfCks X-Received: by 2002:a17:906:1c59:: with SMTP id l25mr2413753ejg.98.1572964816750; Tue, 05 Nov 2019 06:40:16 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1572964816; cv=none; d=google.com; s=arc-20160816; b=sMslXryzaJJCU/bHnbonKSib539VQLEQcbRplIRXzrslXHRy9tjaUPVlrI+fD7i2zZ xFEPl+IEI5TdtrujvqB0d08NJaEK22F786Ijs2hGmXKpf+olPds3OTObk18RR76nOiGR VWelFyyY64V8rLg72NQyw/mFnr/jKvYc7DtC0UvmaIsJOE1+oXhrCNWOn41xxj6ExOR6 DY570F75q5HzHwlRbFPAGNRMCm8MYv5s0lEph1SPOeCvzZAuus/rDsY+KZ7DDtQp1c6F JtvGjHUIHhtVZNDRAFy6XxWgy07x5IM4jsZ3JQNz4WWehPkfOiCnp9ra/IghiR6FCOph eySg== 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=z4M681YcoulPztWk6mwsSgxI9jWPuSI61TkPrUoz36V1r7zXYjXc6tlJfjX2mibo9g t1g867mLPRKQ5m028eZfKtlymFAP9twZWcqUxyqZEJvk1ailwf1zrQ/kjC0qThdw59xm +NURNg9jh7i5jPsAbI2F1DLb0tWtXilkiJKGQ8xo6k1jazB+znZqdlDXHbU3k7BHMaxY hNYBdZGN/JmjrGBQ4mKNmNuUlZYnPgx/Tr3m3LT8wlo7dXm4wtEEO0LYh0EAeKwWEJvD ubW6d0kLn6LT0VZ8XXnDSga3OC8wEGXWq8qXK+YPf+wXi8e7pFZbxCtAUa9os2tI5yaa 9qPg== 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 o12si13822219ejn.292.2019.11.05.06.40.15; Tue, 05 Nov 2019 06:40:16 -0800 (PST) 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 BE0041BF20; Tue, 5 Nov 2019 15:39:49 +0100 (CET) Received: from inva020.nxp.com (inva020.nxp.com [92.121.34.13]) by dpdk.org (Postfix) with ESMTP id 7A11A1BF08; Tue, 5 Nov 2019 15:39:47 +0100 (CET) Received: from inva020.nxp.com (localhost [127.0.0.1]) by inva020.eu-rdc02.nxp.com (Postfix) with ESMTP id 3DFF51A01EC; Tue, 5 Nov 2019 15:39:47 +0100 (CET) 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 DF6631A00C5; Tue, 5 Nov 2019 15:39:43 +0100 (CET) Received: from GDB1.ap.freescale.net (gdb1.ap.freescale.net [10.232.132.179]) by invc005.ap-rdc01.nxp.com (Postfix) with ESMTP id 5C201402E5; Tue, 5 Nov 2019 22:39:39 +0800 (SGT) From: Nipun Gupta To: dev@dpdk.org Cc: thomas@monjalon.net, ferruh.yigit@intel.com, hemant.agrawal@nxp.com, sachin.saxena@nxp.com, stable@dpdk.org, Nipun Gupta Date: Tue, 5 Nov 2019 19:53:15 +0530 Message-Id: <20191105142321.7478-4-nipun.gupta@nxp.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20191105142321.7478-1-nipun.gupta@nxp.com> References: <20191011054657.21931-1-nipun.gupta@nxp.com> <20191105142321.7478-1-nipun.gupta@nxp.com> X-Virus-Scanned: ClamAV using ClamSMTP Subject: [dpdk-dev] [PATCH 3/9 v4] 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 Tue Nov 5 14:23:16 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Nipun Gupta X-Patchwork-Id: 178524 Delivered-To: patch@linaro.org Received: by 2002:a92:38d5:0:0:0:0:0 with SMTP id g82csp846634ilf; Tue, 5 Nov 2019 06:40:30 -0800 (PST) X-Google-Smtp-Source: APXvYqwrAW6ls8u8sFcjWLB2CO0lv2azxY7Au9G1TKFRm3nCYv7SnI/MGL+PYwixPymeckIwfFcI X-Received: by 2002:aa7:c987:: with SMTP id c7mr20870994edt.232.1572964830369; Tue, 05 Nov 2019 06:40:30 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1572964830; cv=none; d=google.com; s=arc-20160816; b=CmxMbw2gkmGGXxNufL+Dz5f4LwIclm6JsxID9KplfSKeSgCareD1EHhtP697SGUASS NgEHTEYsRegn9JFECFn5SB4yl1xSetNc54N43LleyFEIHt8gztVnuJtkms2Jzp3ZSS/w SO5ywcOqjzh5F1r3zt5cbhXdIWomyjGX9p8ngJCaQktqZvTTSxjBMgAs6vbkIwa1QOEI LZwcnGvZqtdp+1ztCrqjipzeMW+hBQFv6Sz7k6yM2pPTocbpP3OfURFCLizqhgQ0DltE gei3JEyA1y2x9p1jq9QyhcLAQh8AZAvRYOET8suRmBRCixkaN1oHB8nabyRY9QbOGt0W 8kUw== 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=sVIFgRPcnFE5B4JAsJlf/ovjWprUl9j+cCgTCjSullM=; b=zxpjTFA+m4l865YvaFOMmGQwfpdy/8IT5YODJeHpb6zy3nsW6xC35qmg7YZMidoukT Erv9Bdva8EZ7hNhUXnjdV/aqgKhPWAEIY+zy/J1W0I0nKFx0Fdjok6NAERY5mMAnhXoA Usg5Ls/5mdmhinhzJ1MArT6kvJnQ2cSnAYIGfyey6sHG1GME4K+7t80cRiUpmZ4eobMj sB5DH6nbVLo+DHmtr7j3p1gIW0AB4qI56E9G+2ulk9W2PctJSrcG3DmsX/KouMasmKkv b+jY8VMQsqhwHbEfEdLiy4Xgm2U4MbHzUO1f/vG7RZOXgwaHTmYRICbL7a10Slx8+sZO mcWg== 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 26si10425367edz.340.2019.11.05.06.40.30; Tue, 05 Nov 2019 06:40:30 -0800 (PST) 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 84F941BF3D; Tue, 5 Nov 2019 15:39:52 +0100 (CET) Received: from inva021.nxp.com (inva021.nxp.com [92.121.34.21]) by dpdk.org (Postfix) with ESMTP id 22F9F1BF33; Tue, 5 Nov 2019 15:39:51 +0100 (CET) Received: from inva021.nxp.com (localhost [127.0.0.1]) by inva021.eu-rdc02.nxp.com (Postfix) with ESMTP id 043042006DB; Tue, 5 Nov 2019 15:39:51 +0100 (CET) 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 0BA43200528; Tue, 5 Nov 2019 15:39:47 +0100 (CET) Received: from GDB1.ap.freescale.net (gdb1.ap.freescale.net [10.232.132.179]) by invc005.ap-rdc01.nxp.com (Postfix) with ESMTP id 4AA80402FC; Tue, 5 Nov 2019 22:39:40 +0800 (SGT) From: Nipun Gupta To: dev@dpdk.org Cc: thomas@monjalon.net, ferruh.yigit@intel.com, hemant.agrawal@nxp.com, sachin.saxena@nxp.com, stable@dpdk.org, Nipun Gupta , Radu Bulie Date: Tue, 5 Nov 2019 19:53:16 +0530 Message-Id: <20191105142321.7478-5-nipun.gupta@nxp.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20191105142321.7478-1-nipun.gupta@nxp.com> References: <20191011054657.21931-1-nipun.gupta@nxp.com> <20191105142321.7478-1-nipun.gupta@nxp.com> X-Virus-Scanned: ClamAV using ClamSMTP Subject: [dpdk-dev] [PATCH 4/9 v4] 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 db6dad544..4ed82f574 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 Tue Nov 5 14:23:17 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Nipun Gupta X-Patchwork-Id: 178526 Delivered-To: patch@linaro.org Received: by 2002:a92:38d5:0:0:0:0:0 with SMTP id g82csp847008ilf; Tue, 5 Nov 2019 06:40:51 -0800 (PST) X-Google-Smtp-Source: APXvYqzyDTqjycVxArBi+3z9gqyytoAQ0Whz9kbeBg6fEQz65h8d3Vb7FZmEgk7+GkvZrzfqTtvx X-Received: by 2002:a17:906:66d2:: with SMTP id k18mr29293104ejp.278.1572964850468; Tue, 05 Nov 2019 06:40:50 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1572964850; cv=none; d=google.com; s=arc-20160816; b=dZnGqhfb+EZV1yauY1MFkz+VXP83NP+JxJ+Io24+fgWFuXZORtJy6jbmteQQ0mwdC4 ylIkIL3n9iONj2a5LPO8p8e+3Cup7v18tvS8G3XVSFeANA1hWDymmvjokg7MlilakNer 588Bs0D3wnVKXTJK/IUj6HJ3Q90CrdpjMDHC18tDf2dbSPYQY84o5xK3ir6YxawBSyKA HBglWcQc8IwaKWvNbbytdh8k1AksdSAuvh5c9Rk5rnMiAhfdMyEgXJfydxmUC3Iv1YKk 5wE0LUabIBXfpSZTUrjRgK3vnlzLeGYk7suL3QW9kIecD4rrHCdQfr+xQm2AbhUwkwsF G+rg== 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=a39ggJbyFLsTcs3yJfZy0X+YzZ9GP1J+QJCmwXvoGxDmOmo8mO1O1ffYY04KdbA99M DB2pquFrJK5llfsDyLEvS9CDiT7eUiOFrYvIFIzwR7xGBoEC1Flv1lk1+OhyLnvEDWZe Oyl0gg9weWDska9Qlwt5VofmTU8D2bUxuVq301FmWfi+d7bM22WC1TWjWZ6dmIeooM3W xjS777ytVWGlG6VvCiGT29MxP6+PGz+3j/LhrhNhWGGwBAnBTgbaF4fYYOx14CILm+Fx rExlL7HG7WHghGvBsVu2uWgci3kcxRk1v9ex6esaCr6WxsAn2UVChujaI7/VmqCJ8FH1 iMRQ== 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 j15si14344953ejc.369.2019.11.05.06.40.50; Tue, 05 Nov 2019 06:40:50 -0800 (PST) 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 ED0BF1BF4D; Tue, 5 Nov 2019 15:39:55 +0100 (CET) Received: from inva021.nxp.com (inva021.nxp.com [92.121.34.21]) by dpdk.org (Postfix) with ESMTP id 9E82A1BF41; Tue, 5 Nov 2019 15:39:52 +0100 (CET) Received: from inva021.nxp.com (localhost [127.0.0.1]) by inva021.eu-rdc02.nxp.com (Postfix) with ESMTP id 8188E20052D; Tue, 5 Nov 2019 15:39:52 +0100 (CET) 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 2CD8A200508; Tue, 5 Nov 2019 15:39:49 +0100 (CET) Received: from GDB1.ap.freescale.net (gdb1.ap.freescale.net [10.232.132.179]) by invc005.ap-rdc01.nxp.com (Postfix) with ESMTP id 57CD440309; Tue, 5 Nov 2019 22:39:41 +0800 (SGT) From: Nipun Gupta To: dev@dpdk.org Cc: thomas@monjalon.net, ferruh.yigit@intel.com, hemant.agrawal@nxp.com, sachin.saxena@nxp.com, stable@dpdk.org, Nipun Gupta Date: Tue, 5 Nov 2019 19:53:17 +0530 Message-Id: <20191105142321.7478-6-nipun.gupta@nxp.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20191105142321.7478-1-nipun.gupta@nxp.com> References: <20191011054657.21931-1-nipun.gupta@nxp.com> <20191105142321.7478-1-nipun.gupta@nxp.com> X-Virus-Scanned: ClamAV using ClamSMTP Subject: [dpdk-dev] [PATCH 5/9 v4] 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 Tue Nov 5 14:23:18 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Nipun Gupta X-Patchwork-Id: 178527 Delivered-To: patch@linaro.org Received: by 2002:a92:38d5:0:0:0:0:0 with SMTP id g82csp847198ilf; Tue, 5 Nov 2019 06:41:00 -0800 (PST) X-Google-Smtp-Source: APXvYqzV60qOeLEYPyc5ACZHYnyYwla/ZR12Jc7W87OrmatubQHYCZ7zZcKcYAvcp3a/8g6AG1oK X-Received: by 2002:a17:906:5015:: with SMTP id s21mr28899299ejj.226.1572964859937; Tue, 05 Nov 2019 06:40:59 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1572964859; cv=none; d=google.com; s=arc-20160816; b=MbhDbbp4Oc9rs4bGZ90EPmD0NydjrN/vYcK7AzKwWmbMaxRBqbMOlHx9bvHBDND5HT NQG0o30PlZ6UoX02wsdchV+BUJemlsnjkurkptUM3m01olwbCwuDWHN05TyDw4rhg92c suG79MT+9pSqzlMhOUS9+cshXlzv4Oa9n809dw+6PTduSr8/jSNDaPTOSS+yL/XxLaxd nidstW0oZM6Vnx8y3ZB/se5zI7HOLnVY1z+JwS4c/ZBsxt1cwQ7LEjFTh58uTn6PuPAJ lv1Bla+UUwU2BMP4grQTX1/mMVtN+iisWoCSgNCMP2K2Xj6ZVeuo/hAIkGu8WtZ38GfN 085w== 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=PIGeZ/3/FwcPdjjjF8B7aNoOQSTKb1M/5aJITZnjhKM1AUIothh/imBl5cxIMFgBsD LgDl923c+Kb7e7PBGfYE7xtkFOOlF22BMIbX3WMI5kLJZxTCyKTmYF85OSBU7LNJhGuS bheMb3dKakR969t/fKo3IgGESor2SqQnkB7u4CbP1FTBAub5CdAQOqq8NPr6aFEJPOkk AxdQD4se2EkbpVy4hVPM6nl/zOkJTkoWvnlJGfyy7EBOANgqptJq6vdm2EAqucUFTIVN l4D9qEgrWSU9hjFhM8486pq2N6OS3wr9kDjn7PHEtF6IsURtuISwNPGrqq2n5mQAcnAO JCyw== 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 w19si9954432edd.51.2019.11.05.06.40.59; Tue, 05 Nov 2019 06:40:59 -0800 (PST) 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 E29B01BF5A; Tue, 5 Nov 2019 15:39:57 +0100 (CET) Received: from inva020.nxp.com (inva020.nxp.com [92.121.34.13]) by dpdk.org (Postfix) with ESMTP id EF9FB1BF45; Tue, 5 Nov 2019 15:39:52 +0100 (CET) Received: from inva020.nxp.com (localhost [127.0.0.1]) by inva020.eu-rdc02.nxp.com (Postfix) with ESMTP id B241C1A082B; Tue, 5 Nov 2019 15:39:52 +0100 (CET) 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 5E8AA1A00C5; Tue, 5 Nov 2019 15:39:49 +0100 (CET) Received: from GDB1.ap.freescale.net (gdb1.ap.freescale.net [10.232.132.179]) by invc005.ap-rdc01.nxp.com (Postfix) with ESMTP id 50AE44030E; Tue, 5 Nov 2019 22:39:42 +0800 (SGT) From: Nipun Gupta To: dev@dpdk.org Cc: thomas@monjalon.net, ferruh.yigit@intel.com, hemant.agrawal@nxp.com, sachin.saxena@nxp.com, stable@dpdk.org, Nipun Gupta Date: Tue, 5 Nov 2019 19:53:18 +0530 Message-Id: <20191105142321.7478-7-nipun.gupta@nxp.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20191105142321.7478-1-nipun.gupta@nxp.com> References: <20191011054657.21931-1-nipun.gupta@nxp.com> <20191105142321.7478-1-nipun.gupta@nxp.com> X-Virus-Scanned: ClamAV using ClamSMTP Subject: [dpdk-dev] [PATCH 6/9 v4] 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 Tue Nov 5 14:23:19 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Nipun Gupta X-Patchwork-Id: 178529 Delivered-To: patch@linaro.org Received: by 2002:a92:38d5:0:0:0:0:0 with SMTP id g82csp847674ilf; Tue, 5 Nov 2019 06:41:22 -0800 (PST) X-Google-Smtp-Source: APXvYqwnaqEG6urD3qFRZYVk09/rWE9OVnS83s6T5R496Ovjy/NTA4EpgwpN83lA9ZwpNyxKxDHK X-Received: by 2002:a17:906:1f57:: with SMTP id d23mr29097766ejk.233.1572964882556; Tue, 05 Nov 2019 06:41:22 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1572964882; cv=none; d=google.com; s=arc-20160816; b=l39X73g5Z7C92B8TzeHmLw6Zk5Br80IL+anfDZRaiYjSKnLM2M796XJG73e57G6cFh aK/COOAs6AmX/uYwOHTgDr21oPeRfpP6qQDZw60iho6jXS3i7A9x1L6FVt1AfpisztUg bVn2kB0j3bWWZs9MHlXJCDUX/efrk9HsaohPpdSixd7mfehmIS09+HKs6wpFwph1Jxoq iKsMhRhhQGs7hmp7CCV2euCHgeJFcK35w6rrm1Z7grS2hkoccr7Yyh2Ml1+VC/CZ7JRk cZ9mrTm+5/OrwrqvLqLO7+lPpB5h/3y3f2K8dLcDg5v2InI2F+ATrAgCurffeUpS4u1c G8oA== 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=ZOUs9TdB8bEiWBF7IqGxpoWz2sDx5NNhCItS0jiboJ4=; b=a0Iq0yg/ix40RMWpEDWNmvgf/D/LEeEViznB6hRl/kFmvyyHWajlT9vYZ+Tz2hfy/E ZlbaUyQ6at08O+Z+2zrnq1Ltsw7eeHuN9deZoFfEKg2KY7qcyZIrs4/hrmPPgaOWGFeu EQJnmW1O2/elpf9Qbgxira0J1YQupR5SIhcujP3F/pJQG6mFhrkJu/gA6Rv9zkSBlq7X lV9RLfk5uTnOoo8lEjiIN8gioPleO8eL+HNqcPWNSS8zMH8J3Lh+mjx05frhUhmT0eHY QrERwcUfZ7GVWgK2GpEIdkc8pYfzKyZr/NNkMz0/miyLLbWPbivLH0Oa4wxLZPm7PbE5 gSZg== 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 b49si8752144eda.312.2019.11.05.06.41.22; Tue, 05 Nov 2019 06:41:22 -0800 (PST) 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 1EF3F1BF80; Tue, 5 Nov 2019 15:40:01 +0100 (CET) Received: from inva021.nxp.com (inva021.nxp.com [92.121.34.21]) by dpdk.org (Postfix) with ESMTP id 044D41BF45; Tue, 5 Nov 2019 15:39:54 +0100 (CET) Received: from inva021.nxp.com (localhost [127.0.0.1]) by inva021.eu-rdc02.nxp.com (Postfix) with ESMTP id DB3E5200508; Tue, 5 Nov 2019 15:39:53 +0100 (CET) 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 27B8920052C; Tue, 5 Nov 2019 15:39:50 +0100 (CET) Received: from GDB1.ap.freescale.net (gdb1.ap.freescale.net [10.232.132.179]) by invc005.ap-rdc01.nxp.com (Postfix) with ESMTP id 4B471402A9; Tue, 5 Nov 2019 22:39:43 +0800 (SGT) From: Nipun Gupta To: dev@dpdk.org Cc: thomas@monjalon.net, ferruh.yigit@intel.com, hemant.agrawal@nxp.com, sachin.saxena@nxp.com, stable@dpdk.org, Radu Bulie , Nipun Gupta Date: Tue, 5 Nov 2019 19:53:19 +0530 Message-Id: <20191105142321.7478-8-nipun.gupta@nxp.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20191105142321.7478-1-nipun.gupta@nxp.com> References: <20191011054657.21931-1-nipun.gupta@nxp.com> <20191105142321.7478-1-nipun.gupta@nxp.com> X-Virus-Scanned: ClamAV using ClamSMTP Subject: [dpdk-dev] [PATCH 7/9 v4] mempool/dpaa2: report error 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. Report error in such condition. Fixes: 5dc43d22b5ad ("mempool/dpaa2: add hardware offloaded mempool") Cc: stable@dpdk.org Signed-off-by: Radu Bulie Signed-off-by: Nipun Gupta --- drivers/mempool/dpaa2/dpaa2_hw_mempool.c | 27 +++++++++++++++++------- 1 file changed, 19 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..cc4f837b6 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,15 @@ 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) { + DPAA2_MEMPOOL_ERR("bman release retry exceeded, low fbpr?"); + return; + } + } aligned: /* if there are more buffers to free */ @@ -243,10 +249,15 @@ 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) { + DPAA2_MEMPOOL_ERR("bman release retry exceeded, low fbpr?"); + return; + } + } n += DPAA2_MBUF_MAX_ACQ_REL; } } From patchwork Tue Nov 5 14:23:20 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Nipun Gupta X-Patchwork-Id: 178525 Delivered-To: patch@linaro.org Received: by 2002:a92:38d5:0:0:0:0:0 with SMTP id g82csp846827ilf; Tue, 5 Nov 2019 06:40:41 -0800 (PST) X-Google-Smtp-Source: APXvYqwTThRn5fCVR+q6se8sqXwkRLuVd97uBnJaEKDhGaktPY53VooPr+6j4XhaF3znO6E5ev5O X-Received: by 2002:aa7:dc1a:: with SMTP id b26mr36173988edu.139.1572964840816; Tue, 05 Nov 2019 06:40:40 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1572964840; cv=none; d=google.com; s=arc-20160816; b=B2BlGLNNUtwXoeZwGV+2BHBIZHHARHWxJYS40js0oOnUJKtbV7SsiRq8r+y+1FCsca hnKmCQO225/oA1PD2uB5ESrYmcGtsdFa4pBwsTv29CjEwHspZozIZxkSODOl8ND6d6Ph f/H78quy7Sp6OUIW5AQWo89Kh8Yvv8iC80+IGZu7Fi7E1kadAr+ePanXHAI3zMIeGPo/ PxRzbmGFlWRb3IgCfvsumEaVVw617uA/HALL6HqjmvWjzedfEmQ+pkhJyAiRrPY/9nS7 iYJ/j2TT1ZK9ikIWwlSO3VnYvFyiC3JP8sW9laAhRwe8NefqXBfTfhFpkpKbm9C3Lktv P6HQ== 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=wmsp8w60/5JvgZAc219fq+6BozgOBVMWoJWP1r/XA5M=; b=BsTFGw1MOJ6emv+fjrs0hFw2c1z6jLkl5+Nlglfs4N8J+OTwzYkWWvp6BYqLgZ/e6X LMslUELkZYR5PyumVfrDSxNM+qK44A9lyT/pcH1UAPGFmdoghVBk2bYZHlAGDov2YxkV iv4bgsOHVQGhb7iAGMPRKA0X7VzlzyCsMVxILcOgDQtoun7YyySHDPs9EXItvxp7ko43 v2yvMxMJNlxo55LJzMz6w3rPaWtKDXoSdRbEMRcStDkjwBjQIiFuxG/LaFzhCsKW+QEI tIjFcPPdXXZTMVLCo02L8gRAXD9SZF+LfVMq/YZdseTLMtWWZUQDqsEnVqRCGNF88QOS 7Jww== 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 c15si558303ejd.74.2019.11.05.06.40.40; Tue, 05 Nov 2019 06:40:40 -0800 (PST) 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 9B57B1BF49; Tue, 5 Nov 2019 15:39:54 +0100 (CET) Received: from inva021.nxp.com (inva021.nxp.com [92.121.34.21]) by dpdk.org (Postfix) with ESMTP id 922491BF3E for ; Tue, 5 Nov 2019 15:39:52 +0100 (CET) Received: from inva021.nxp.com (localhost [127.0.0.1]) by inva021.eu-rdc02.nxp.com (Postfix) with ESMTP id 30DC0200528; Tue, 5 Nov 2019 15:39:52 +0100 (CET) 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 601D6200522; Tue, 5 Nov 2019 15:39:49 +0100 (CET) Received: from GDB1.ap.freescale.net (gdb1.ap.freescale.net [10.232.132.179]) by invc005.ap-rdc01.nxp.com (Postfix) with ESMTP id 54A6B40318; Tue, 5 Nov 2019 22:39:44 +0800 (SGT) From: Nipun Gupta To: dev@dpdk.org Cc: thomas@monjalon.net, ferruh.yigit@intel.com, hemant.agrawal@nxp.com, sachin.saxena@nxp.com Date: Tue, 5 Nov 2019 19:53:20 +0530 Message-Id: <20191105142321.7478-9-nipun.gupta@nxp.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20191105142321.7478-1-nipun.gupta@nxp.com> References: <20191011054657.21931-1-nipun.gupta@nxp.com> <20191105142321.7478-1-nipun.gupta@nxp.com> X-Virus-Scanned: ClamAV using ClamSMTP Subject: [dpdk-dev] [PATCH 8/9 v4] 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 Acked-by: Akhil Goyal --- 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 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 6c186338f..ee59cf974 100644 --- a/drivers/crypto/dpaa_sec/dpaa_sec.c +++ b/drivers/crypto/dpaa_sec/dpaa_sec.c @@ -3334,6 +3334,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 Tue Nov 5 14:23:21 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Nipun Gupta X-Patchwork-Id: 178528 Delivered-To: patch@linaro.org Received: by 2002:a92:38d5:0:0:0:0:0 with SMTP id g82csp847433ilf; Tue, 5 Nov 2019 06:41:12 -0800 (PST) X-Google-Smtp-Source: APXvYqyFnwp/6Ocn/idcZ6Hj68FlkAwD9IiaeawMEH7IHReapnORUWctaqg1GUiGHbXOlmhaZEvM X-Received: by 2002:a17:906:2a89:: with SMTP id l9mr29849018eje.329.1572964872057; Tue, 05 Nov 2019 06:41:12 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1572964872; cv=none; d=google.com; s=arc-20160816; b=IyrLirOefzqtwZjztkGo3S1TbRjahe9IyFri4uZzFibN38AUHpVLd7vlNurYzT1Db0 VPS7n2s0Zx3iyUa94EegMDxwD5tBecXg1YLq/XXwtQi8TkWXqi4rBCs3NTJ6L44ggO8Z OX9E89J70tCIOrOTcOTd4egiuvMzV3u+Haa3BWbdq4ge1YtGjxVACffWLw/lNy4+L1cD H02cwUgBs/ZGm0PocNV5W12z0KD4kx3wIW0Gb2MCD+UgVY0sZtrrI4XPUS5Q2yLAa5CB jR6qPrid/2NdIzhCa5g2ZXk0mZr6TqlQm+42SFObwDeoeXKqwOWtaOyu7E/PbnqhhRl2 6UcA== 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=euE2jjThgMxvidi6AlV4r2VU/TAlu3O8v2LCUEU8ph0=; b=Zr+geATvAHNDlFvggJSP0uih4Lx7xlbMRnfRsIzhb+in2Saxv5j/9cHjVrogZoDIIu Rk1/oTaXIPp2+md+PgJ49reU+cMV3dCkU8UPgK0SKFNRTPepQ1iX0QiElIBxT7+AVuWL Mt8FiSunLjyqYBTxUs7Bn+4z4zQz0nrUMpmBnD+gdshR7XUeyJ08uroJTscfKgDtLeSi CWPrmXSy1CfL6J7FfIBk1XZs2HOnPsnOxdkUMPfM7CJZEZ6WinHDQYc/U8XOjfDcQw4V xQI2qmMe1p8jlkjcGNj7o9nL28cFl+2WYVBXJTVuEi3tqRXlPlPTO1ancMRDGwgXdfZJ +1qw== 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 d7si10458166eda.429.2019.11.05.06.41.11; Tue, 05 Nov 2019 06:41:12 -0800 (PST) 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 BA8AC1BF69; Tue, 5 Nov 2019 15:39:59 +0100 (CET) Received: from inva020.nxp.com (inva020.nxp.com [92.121.34.13]) by dpdk.org (Postfix) with ESMTP id B99BF1BF41 for ; Tue, 5 Nov 2019 15:39:53 +0100 (CET) Received: from inva020.nxp.com (localhost [127.0.0.1]) by inva020.eu-rdc02.nxp.com (Postfix) with ESMTP id 9F0031A00C5; Tue, 5 Nov 2019 15:39:53 +0100 (CET) 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 AA3911A056E; Tue, 5 Nov 2019 15:39:50 +0100 (CET) Received: from GDB1.ap.freescale.net (gdb1.ap.freescale.net [10.232.132.179]) by invc005.ap-rdc01.nxp.com (Postfix) with ESMTP id 1C0D44031F; Tue, 5 Nov 2019 22:39:45 +0800 (SGT) From: Nipun Gupta To: dev@dpdk.org Cc: thomas@monjalon.net, ferruh.yigit@intel.com, hemant.agrawal@nxp.com, sachin.saxena@nxp.com, Shreyansh Jain Date: Tue, 5 Nov 2019 19:53:21 +0530 Message-Id: <20191105142321.7478-10-nipun.gupta@nxp.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20191105142321.7478-1-nipun.gupta@nxp.com> References: <20191011054657.21931-1-nipun.gupta@nxp.com> <20191105142321.7478-1-nipun.gupta@nxp.com> X-Virus-Scanned: ClamAV using ClamSMTP Subject: [dpdk-dev] [PATCH 9/9 v4] 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" remove unnecessary dup and free Signed-off-by: Shreyansh Jain Reviewed-by: Nipun Gupta --- drivers/bus/fslmc/fslmc_bus.c | 19 +++++++++---------- 1 file changed, 9 insertions(+), 10 deletions(-) -- 2.17.1 diff --git a/drivers/bus/fslmc/fslmc_bus.c b/drivers/bus/fslmc/fslmc_bus.c index 9caf5b6b9..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,26 +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) { + if (addr) strcpy(addr, sep); - if (!sep_exists && sep) - free(sep); - return 0; - } + ret = 0; err_out: - if (!sep_exists && sep) - free(sep); - return -EINVAL; + return ret; } static int