From patchwork Wed Oct 30 12:09:47 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Nipun Gupta X-Patchwork-Id: 178105 Delivered-To: patch@linaro.org Received: by 2002:a92:409a:0:0:0:0:0 with SMTP id d26csp1204013ill; Wed, 30 Oct 2019 05:26:14 -0700 (PDT) X-Google-Smtp-Source: APXvYqxZs39B2nrJ5jTCpmlTVbywiFrp2Z1pDkSVaj+BuCSxTGq1m6xwybU5/2LSzO32JFclJbun X-Received: by 2002:a17:906:7097:: with SMTP id b23mr8801436ejk.252.1572438374219; Wed, 30 Oct 2019 05:26:14 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1572438374; cv=none; d=google.com; s=arc-20160816; b=h/x8hIEn1PNXI2Dkh9j0ZuO22o2rHxqec8DbMyePuZi4vzjZXZku1ug232bWOrnS8K 54Rk1+m7CkOBgfl8BL6POweQTB+FiZ2sHavCOdhwR5AyrTYy8VsfEclEJ/qSBFeCSJAw TyBXu5QaPmkRGVwJTsjgn3tT8RWaFlKQPlUmxktUd3KFZksxWRzVMxAxCOiUvYukwXJF Qtj49Btey0HGMqgMPFxrsYet8IOziwKCgre9BSDuYAsbtwj+LMQB1E7l59/l30vpPLEW H52Y1bIThDZJEa41swlQrGNjecVhsqoKqb/UjbBdCA/+db2k5jNJAeeCXNNtBY1AUw3t 6sfA== 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=ba9c3zRTbhx2NxFCZC5suFTecCK8BiPaHh3BkI2rH8jjwHdyHWk7luuBsNBF1OEpnG v4ZCxK1h+qDdRNPX+nfibdQIRf3L99JTg00VvU0ocD/uaD8C1pZvnoeQq2P0jm4O48Xu Ma6VRV0rrD0DlgYyaIItGP8Qi3VvwCeMCjKj0fr0JaFDMW5anjEmeskobuZvZKKLnpBQ wgQwHvI7SuBzl1Cq7AFULMcoUlu8lhcm9T0KWQnZNmbzgckJYALpkBa4QNmNHRdXbKsH tKgs9JSjk7ZgdzvjNzICD6h3iuVKK5GVMuN2+JkuEZ4OYJVv/jeC3z16Gm2VIVx7amqi cPAA== 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 i47si1332650ede.173.2019.10.30.05.26.14; Wed, 30 Oct 2019 05:26:14 -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 1D1A71C068; Wed, 30 Oct 2019 13:26:13 +0100 (CET) Received: from inva021.nxp.com (inva021.nxp.com [92.121.34.21]) by dpdk.org (Postfix) with ESMTP id E25C51C043; Wed, 30 Oct 2019 13:26:07 +0100 (CET) Received: from inva021.nxp.com (localhost [127.0.0.1]) by inva021.eu-rdc02.nxp.com (Postfix) with ESMTP id 3FCA0200787; Wed, 30 Oct 2019 13:26:07 +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 DEA1320078F; Wed, 30 Oct 2019 13:26:03 +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 B0FE4402C7; Wed, 30 Oct 2019 20:25:59 +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: Wed, 30 Oct 2019 17:39:47 +0530 Message-Id: <20191030120955.26904-2-nipun.gupta@nxp.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20191030120955.26904-1-nipun.gupta@nxp.com> References: <20191011054657.21931-1-nipun.gupta@nxp.com> <20191030120955.26904-1-nipun.gupta@nxp.com> X-Virus-Scanned: ClamAV using ClamSMTP Subject: [dpdk-dev] [PATCH 1/9 v3] 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 Wed Oct 30 12:09:48 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Nipun Gupta X-Patchwork-Id: 178106 Delivered-To: patch@linaro.org Received: by 2002:a92:409a:0:0:0:0:0 with SMTP id d26csp1204194ill; Wed, 30 Oct 2019 05:26:23 -0700 (PDT) X-Google-Smtp-Source: APXvYqxtdmZinH9RLH+F+6Lo+CODRd/AfyezWlKogo8auVyb/08/IoOR2rgAhTQvcJUlSQ8+Ddog X-Received: by 2002:a17:906:1f09:: with SMTP id w9mr8787564ejj.35.1572438383543; Wed, 30 Oct 2019 05:26:23 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1572438383; cv=none; d=google.com; s=arc-20160816; b=i7HAEJE1JbTiG3MsTT8Z+oX+0MyG5W9XD/N0N3zvWO6O5PotR/NyOltvLF9pPDi5ew lGaLfx2K6uASZcBNFhX5RQxNgsRJ/VoJXpAl2eyT1UZt1zGJfqrRnsbZyXtmnJkHJvFF AQzpIus8hEgsvzVLoq0RnuN2LfHS35zcFFpfdhaIBXZGAv+1VqwpyRQmFJ4bWd9iUKoX cuWyUbUltL1XKWIGBQA/XfeeZAFybf5/3Bl3s+eTaSKT5VA5NRpokuAj2+XtMnZGIuZ5 aVhzaKlMJZKSuaF60Kqok+z0n4prgoq/lllXQehwCKu0ba710tVLRqn3bDQ254S7VAjD mzZw== 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=x/3oth9wVRnM3+rwkvRhHAfuFm81KCWcRm5YxnSP7LjPBqObHOslx3V7XFPkqgpxRt tKt51yj0n19B+z3zsGVBhsBLnof4vKbmvS406+Ynd6c43oDbitrkwZetpVrf6l7ykdsG 7csRmAx+zyPI9lJS/y5czzBGlDfzZO0haiNeztN2yea8ZJCARxpI4M1j7eH3h7L7/U3K RaAOYOcoeYYXsmYj/rghjIhi68UTyyu2m/5kLq/7t1VYTkPSg+pVfY6prCHDdmK50hqA ED4EInmtAt85UxtDt546vj8D0OB/neU9Qx8DBizgQWYq41H3XRVrIksdITBHSh4UwB8c DacA== 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 y17si1423385edd.148.2019.10.30.05.26.23; Wed, 30 Oct 2019 05:26:23 -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 A863F1C07D; Wed, 30 Oct 2019 13:26:15 +0100 (CET) Received: from inva021.nxp.com (inva021.nxp.com [92.121.34.21]) by dpdk.org (Postfix) with ESMTP id 52F931C044; Wed, 30 Oct 2019 13:26:08 +0100 (CET) Received: from inva021.nxp.com (localhost [127.0.0.1]) by inva021.eu-rdc02.nxp.com (Postfix) with ESMTP id 364C5200462; Wed, 30 Oct 2019 13:26:08 +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 D46DA2007C1; Wed, 30 Oct 2019 13:26:04 +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 A6B2F402B7; Wed, 30 Oct 2019 20:26:00 +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: Wed, 30 Oct 2019 17:39:48 +0530 Message-Id: <20191030120955.26904-3-nipun.gupta@nxp.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20191030120955.26904-1-nipun.gupta@nxp.com> References: <20191011054657.21931-1-nipun.gupta@nxp.com> <20191030120955.26904-1-nipun.gupta@nxp.com> X-Virus-Scanned: ClamAV using ClamSMTP Subject: [dpdk-dev] [PATCH 2/9 v3] 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 Wed Oct 30 12:09:49 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Nipun Gupta X-Patchwork-Id: 178107 Delivered-To: patch@linaro.org Received: by 2002:a92:409a:0:0:0:0:0 with SMTP id d26csp1204374ill; Wed, 30 Oct 2019 05:26:32 -0700 (PDT) X-Google-Smtp-Source: APXvYqwcNWzdw+oTPXGdoyMqxrs5L+NHq5CrgwCOONIQVRtOXKJZBZDfJ1mTtXpQewR+bXYyDOM/ X-Received: by 2002:a17:906:49d1:: with SMTP id w17mr8809067ejv.101.1572438392180; Wed, 30 Oct 2019 05:26:32 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1572438392; cv=none; d=google.com; s=arc-20160816; b=IalpDjmccmrJ3vv3Sw0xObh7+oLDAFGPpzAbEwkCAoMnznhbmwEwcb8F06DV7mrqyY S0w2k3EZsYlMcQyZ5w+Yc4W6aVcswqiA9yjyaGHEbpude/6/fiUEWacYoesFibg5UozG H/q+y+g7gog2MStX/j/ZdLRZdTdrzlplqAIyWnk1bTA1P2nBiL92YnDBddQTJ2Bgcx/v mc3qxcinWu7Kuc7W4uuGg4jWacqoqTKnQkFD6jPwBSxmLFlTcR2uXbiIdhG0OpB8Q//y 9yJRq87QYso6DMTRahx8g5BswJNhjj4Lq6GPy/g2ftKq4jnfCLUbB7lSf8Kgs6ytD2lC RWqg== 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=i0BeRup9OBFeYYLKWlRvj3dMVeJFHtCbxgSEebriKEDkp+KYrEquGbiRP7QRwpO4P7 rmfK+BCjif7IV0MWXVuhnwXeLEE6H86zcN4rgJPhwb0vrJC3sRkbhAgkMtHZdm12Tpq1 fuVzZiApfceGPegF1Gry3MrtlfHPajo91c1HrI6fPhehUvD7owcrIjTFYUH7sGrmMYp2 4k9MU9a5Fi7jVdjaWwnoyRZgr5/3Pj7eCdetLGfOp7aLtXvHRkFxuAkbBmoVwX6fkL/F /UvoJb+2SXxsJFuVBNO6tqzq69I1AEtAwaZAFtGmiYRFhHyFbJ4LcIfALbUJopBxt+et tDnQ== 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 t16si1153616eji.304.2019.10.30.05.26.31; Wed, 30 Oct 2019 05:26:32 -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 B5F211C0AF; Wed, 30 Oct 2019 13:26:17 +0100 (CET) Received: from inva021.nxp.com (inva021.nxp.com [92.121.34.21]) by dpdk.org (Postfix) with ESMTP id 3E17F1C045; Wed, 30 Oct 2019 13:26:09 +0100 (CET) Received: from inva021.nxp.com (localhost [127.0.0.1]) by inva021.eu-rdc02.nxp.com (Postfix) with ESMTP id 22A6C2007C1; Wed, 30 Oct 2019 13:26:09 +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 C13FE200473; Wed, 30 Oct 2019 13:26:05 +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 9D914402F0; Wed, 30 Oct 2019 20:26:01 +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: Wed, 30 Oct 2019 17:39:49 +0530 Message-Id: <20191030120955.26904-4-nipun.gupta@nxp.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20191030120955.26904-1-nipun.gupta@nxp.com> References: <20191011054657.21931-1-nipun.gupta@nxp.com> <20191030120955.26904-1-nipun.gupta@nxp.com> X-Virus-Scanned: ClamAV using ClamSMTP Subject: [dpdk-dev] [PATCH 3/9 v3] 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 Wed Oct 30 12:09:50 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Nipun Gupta X-Patchwork-Id: 178110 Delivered-To: patch@linaro.org Received: by 2002:a92:409a:0:0:0:0:0 with SMTP id d26csp1204914ill; Wed, 30 Oct 2019 05:27:01 -0700 (PDT) X-Google-Smtp-Source: APXvYqxKj3tzcWM6XWfPlkv2G7UonK6TWMd8Xfmu8Ar0RvsRxrZF70rf6OF9FLDFpdM1rnBXFJk1 X-Received: by 2002:aa7:d552:: with SMTP id u18mr31482062edr.86.1572438421682; Wed, 30 Oct 2019 05:27:01 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1572438421; cv=none; d=google.com; s=arc-20160816; b=cfeZk9WrxNy8+F7w62uxY4RCziGewpwKOUiyqoAiAFcSjP+GmNrFIZFOD7QEzrZAXj APc6re8w4OF2zsm3fbj7ZEA2QyO5wXElte5r+py6ClZZPSdoAzZ+OUrS3HqWEzctng3e 94tjZ+xolpIgg2D0RBS6kz61RH1RW3Ykimf6MEhuOiaQd1Pwd1B4H3hwBLwSsWtu9k9N BmXLOODfJU1+m1VQYL1GDGWUhaeoNqzf77bZVgKuZX4cQNgKK9dOnvTxKbfhqV/R3OT0 ok/AwfGBkUp2DzIncbX4flL78YNXdGSMb4N8lb3myg0ZU5Ndh81/ifR5daYe/q5EV/7V eSqA== 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=K9V0xmj0GZ6wYJOyYVWCdiI1THyl+PcWnsh26xmAP/nVHQ4Obtd/Cq15LgSjvmJoD/ J7lx+5e3wAOKXptdVdexujFuZjvkrp1BeI4n1jtLLjDk0EKPyroR+s2FUvPqTNSoPxmb 4o7zY5IEBYdZI95JHe8H0FYa/Ub5QzQ+IXLTWINjioBif4r7i6RMqi/vVLIKNX+qeNnx e8TFDVH0WY1hGjjpoIO+83z8C4JzzjwnQcJSpkidvlm5QlS2RXlMbioeevjcJTiuAny9 tv49BIgYLMKR3bVjxehFwXBbVLLxtpZOzfJbqphS/JF59xW4ACgSP2SjpfS23yWNRixb qAPw== 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 p5si1081123ejx.100.2019.10.30.05.27.01; Wed, 30 Oct 2019 05:27:01 -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 1A1EB1C0C0; Wed, 30 Oct 2019 13:26:38 +0100 (CET) Received: from inva021.nxp.com (inva021.nxp.com [92.121.34.21]) by dpdk.org (Postfix) with ESMTP id DF19A1C067; Wed, 30 Oct 2019 13:26:12 +0100 (CET) Received: from inva021.nxp.com (localhost [127.0.0.1]) by inva021.eu-rdc02.nxp.com (Postfix) with ESMTP id C41AC200473; Wed, 30 Oct 2019 13:26:12 +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 C990E20078F; Wed, 30 Oct 2019 13:26:08 +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 89EE240320; Wed, 30 Oct 2019 20:26:02 +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: Wed, 30 Oct 2019 17:39:50 +0530 Message-Id: <20191030120955.26904-5-nipun.gupta@nxp.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20191030120955.26904-1-nipun.gupta@nxp.com> References: <20191011054657.21931-1-nipun.gupta@nxp.com> <20191030120955.26904-1-nipun.gupta@nxp.com> X-Virus-Scanned: ClamAV using ClamSMTP Subject: [dpdk-dev] [PATCH 4/9 v3] 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 Wed Oct 30 12:09:51 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Nipun Gupta X-Patchwork-Id: 178109 Delivered-To: patch@linaro.org Received: by 2002:a92:409a:0:0:0:0:0 with SMTP id d26csp1204741ill; Wed, 30 Oct 2019 05:26:53 -0700 (PDT) X-Google-Smtp-Source: APXvYqzZ+B6UXLKD4d46CVKVwyXUKPZWD2G5ycbGwAivWaRfgccp4BmyOu2LhwqUJk9eRTP2iBX/ X-Received: by 2002:a17:906:e8d:: with SMTP id p13mr8616463ejf.159.1572438413016; Wed, 30 Oct 2019 05:26:53 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1572438413; cv=none; d=google.com; s=arc-20160816; b=WFctFRNbM2O+hhAJ4nntdk3H6l1Iacte9A9bVjlAoX63E7M3GAZYI9brBReTS0ec/G JBmncGBuGc99Yv/ojlNMybfyhiw/hS1D1UlBAeH9/O0PQ1Yjsjmr6gRC9JrpDB1U2YWr XOgl+7/f/vGRcFVvFNjMNZQmg5g8W1NHubFCV1flOP22CeRpjUVD6XgYAA+ZPTvtmvQU qmPm7xgSIWkPMZ5zXYOCaicZ9xzByS49Z6KA855Edy8s5BrvsjQWej3J+7i68z7Rz1Dg duVgkSev0//x2U/CbcxXqlFGdzTks9T6w5cYhBU3F8jcGCxxS7pRwMhBuR/fwOi+Yvb0 zDDA== 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=lQ/SwGOY02otr09QLOi/h6qf1T5fJXVAdH1QWhBeVY3vxrLuBH4gOD1w/IFlT7HhGY e0deIIWxIVaIb3ktT94EEvU8On1rNsFKZ3s1ZQlM7y3w0x+vMCihTEDZQH3PuZrVAuv7 iD6fkfYihY/lKo1BvxcJvCDrMc3Gbtwdy//EuatCEM6dVLhpqxtfw+GBpV3i/Vqq948V NVpvwBiZAhcvKlscegEgczITSyM7N2nTYzfTnGSdUbGqh41RX9/rm9bPTYTJ6SIosdI9 0dkGLS5tBDx6cPNwnKqcE0voIQoewBrmq84yAv4KRNN2CFYbHHqi1qQ/Vtftu4ZEGSQ4 50+A== 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 x18si1189300ejo.78.2019.10.30.05.26.52; Wed, 30 Oct 2019 05:26:53 -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 36E531BFCD; Wed, 30 Oct 2019 13:26:35 +0100 (CET) Received: from inva020.nxp.com (inva020.nxp.com [92.121.34.13]) by dpdk.org (Postfix) with ESMTP id BF6F31C066; Wed, 30 Oct 2019 13:26:12 +0100 (CET) Received: from inva020.nxp.com (localhost [127.0.0.1]) by inva020.eu-rdc02.nxp.com (Postfix) with ESMTP id 5BB8C1A0065; Wed, 30 Oct 2019 13:26:12 +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 056FB1A07A5; Wed, 30 Oct 2019 13:26:09 +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 8AF7A4032A; Wed, 30 Oct 2019 20:26:03 +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: Wed, 30 Oct 2019 17:39:51 +0530 Message-Id: <20191030120955.26904-6-nipun.gupta@nxp.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20191030120955.26904-1-nipun.gupta@nxp.com> References: <20191011054657.21931-1-nipun.gupta@nxp.com> <20191030120955.26904-1-nipun.gupta@nxp.com> X-Virus-Scanned: ClamAV using ClamSMTP Subject: [dpdk-dev] [PATCH 5/9 v3] 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 Wed Oct 30 12:09:52 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Nipun Gupta X-Patchwork-Id: 178108 Delivered-To: patch@linaro.org Received: by 2002:a92:409a:0:0:0:0:0 with SMTP id d26csp1204548ill; Wed, 30 Oct 2019 05:26:42 -0700 (PDT) X-Google-Smtp-Source: APXvYqx47GjwTBQ6lk8ayRDeSRCSZbsadVyBxr5IqeG7CsruNTvB2oped3eSTiHg8D3vSsesjC0L X-Received: by 2002:a05:6402:2c5:: with SMTP id b5mr31623450edx.157.1572438401986; Wed, 30 Oct 2019 05:26:41 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1572438401; cv=none; d=google.com; s=arc-20160816; b=qMed+qq/Q7klH4Xka/xZHaJYfddxAAQ5HAxp1NfvyspClOcvMIF4F7adklRsrM1M3c Tks+2p/OL8g5yhcX66dxnqtXr4kpxAY9AEarYEZCmlj7aZj7Bo+RtTCyRdFwJfKfuBNO hOE389IRFiYe8EJPHd+X25X0iM7517q6bi0QzCsDhh2ZL5zCFrTheWKzFiS83d17lTYl CD6tvWe0WP8OqClHkwFwXPchWA5RKS/vDf3NhPK9i1+VdmV8k0dSUKYKCoiO5mxYcSIL 3weyOOmQe8OZOQ/vIycSoZSWI+oQU0YdLy9wbS6EbYRSKwZaCAGv/O2A7/pfzAGKVsZc xH2A== 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=Pqm48BmRsBrdEcCT/4vxWze6BOzdseeE6AYm6idCmin4PgiOJ1oZQZsvZEmVEMNBz4 kNsb42aDQOeIDqMuC4cmJQi/P5S9sdyh4fHF1khAlYQTIBKpwcE5InH6CNt2VcTpDzCK F7L475evRHfTtbd1+zgMP6rpicKwJsBdUhgJw7O81fRdeMPPdcvPbjB2gbImknTAm3K3 jaWMqwutLGANph6eZOCAl7QPVO2523NxBNNZDxGAHft8B/w/w9ryHuU1lnTerQ/6q8dg pUmg4sVifAnYY3czngp01720egaoE3ZJapllP/BURa17qeynvZ9giSd28tbgAD/bL5cQ ovKQ== 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 o2si1514556edj.290.2019.10.30.05.26.41; Wed, 30 Oct 2019 05:26:41 -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 406FA1C0AB; Wed, 30 Oct 2019 13:26:20 +0100 (CET) Received: from inva021.nxp.com (inva021.nxp.com [92.121.34.21]) by dpdk.org (Postfix) with ESMTP id 2F49A1C045; Wed, 30 Oct 2019 13:26:12 +0100 (CET) Received: from inva021.nxp.com (localhost [127.0.0.1]) by inva021.eu-rdc02.nxp.com (Postfix) with ESMTP id 110D6200462; Wed, 30 Oct 2019 13:26:12 +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 AEAD1200497; Wed, 30 Oct 2019 13:26:08 +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 819CA402E2; Wed, 30 Oct 2019 20:26:04 +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: Wed, 30 Oct 2019 17:39:52 +0530 Message-Id: <20191030120955.26904-7-nipun.gupta@nxp.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20191030120955.26904-1-nipun.gupta@nxp.com> References: <20191011054657.21931-1-nipun.gupta@nxp.com> <20191030120955.26904-1-nipun.gupta@nxp.com> X-Virus-Scanned: ClamAV using ClamSMTP Subject: [dpdk-dev] [PATCH 6/9 v3] 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 Wed Oct 30 12:09:53 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Nipun Gupta X-Patchwork-Id: 178112 Delivered-To: patch@linaro.org Received: by 2002:a92:409a:0:0:0:0:0 with SMTP id d26csp1205298ill; Wed, 30 Oct 2019 05:27:21 -0700 (PDT) X-Google-Smtp-Source: APXvYqx75YgAgWRxnSVGpvzTcMLpVjQENUYOCIZbMXcYMId1DBR2TM/C4dKkD5FR5d5Vhglhb9p3 X-Received: by 2002:a17:906:2ada:: with SMTP id m26mr8695345eje.87.1572438441549; Wed, 30 Oct 2019 05:27:21 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1572438441; cv=none; d=google.com; s=arc-20160816; b=lqAOSHUciLx1k+J0DzYv6KCdRa1u1T24ZPz3vSn8KkzVeFrY8HqLHqbKc1TM6V2tdP SpMjp8Fu6K0ANqDa0MJLEDaAMJQ/3dObhpPJngCpgYmzihK27XPwhtMZxpjsDwu3/SMo RPzhmbDX2wLJ7SyyVYpvkKu4KXkCl6ZA3SQsVMS/Y4SqtXOXTYo0X4B2BUVQcgOVZeZV /QWTF6NshaOBE8OpWRuo7JJZIJbWiuodJ7+ElyO33onmOKotE9p/5aSXmtozUgEXa3Ue kW7wf3KkjhBYxDVNVqDtlnGfsZY7zFje8sPdao3mtnk2d+L4Dk8MWynQqRZUe7dqlpks Y8dA== 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=evpfzqlWpLA7rgUrNgNt/kO9Au29LA8Axku7myxaY7wFmNSpIipmbPy+tMF6FrM0Bo yHja+puzmT+Mjaymds5T0dfrvYQL2FoyUC+bqImUj2bFKK89hhkTt4y5keXqlyQiRhNT 8vVwIM41RV1wVQyT8DNISZI9QWQPaz4rPiLdQRWL66meVMYfXbmAfSUItV4OO3X+M/0E X4VZafeQousPj3x1yNjjzJovbCRQC4oJGujZi1/4BTgzZFEmvxmik4iOghr6lkjctuQr 4cJ2YWFGCyrmCu0lJcDHKpciHbaQ4J1YhIrw20FtVErJKcFD/LwSdORe+Rtcf0q27yTV P+2w== 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 w7si1326634edj.96.2019.10.30.05.27.21; Wed, 30 Oct 2019 05:27:21 -0700 (PDT) Received-SPF: pass (google.com: domain of dev-bounces@dpdk.org designates 92.243.14.124 as permitted sender) client-ip=92.243.14.124; Authentication-Results: mx.google.com; spf=pass (google.com: domain of dev-bounces@dpdk.org designates 92.243.14.124 as permitted sender) smtp.mailfrom=dev-bounces@dpdk.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=nxp.com Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 8010C1C0D9; Wed, 30 Oct 2019 13:26:51 +0100 (CET) Received: from inva021.nxp.com (inva021.nxp.com [92.121.34.21]) by dpdk.org (Postfix) with ESMTP id 13D221C069; Wed, 30 Oct 2019 13:26:14 +0100 (CET) Received: from inva021.nxp.com (localhost [127.0.0.1]) by inva021.eu-rdc02.nxp.com (Postfix) with ESMTP id CF5AC200787; Wed, 30 Oct 2019 13:26:13 +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 19F5D200485; Wed, 30 Oct 2019 13:26:10 +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 76FA7402FC; Wed, 30 Oct 2019 20:26:05 +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: Wed, 30 Oct 2019 17:39:53 +0530 Message-Id: <20191030120955.26904-8-nipun.gupta@nxp.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20191030120955.26904-1-nipun.gupta@nxp.com> References: <20191011054657.21931-1-nipun.gupta@nxp.com> <20191030120955.26904-1-nipun.gupta@nxp.com> X-Virus-Scanned: ClamAV using ClamSMTP Subject: [dpdk-dev] [PATCH 7/9 v3] 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 Wed Oct 30 12:09:54 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Nipun Gupta X-Patchwork-Id: 178111 Delivered-To: patch@linaro.org Received: by 2002:a92:409a:0:0:0:0:0 with SMTP id d26csp1205153ill; Wed, 30 Oct 2019 05:27:14 -0700 (PDT) X-Google-Smtp-Source: APXvYqywOS+iP2xs6S9/mBC9C/hrvNrm75SBTEcgUy74RIMHPmpNR7XmLmrpX0K2gP0ECku/zbA3 X-Received: by 2002:a17:906:d972:: with SMTP id rp18mr8677596ejb.179.1572438433938; Wed, 30 Oct 2019 05:27:13 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1572438433; cv=none; d=google.com; s=arc-20160816; b=uyTQcg1+faydPYMWPC/LycGhM80yfaw2UaTAWiJ1mqMf8RdjeQpwmrxPS5nHR1XDwY Agoi+zjFWc5IqXk/AAnzEjZdvjwh4o2bue7z3BitutUg5KPzpHGFCq4mVW78Mtv9hfso aT/ojhrM8LjuZ+zR4aen+WeFtC+2o4u+Ck1PWo9I8pGZ1tc7HJWUnqylQdqgkKDOXxyR XndanDr4ST8Tx2iLtw3Z7Yjqrwi8RkcoAOBaoS1epkpPMSBLz82zm7fKftlxGVfaWamG PN/Li2igkemBuXfVzwqCaFYC/9JKX8VVYhbuvn44etupG9Qx+7UAIief4SsVfMEQN7p4 u8/w== 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=li2J+maWZa5t2B0Sp0iwMc1K312h3XjwGNl5l6can2tOcwnhSR0E7Iur3DlTK5u2BJ EK9DPoXxbKxOPxRXA5qenejbuuzM5ea9uy+CHOxg8vafcD9lRW3yESLYQ6XTq+MTXODs 6TnYczV2gaI11UqQYUjk8iOmsCB9KgYTKlDOoyNQlHYuNUaIArBss3Cx85JydPSMqgJg MUHiUrV5oRpm8UHCNj1ui/hhBCKbjQOQqJI5oknLXtDWSmsJmBRKQVch1HcfpgmxwfBe gAda5FfIHJ8PoJGekCf3c44kOui25Jgeq0TzK01jp3kbgrO73wYLMAhw9o9I5cJRVWMz ip9w== 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 m8si1141711ejx.85.2019.10.30.05.27.13; Wed, 30 Oct 2019 05:27:13 -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 61F491C0D6; Wed, 30 Oct 2019 13:26:48 +0100 (CET) Received: from inva021.nxp.com (inva021.nxp.com [92.121.34.21]) by dpdk.org (Postfix) with ESMTP id 9A10A1C045 for ; Wed, 30 Oct 2019 13:26:12 +0100 (CET) Received: from inva021.nxp.com (localhost [127.0.0.1]) by inva021.eu-rdc02.nxp.com (Postfix) with ESMTP id 7B2C1200497; Wed, 30 Oct 2019 13:26:12 +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 A9337200473; Wed, 30 Oct 2019 13:26:09 +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 76CFB40307; Wed, 30 Oct 2019 20:26:06 +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: Wed, 30 Oct 2019 17:39:54 +0530 Message-Id: <20191030120955.26904-9-nipun.gupta@nxp.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20191030120955.26904-1-nipun.gupta@nxp.com> References: <20191011054657.21931-1-nipun.gupta@nxp.com> <20191030120955.26904-1-nipun.gupta@nxp.com> X-Virus-Scanned: ClamAV using ClamSMTP Subject: [dpdk-dev] [PATCH 8/9 v3] 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 Wed Oct 30 12:09: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: 178113 Delivered-To: patch@linaro.org Received: by 2002:a92:409a:0:0:0:0:0 with SMTP id d26csp1205501ill; Wed, 30 Oct 2019 05:27:32 -0700 (PDT) X-Google-Smtp-Source: APXvYqxOLQco0Z7jWLPRO85PnrvTuDBgULqL1Xymm2O4b5RO2wq06D0E/+RfBrlZvJCggl6D7oiF X-Received: by 2002:a17:906:288f:: with SMTP id o15mr8991127ejd.270.1572438452696; Wed, 30 Oct 2019 05:27:32 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1572438452; cv=none; d=google.com; s=arc-20160816; b=mO77EJ3kAPX6O0oE9KlWzGPgIjzdPSg6dcJJMnjoFnncst/1oa3+AjY5rbV5Lor5Ul KNQIUIHpl4jzut2kf+q7AFm+jXqSi1LIA0O1mxrLUbzkT5K4CVQX5Ru6qCqnO05iy2aB IdEQ8vjTkxoEG1yQDOtNnwFQEiTTCcpm7SlMCBMXiZBQ+X9zLvkW8xlEXDY5wPohSVQW Iustquu3D7IhTqKPF1fAN1XET/l1XTB0wRZcYjkvt4h6oJJC6GtHkbWSTqcbgPhw9Bcd oe00FBrdXY/UF3LiUIrxHxNQ+ndcQ9CypShWrvvP/yko6RnuT4sekemxvi/J/OE9KFC+ DirA== 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=nRAn7Am7cYNOqFT1ISOglabUmO0/HV4jvxIHRRsLdts=; b=DGNtEPKky15UbtuFrqGF0wcJgcW4Mf+gkxuMT4ZrVNZ/Ty6gNMrUaVLnPSlCg6piKg ZVTLfv+4BtBOZQ6t8cNRCdgYvCl8CKLoA0Oc/cbCYC7oBB42ULImNBNc9j1SD/sHWEr2 eZugKR2IiKlTZfunaVxAN9r35KbvrgvHlTebqCiLPClyQbHepZhdwYVn7KpU3tM8nnR6 HkCT+qpYKdovl+26bByA9yXo0wl82B0gAzBfYl2ZSGDKvpaJQ4GJc1bPtpANevBAgaYw ZcHBwKC6vTI7nTADODpFkOujkHcjsiR0SfLVbMcp1y7qG65AQ9FIBUEKY8PNoYBmkU8N fPKg== 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 n10si1427665edb.175.2019.10.30.05.27.32; Wed, 30 Oct 2019 05:27:32 -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 906711C10E; Wed, 30 Oct 2019 13:26:54 +0100 (CET) Received: from inva021.nxp.com (inva021.nxp.com [92.121.34.21]) by dpdk.org (Postfix) with ESMTP id 226641C06A for ; Wed, 30 Oct 2019 13:26:14 +0100 (CET) Received: from inva021.nxp.com (localhost [127.0.0.1]) by inva021.eu-rdc02.nxp.com (Postfix) with ESMTP id D68C22007C1; Wed, 30 Oct 2019 13:26:13 +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 DF2682007EA; Wed, 30 Oct 2019 13:26:10 +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 3A63C40309; Wed, 30 Oct 2019 20:26:07 +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: Wed, 30 Oct 2019 17:39:55 +0530 Message-Id: <20191030120955.26904-10-nipun.gupta@nxp.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20191030120955.26904-1-nipun.gupta@nxp.com> References: <20191011054657.21931-1-nipun.gupta@nxp.com> <20191030120955.26904-1-nipun.gupta@nxp.com> X-Virus-Scanned: ClamAV using ClamSMTP Subject: [dpdk-dev] [PATCH 9/9 v3] 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 Reviewed-by: Nipun Gupta --- 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