From patchwork Thu Oct 17 12:43:55 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Nipun Gupta X-Patchwork-Id: 61385 X-Patchwork-Delegate: thomas@monjalon.net Return-Path: X-Original-To: patchwork@dpdk.org Delivered-To: patchwork@dpdk.org Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id D195E1E99D; Thu, 17 Oct 2019 14:59:52 +0200 (CEST) Received: from inva021.nxp.com (inva021.nxp.com [92.121.34.21]) by dpdk.org (Postfix) with ESMTP id D40F21E993; Thu, 17 Oct 2019 14:59:49 +0200 (CEST) Received: from inva021.nxp.com (localhost [127.0.0.1]) by inva021.eu-rdc02.nxp.com (Postfix) with ESMTP id 700DF200673; Thu, 17 Oct 2019 14:59:49 +0200 (CEST) Received: from invc005.ap-rdc01.nxp.com (invc005.ap-rdc01.nxp.com [165.114.16.14]) by inva021.eu-rdc02.nxp.com (Postfix) with ESMTP id 6058A2000C2; Thu, 17 Oct 2019 14:59:46 +0200 (CEST) Received: from GDB1.ap.freescale.net (gdb1.ap.freescale.net [10.232.132.179]) by invc005.ap-rdc01.nxp.com (Postfix) with ESMTP id 8B9D2402B7; Thu, 17 Oct 2019 20:59:42 +0800 (SGT) From: Nipun Gupta To: dev@dpdk.org Cc: ferruh.yigit@intel.com, hemant.agrawal@nxp.com, sachin.saxena@nxp.com, stable@dpdk.org, Nipun Gupta Date: Thu, 17 Oct 2019 18:13:55 +0530 Message-Id: <20191017124403.26734-2-nipun.gupta@nxp.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20191017124403.26734-1-nipun.gupta@nxp.com> References: <20191011054657.21931-1-nipun.gupta@nxp.com> <20191017124403.26734-1-nipun.gupta@nxp.com> X-Virus-Scanned: ClamAV using ClamSMTP Subject: [dpdk-dev] [PATCH 1/9 v2] net/dpaa: fix supported RSS types X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" This patch fixes the supported RSS types on DPAA platform Fixes: 15aa2a1b02e6 ("net/dpaa: update RSS offload types") Cc: stable@dpdk.org Signed-off-by: Nipun Gupta Acked-by: Hemant Agrawal --- drivers/net/dpaa/dpaa_ethdev.h | 13 +++++-------- 1 file changed, 5 insertions(+), 8 deletions(-) diff --git a/drivers/net/dpaa/dpaa_ethdev.h b/drivers/net/dpaa/dpaa_ethdev.h index 182becac1..7e51b0e68 100644 --- a/drivers/net/dpaa/dpaa_ethdev.h +++ b/drivers/net/dpaa/dpaa_ethdev.h @@ -76,14 +76,11 @@ #define DPAA_DEBUG_FQ_TX_ERROR 1 #define DPAA_RSS_OFFLOAD_ALL ( \ - ETH_RSS_FRAG_IPV4 | \ - ETH_RSS_NONFRAG_IPV4_TCP | \ - ETH_RSS_NONFRAG_IPV4_UDP | \ - ETH_RSS_NONFRAG_IPV4_SCTP | \ - ETH_RSS_FRAG_IPV6 | \ - ETH_RSS_NONFRAG_IPV6_TCP | \ - ETH_RSS_NONFRAG_IPV6_UDP | \ - ETH_RSS_NONFRAG_IPV6_SCTP) + ETH_RSS_L2_PAYLOAD | \ + ETH_RSS_IP | \ + ETH_RSS_UDP | \ + ETH_RSS_TCP | \ + ETH_RSS_SCTP) #define DPAA_TX_CKSUM_OFFLOAD_MASK ( \ PKT_TX_IP_CKSUM | \ From patchwork Thu Oct 17 12:43:56 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Nipun Gupta X-Patchwork-Id: 61386 X-Patchwork-Delegate: thomas@monjalon.net Return-Path: X-Original-To: patchwork@dpdk.org Delivered-To: patchwork@dpdk.org Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 691651E9B1; Thu, 17 Oct 2019 14:59:56 +0200 (CEST) Received: from inva021.nxp.com (inva021.nxp.com [92.121.34.21]) by dpdk.org (Postfix) with ESMTP id 2ABB11E995; Thu, 17 Oct 2019 14:59:51 +0200 (CEST) Received: from inva021.nxp.com (localhost [127.0.0.1]) by inva021.eu-rdc02.nxp.com (Postfix) with ESMTP id B5824200668; Thu, 17 Oct 2019 14:59:50 +0200 (CEST) Received: from invc005.ap-rdc01.nxp.com (invc005.ap-rdc01.nxp.com [165.114.16.14]) by inva021.eu-rdc02.nxp.com (Postfix) with ESMTP id A64F22002C1; Thu, 17 Oct 2019 14:59:47 +0200 (CEST) Received: from GDB1.ap.freescale.net (gdb1.ap.freescale.net [10.232.132.179]) by invc005.ap-rdc01.nxp.com (Postfix) with ESMTP id 6EAE0402AE; Thu, 17 Oct 2019 20:59:43 +0800 (SGT) From: Nipun Gupta To: dev@dpdk.org Cc: ferruh.yigit@intel.com, hemant.agrawal@nxp.com, sachin.saxena@nxp.com, stable@dpdk.org, Nipun Gupta Date: Thu, 17 Oct 2019 18:13:56 +0530 Message-Id: <20191017124403.26734-3-nipun.gupta@nxp.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20191017124403.26734-1-nipun.gupta@nxp.com> References: <20191011054657.21931-1-nipun.gupta@nxp.com> <20191017124403.26734-1-nipun.gupta@nxp.com> X-Virus-Scanned: ClamAV using ClamSMTP Subject: [dpdk-dev] [PATCH 2/9 v2] net/dpaa: fix LS1043 alignment check X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" On LS1043, we are good to check 128 byte alignment of offset to transmit out the packet Fixes: 9eba4a60c2f5 ("net/dpaa: support scatter gather in Tx for non DPAA buffer") Cc: stable@dpdk.org Signed-off-by: Nipun Gupta Acked-by: Hemant Agrawal --- drivers/net/dpaa/dpaa_rxtx.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/net/dpaa/dpaa_rxtx.c b/drivers/net/dpaa/dpaa_rxtx.c index bbe615099..5dba1db8b 100644 --- a/drivers/net/dpaa/dpaa_rxtx.c +++ b/drivers/net/dpaa/dpaa_rxtx.c @@ -927,7 +927,7 @@ dpaa_eth_queue_tx(void *q, struct rte_mbuf **bufs, uint16_t nb_bufs) * the buffer in such case. */ if (dpaa_svr_family == SVR_LS1043A_FAMILY && - (mbuf->data_off & 0xFF) != 0x0) + (mbuf->data_off & 0x7F) != 0x0) realloc_mbuf = 1; seqn = mbuf->seqn; if (seqn != DPAA_INVALID_MBUF_SEQN) { From patchwork Thu Oct 17 12:43:57 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Nipun Gupta X-Patchwork-Id: 61387 X-Patchwork-Delegate: thomas@monjalon.net Return-Path: X-Original-To: patchwork@dpdk.org Delivered-To: patchwork@dpdk.org Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 5F5901E9C6; Thu, 17 Oct 2019 14:59:59 +0200 (CEST) Received: from inva021.nxp.com (inva021.nxp.com [92.121.34.21]) by dpdk.org (Postfix) with ESMTP id D13921E99A; Thu, 17 Oct 2019 14:59:51 +0200 (CEST) Received: from inva021.nxp.com (localhost [127.0.0.1]) by inva021.eu-rdc02.nxp.com (Postfix) with ESMTP id 8F207200676; Thu, 17 Oct 2019 14:59:51 +0200 (CEST) Received: from invc005.ap-rdc01.nxp.com (invc005.ap-rdc01.nxp.com [165.114.16.14]) by inva021.eu-rdc02.nxp.com (Postfix) with ESMTP id 7FDD220011A; Thu, 17 Oct 2019 14:59:48 +0200 (CEST) Received: from GDB1.ap.freescale.net (gdb1.ap.freescale.net [10.232.132.179]) by invc005.ap-rdc01.nxp.com (Postfix) with ESMTP id 525ED4030C; Thu, 17 Oct 2019 20:59:44 +0800 (SGT) From: Nipun Gupta To: dev@dpdk.org Cc: ferruh.yigit@intel.com, hemant.agrawal@nxp.com, sachin.saxena@nxp.com, stable@dpdk.org, Nipun Gupta Date: Thu, 17 Oct 2019 18:13:57 +0530 Message-Id: <20191017124403.26734-4-nipun.gupta@nxp.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20191017124403.26734-1-nipun.gupta@nxp.com> References: <20191011054657.21931-1-nipun.gupta@nxp.com> <20191017124403.26734-1-nipun.gupta@nxp.com> X-Virus-Scanned: ClamAV using ClamSMTP Subject: [dpdk-dev] [PATCH 3/9 v2] common/dpaax: fallback to check separate memory node for VM X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" In Virtual Machine the memory node in the device tree is at '/proc/device-tree/memory/reg' which is separate from the memory node path on the host. This patch enables check on both the paths. Fixes: 2f3d633aa593 ("common/dpaax: add library for PA/VA translation table") Cc: stable@dpdk.org Signed-off-by: Nipun Gupta --- drivers/common/dpaax/dpaax_iova_table.c | 7 +++++-- drivers/common/dpaax/dpaax_iova_table.h | 2 ++ 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/drivers/common/dpaax/dpaax_iova_table.c b/drivers/common/dpaax/dpaax_iova_table.c index 43c9c72e6..98b076e09 100644 --- a/drivers/common/dpaax/dpaax_iova_table.c +++ b/drivers/common/dpaax/dpaax_iova_table.c @@ -68,9 +68,12 @@ read_memory_node(unsigned int *count) *count = 0; ret = glob(MEM_NODE_PATH_GLOB, 0, NULL, &result); + if (ret != 0) + ret = glob(MEM_NODE_PATH_GLOB_VM, 0, NULL, &result); + if (ret != 0) { - DPAAX_DEBUG("Unable to glob device-tree memory node: (%s)(%d)", - MEM_NODE_PATH_GLOB, ret); + DPAAX_DEBUG("Unable to glob device-tree memory node (err: %d)", + ret); goto out; } diff --git a/drivers/common/dpaax/dpaax_iova_table.h b/drivers/common/dpaax/dpaax_iova_table.h index 138827e7b..fef97f6dd 100644 --- a/drivers/common/dpaax/dpaax_iova_table.h +++ b/drivers/common/dpaax/dpaax_iova_table.h @@ -45,6 +45,8 @@ extern struct dpaax_iova_table *dpaax_iova_table_p; * is SoC dependent, or even Uboot fixup dependent. */ #define MEM_NODE_PATH_GLOB "/proc/device-tree/memory[@0-9]*/reg" +/* For Virtual Machines memory node is at different path (below) */ +#define MEM_NODE_PATH_GLOB_VM "/proc/device-tree/memory/reg" /* Device file should be multiple of 16 bytes, each containing 8 byte of addr * and its length. Assuming max of 5 entries. */ From patchwork Thu Oct 17 12:43:58 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Nipun Gupta X-Patchwork-Id: 61389 X-Patchwork-Delegate: thomas@monjalon.net Return-Path: X-Original-To: patchwork@dpdk.org Delivered-To: patchwork@dpdk.org Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 335AC1E9CE; Thu, 17 Oct 2019 15:00:08 +0200 (CEST) Received: from inva021.nxp.com (inva021.nxp.com [92.121.34.21]) by dpdk.org (Postfix) with ESMTP id A54FA1E9A6; Thu, 17 Oct 2019 14:59:53 +0200 (CEST) Received: from inva021.nxp.com (localhost [127.0.0.1]) by inva021.eu-rdc02.nxp.com (Postfix) with ESMTP id 89193200663; Thu, 17 Oct 2019 14:59:53 +0200 (CEST) Received: from invc005.ap-rdc01.nxp.com (invc005.ap-rdc01.nxp.com [165.114.16.14]) by inva021.eu-rdc02.nxp.com (Postfix) with ESMTP id D07D32000C2; Thu, 17 Oct 2019 14:59:49 +0200 (CEST) Received: from GDB1.ap.freescale.net (gdb1.ap.freescale.net [10.232.132.179]) by invc005.ap-rdc01.nxp.com (Postfix) with ESMTP id 2C0014031B; Thu, 17 Oct 2019 20:59:45 +0800 (SGT) From: Nipun Gupta To: dev@dpdk.org Cc: ferruh.yigit@intel.com, hemant.agrawal@nxp.com, sachin.saxena@nxp.com, stable@dpdk.org, Nipun Gupta , Radu Bulie Date: Thu, 17 Oct 2019 18:13:58 +0530 Message-Id: <20191017124403.26734-5-nipun.gupta@nxp.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20191017124403.26734-1-nipun.gupta@nxp.com> References: <20191011054657.21931-1-nipun.gupta@nxp.com> <20191017124403.26734-1-nipun.gupta@nxp.com> X-Virus-Scanned: ClamAV using ClamSMTP Subject: [dpdk-dev] [PATCH 4/9 v2] net/dpaa2: add retry and timeout in packet enqueue API X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" In the packet transmit, if the QBMAN is not able to process the packets, the Tx function loops infinitely to send the packet out. This patch changes the logic retry for some time (count) and then return. Fixes: cd9935cec873 ("net/dpaa2: enable Rx and Tx operations") Fixes: 16c4a3c46ab7 ("bus/fslmc: add enqueue response read in qbman") Cc: stable@dpdk.org Signed-off-by: Nipun Gupta Signed-off-by: Radu Bulie --- drivers/bus/fslmc/portal/dpaa2_hw_pvt.h | 2 + drivers/net/dpaa2/dpaa2_rxtx.c | 72 ++++++++++++++++++++----- 2 files changed, 60 insertions(+), 14 deletions(-) diff --git a/drivers/bus/fslmc/portal/dpaa2_hw_pvt.h b/drivers/bus/fslmc/portal/dpaa2_hw_pvt.h index 5087f68c6..d28c7159f 100644 --- a/drivers/bus/fslmc/portal/dpaa2_hw_pvt.h +++ b/drivers/bus/fslmc/portal/dpaa2_hw_pvt.h @@ -59,6 +59,8 @@ #define DPAA2_SWP_CINH_REGION 1 #define DPAA2_SWP_CENA_MEM_REGION 2 +#define DPAA2_MAX_TX_RETRY_COUNT 10000 + #define MC_PORTAL_INDEX 0 #define NUM_DPIO_REGIONS 2 #define NUM_DQS_PER_QUEUE 2 diff --git a/drivers/net/dpaa2/dpaa2_rxtx.c b/drivers/net/dpaa2/dpaa2_rxtx.c index b7b2d8652..52d913d9e 100644 --- a/drivers/net/dpaa2/dpaa2_rxtx.c +++ b/drivers/net/dpaa2/dpaa2_rxtx.c @@ -1135,15 +1135,28 @@ dpaa2_dev_tx(void *queue, struct rte_mbuf **bufs, uint16_t nb_pkts) #endif bufs++; } + loop = 0; + retry_count = 0; while (loop < frames_to_send) { - loop += qbman_swp_enqueue_multiple(swp, &eqdesc, + ret = qbman_swp_enqueue_multiple(swp, &eqdesc, &fd_arr[loop], &flags[loop], frames_to_send - loop); + if (unlikely(ret < 0)) { + retry_count++; + if (retry_count > DPAA2_MAX_TX_RETRY_COUNT) { + num_tx += loop; + nb_pkts -= loop; + goto send_n_return; + } + } else { + loop += ret; + retry_count = 0; + } } - num_tx += frames_to_send; - nb_pkts -= frames_to_send; + num_tx += loop; + nb_pkts -= loop; } dpaa2_q->tx_pkts += num_tx; return num_tx; @@ -1153,13 +1166,22 @@ dpaa2_dev_tx(void *queue, struct rte_mbuf **bufs, uint16_t nb_pkts) if (loop) { unsigned int i = 0; + retry_count = 0; while (i < loop) { - i += qbman_swp_enqueue_multiple(swp, &eqdesc, - &fd_arr[i], - &flags[loop], - loop - i); + ret = qbman_swp_enqueue_multiple(swp, &eqdesc, + &fd_arr[i], + &flags[i], + loop - i); + if (unlikely(ret < 0)) { + retry_count++; + if (retry_count > DPAA2_MAX_TX_RETRY_COUNT) + break; + } else { + i += ret; + retry_count = 0; + } } - num_tx += loop; + num_tx += i; } skip_tx: dpaa2_q->tx_pkts += num_tx; @@ -1365,15 +1387,28 @@ dpaa2_dev_tx_ordered(void *queue, struct rte_mbuf **bufs, uint16_t nb_pkts) } bufs++; } + loop = 0; + retry_count = 0; while (loop < frames_to_send) { - loop += qbman_swp_enqueue_multiple_desc(swp, + ret = qbman_swp_enqueue_multiple_desc(swp, &eqdesc[loop], &fd_arr[loop], frames_to_send - loop); + if (unlikely(ret < 0)) { + retry_count++; + if (retry_count > DPAA2_MAX_TX_RETRY_COUNT) { + num_tx += loop; + nb_pkts -= loop; + goto send_n_return; + } + } else { + loop += ret; + retry_count = 0; + } } - num_tx += frames_to_send; - nb_pkts -= frames_to_send; + num_tx += loop; + nb_pkts -= loop; } dpaa2_q->tx_pkts += num_tx; return num_tx; @@ -1383,11 +1418,20 @@ dpaa2_dev_tx_ordered(void *queue, struct rte_mbuf **bufs, uint16_t nb_pkts) if (loop) { unsigned int i = 0; + retry_count = 0; while (i < loop) { - i += qbman_swp_enqueue_multiple_desc(swp, &eqdesc[loop], - &fd_arr[i], loop - i); + ret = qbman_swp_enqueue_multiple_desc(swp, + &eqdesc[loop], &fd_arr[i], loop - i); + if (unlikely(ret < 0)) { + retry_count++; + if (retry_count > DPAA2_MAX_TX_RETRY_COUNT) + break; + } else { + i += ret; + retry_count = 0; + } } - num_tx += loop; + num_tx += i; } skip_tx: dpaa2_q->tx_pkts += num_tx; From patchwork Thu Oct 17 12:43:59 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Nipun Gupta X-Patchwork-Id: 61388 X-Patchwork-Delegate: thomas@monjalon.net Return-Path: X-Original-To: patchwork@dpdk.org Delivered-To: patchwork@dpdk.org Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 56B571E9BF; Thu, 17 Oct 2019 15:00:04 +0200 (CEST) Received: from inva020.nxp.com (inva020.nxp.com [92.121.34.13]) by dpdk.org (Postfix) with ESMTP id 5ECFF1E979; Thu, 17 Oct 2019 14:59:53 +0200 (CEST) Received: from inva020.nxp.com (localhost [127.0.0.1]) by inva020.eu-rdc02.nxp.com (Postfix) with ESMTP id F1A191A067A; Thu, 17 Oct 2019 14:59:52 +0200 (CEST) Received: from invc005.ap-rdc01.nxp.com (invc005.ap-rdc01.nxp.com [165.114.16.14]) by inva020.eu-rdc02.nxp.com (Postfix) with ESMTP id E39E31A0660; Thu, 17 Oct 2019 14:59:49 +0200 (CEST) Received: from GDB1.ap.freescale.net (gdb1.ap.freescale.net [10.232.132.179]) by invc005.ap-rdc01.nxp.com (Postfix) with ESMTP id 198D54031D; Thu, 17 Oct 2019 20:59:46 +0800 (SGT) From: Nipun Gupta To: dev@dpdk.org Cc: ferruh.yigit@intel.com, hemant.agrawal@nxp.com, sachin.saxena@nxp.com, stable@dpdk.org, Nipun Gupta Date: Thu, 17 Oct 2019 18:13:59 +0530 Message-Id: <20191017124403.26734-6-nipun.gupta@nxp.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20191017124403.26734-1-nipun.gupta@nxp.com> References: <20191011054657.21931-1-nipun.gupta@nxp.com> <20191017124403.26734-1-nipun.gupta@nxp.com> X-Virus-Scanned: ClamAV using ClamSMTP Subject: [dpdk-dev] [PATCH 5/9 v2] raw/dpaa2_qdma: add retry and timeout in packet enqueue API X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" This patch adds the logic in the DPAA2 QDMA packet enqueue API Fixes: 4d9a3f2a0159 ("raw/dpaa2_qdma: support RBP mode") Cc: stable@dpdk.org Signed-off-by: Nipun Gupta Acked-by: Hemant Agrawal --- drivers/raw/dpaa2_qdma/dpaa2_qdma.c | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/drivers/raw/dpaa2_qdma/dpaa2_qdma.c b/drivers/raw/dpaa2_qdma/dpaa2_qdma.c index a391913b0..af678273d 100644 --- a/drivers/raw/dpaa2_qdma/dpaa2_qdma.c +++ b/drivers/raw/dpaa2_qdma/dpaa2_qdma.c @@ -541,13 +541,21 @@ dpdmai_dev_enqueue_multi(struct dpaa2_dpdmai_dev *dpdmai_dev, } /* Enqueue the packet to the QBMAN */ - uint32_t enqueue_loop = 0; + uint32_t enqueue_loop = 0, retry_count = 0; while (enqueue_loop < loop) { - enqueue_loop += qbman_swp_enqueue_multiple(swp, + ret = qbman_swp_enqueue_multiple(swp, &eqdesc, &fd[enqueue_loop], NULL, loop - enqueue_loop); + if (unlikely(ret < 0)) { + retry_count++; + if (retry_count > DPAA2_MAX_TX_RETRY_COUNT) + return num_tx - (loop - enqueue_loop); + } else { + enqueue_loop += ret; + retry_count = 0; + } } nb_jobs -= loop; } From patchwork Thu Oct 17 12:44:00 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Nipun Gupta X-Patchwork-Id: 61390 X-Patchwork-Delegate: thomas@monjalon.net Return-Path: X-Original-To: patchwork@dpdk.org Delivered-To: patchwork@dpdk.org Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 8D5941E9E6; Thu, 17 Oct 2019 15:00:11 +0200 (CEST) Received: from inva021.nxp.com (inva021.nxp.com [92.121.34.21]) by dpdk.org (Postfix) with ESMTP id 622151E979; Thu, 17 Oct 2019 14:59:54 +0200 (CEST) Received: from inva021.nxp.com (localhost [127.0.0.1]) by inva021.eu-rdc02.nxp.com (Postfix) with ESMTP id 47DC82000C2; Thu, 17 Oct 2019 14:59:54 +0200 (CEST) Received: from invc005.ap-rdc01.nxp.com (invc005.ap-rdc01.nxp.com [165.114.16.14]) by inva021.eu-rdc02.nxp.com (Postfix) with ESMTP id 3933D200674; Thu, 17 Oct 2019 14:59:51 +0200 (CEST) Received: from GDB1.ap.freescale.net (gdb1.ap.freescale.net [10.232.132.179]) by invc005.ap-rdc01.nxp.com (Postfix) with ESMTP id F195A402C7; Thu, 17 Oct 2019 20:59:46 +0800 (SGT) From: Nipun Gupta To: dev@dpdk.org Cc: ferruh.yigit@intel.com, hemant.agrawal@nxp.com, sachin.saxena@nxp.com, stable@dpdk.org, Nipun Gupta Date: Thu, 17 Oct 2019 18:14:00 +0530 Message-Id: <20191017124403.26734-7-nipun.gupta@nxp.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20191017124403.26734-1-nipun.gupta@nxp.com> References: <20191011054657.21931-1-nipun.gupta@nxp.com> <20191017124403.26734-1-nipun.gupta@nxp.com> X-Virus-Scanned: ClamAV using ClamSMTP Subject: [dpdk-dev] [PATCH 6/9 v2] raw/dpaa2_cmdif: add retry and timeout in packet enqueue API X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" This patch adds retry in the DPAA2 CMDIF packet enqueue API Fixes: 53c71586c789 ("raw/dpaa2_cmdif: support enqueue/dequeue operations") Cc: stable@dpdk.org Signed-off-by: Nipun Gupta Acked-by: Hemant Agrawal --- drivers/raw/dpaa2_cmdif/dpaa2_cmdif.c | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/drivers/raw/dpaa2_cmdif/dpaa2_cmdif.c b/drivers/raw/dpaa2_cmdif/dpaa2_cmdif.c index 3f42da1fe..ae53114b5 100644 --- a/drivers/raw/dpaa2_cmdif/dpaa2_cmdif.c +++ b/drivers/raw/dpaa2_cmdif/dpaa2_cmdif.c @@ -62,6 +62,7 @@ dpaa2_cmdif_enqueue_bufs(struct rte_rawdev *dev, struct qbman_fd fd; struct qbman_eq_desc eqdesc; struct qbman_swp *swp; + uint32_t retry_count = 0; int ret; RTE_SET_USED(count); @@ -100,11 +101,15 @@ dpaa2_cmdif_enqueue_bufs(struct rte_rawdev *dev, ret = qbman_swp_enqueue_multiple(swp, &eqdesc, &fd, NULL, 1); if (ret < 0 && ret != -EBUSY) DPAA2_CMDIF_ERR("Transmit failure with err: %d\n", ret); - } while (ret == -EBUSY); + retry_count++; + } while ((ret == -EBUSY) && (retry_count < DPAA2_MAX_TX_RETRY_COUNT)); + + if (ret < 0) + return ret; DPAA2_CMDIF_DP_DEBUG("Successfully transmitted a packet\n"); - return 0; + return 1; } static int From patchwork Thu Oct 17 12:44:01 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Nipun Gupta X-Patchwork-Id: 61392 X-Patchwork-Delegate: thomas@monjalon.net Return-Path: X-Original-To: patchwork@dpdk.org Delivered-To: patchwork@dpdk.org Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 5CAF51EA01; Thu, 17 Oct 2019 15:00:18 +0200 (CEST) Received: from inva021.nxp.com (inva021.nxp.com [92.121.34.21]) by dpdk.org (Postfix) with ESMTP id C98161E979; Thu, 17 Oct 2019 14:59:54 +0200 (CEST) Received: from inva021.nxp.com (localhost [127.0.0.1]) by inva021.eu-rdc02.nxp.com (Postfix) with ESMTP id AE7D520067C; Thu, 17 Oct 2019 14:59:54 +0200 (CEST) Received: from invc005.ap-rdc01.nxp.com (invc005.ap-rdc01.nxp.com [165.114.16.14]) by inva021.eu-rdc02.nxp.com (Postfix) with ESMTP id A00F820067B; Thu, 17 Oct 2019 14:59:51 +0200 (CEST) Received: from GDB1.ap.freescale.net (gdb1.ap.freescale.net [10.232.132.179]) by invc005.ap-rdc01.nxp.com (Postfix) with ESMTP id D42A740305; Thu, 17 Oct 2019 20:59:47 +0800 (SGT) From: Nipun Gupta To: dev@dpdk.org Cc: ferruh.yigit@intel.com, hemant.agrawal@nxp.com, sachin.saxena@nxp.com, stable@dpdk.org, Radu Bulie Date: Thu, 17 Oct 2019 18:14:01 +0530 Message-Id: <20191017124403.26734-8-nipun.gupta@nxp.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20191017124403.26734-1-nipun.gupta@nxp.com> References: <20191011054657.21931-1-nipun.gupta@nxp.com> <20191017124403.26734-1-nipun.gupta@nxp.com> X-Virus-Scanned: ClamAV using ClamSMTP Subject: [dpdk-dev] [PATCH 7/9 v2] mempool/dpaa2: panic on endless loop in mbuf release X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" From: Radu Bulie When BMAN is not able to accept more buffers, it could be that there are no FBPR's (internal mem provided to bman) left. Panic in such conditions. Fixes: 5dc43d22b5ad ("mempool/dpaa2: add hardware offloaded mempool") Cc: stable@dpdk.org Signed-off-by: Radu Bulie --- drivers/mempool/dpaa2/dpaa2_hw_mempool.c | 23 +++++++++++++++-------- 1 file changed, 15 insertions(+), 8 deletions(-) diff --git a/drivers/mempool/dpaa2/dpaa2_hw_mempool.c b/drivers/mempool/dpaa2/dpaa2_hw_mempool.c index f26c30b00..7e815a1ce 100644 --- a/drivers/mempool/dpaa2/dpaa2_hw_mempool.c +++ b/drivers/mempool/dpaa2/dpaa2_hw_mempool.c @@ -192,7 +192,7 @@ rte_dpaa2_mbuf_release(struct rte_mempool *pool __rte_unused, struct qbman_release_desc releasedesc; struct qbman_swp *swp; int ret; - int i, n; + int i, n, retry_count; uint64_t bufs[DPAA2_MBUF_MAX_ACQ_REL]; if (unlikely(!DPAA2_PER_LCORE_DPIO)) { @@ -225,9 +225,13 @@ rte_dpaa2_mbuf_release(struct rte_mempool *pool __rte_unused, } /* feed them to bman */ - do { - ret = qbman_swp_release(swp, &releasedesc, bufs, n); - } while (ret == -EBUSY); + retry_count = 0; + while ((ret = qbman_swp_release(swp, &releasedesc, bufs, n)) == + -EBUSY) { + retry_count++; + if (retry_count > DPAA2_MAX_TX_RETRY_COUNT) + rte_panic("bman release retry exceeded, low fbpr?\n"); + } aligned: /* if there are more buffers to free */ @@ -243,10 +247,13 @@ rte_dpaa2_mbuf_release(struct rte_mempool *pool __rte_unused, #endif } - do { - ret = qbman_swp_release(swp, &releasedesc, bufs, - DPAA2_MBUF_MAX_ACQ_REL); - } while (ret == -EBUSY); + retry_count = 0; + while ((ret = qbman_swp_release(swp, &releasedesc, bufs, + DPAA2_MBUF_MAX_ACQ_REL)) == -EBUSY) { + retry_count++; + if (retry_count > DPAA2_MAX_TX_RETRY_COUNT) + rte_panic("bman release retry exceeded, low fbpr?\n"); + } n += DPAA2_MBUF_MAX_ACQ_REL; } } From patchwork Thu Oct 17 12:44:02 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Nipun Gupta X-Patchwork-Id: 61391 X-Patchwork-Delegate: thomas@monjalon.net Return-Path: X-Original-To: patchwork@dpdk.org Delivered-To: patchwork@dpdk.org Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 6DBF91E9D1; Thu, 17 Oct 2019 15:00:14 +0200 (CEST) Received: from inva020.nxp.com (inva020.nxp.com [92.121.34.13]) by dpdk.org (Postfix) with ESMTP id 867BA1E9A6 for ; Thu, 17 Oct 2019 14:59:54 +0200 (CEST) Received: from inva020.nxp.com (localhost [127.0.0.1]) by inva020.eu-rdc02.nxp.com (Postfix) with ESMTP id 66C541A0654; Thu, 17 Oct 2019 14:59:54 +0200 (CEST) Received: from invc005.ap-rdc01.nxp.com (invc005.ap-rdc01.nxp.com [165.114.16.14]) by inva020.eu-rdc02.nxp.com (Postfix) with ESMTP id E1CF01A0663; Thu, 17 Oct 2019 14:59:51 +0200 (CEST) Received: from GDB1.ap.freescale.net (gdb1.ap.freescale.net [10.232.132.179]) by invc005.ap-rdc01.nxp.com (Postfix) with ESMTP id AD5354031C; Thu, 17 Oct 2019 20:59:48 +0800 (SGT) From: Nipun Gupta To: dev@dpdk.org Cc: ferruh.yigit@intel.com, hemant.agrawal@nxp.com, sachin.saxena@nxp.com Date: Thu, 17 Oct 2019 18:14:02 +0530 Message-Id: <20191017124403.26734-9-nipun.gupta@nxp.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20191017124403.26734-1-nipun.gupta@nxp.com> References: <20191011054657.21931-1-nipun.gupta@nxp.com> <20191017124403.26734-1-nipun.gupta@nxp.com> X-Virus-Scanned: ClamAV using ClamSMTP Subject: [dpdk-dev] [PATCH 8/9 v2] bus/dpaa: moving qbman global init to bus X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" From: Hemant Agrawal DPAA SEC shall be able to work independent of DPAA ETH driver. This patch moves qbman init to bus, so that any driver can use them even when no eth resources are present or none of the eth devices are probed. Signed-off-by: Hemant Agrawal 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(-) diff --git a/drivers/bus/dpaa/dpaa_bus.c b/drivers/bus/dpaa/dpaa_bus.c index d028ef3be..f27820db3 100644 --- a/drivers/bus/dpaa/dpaa_bus.c +++ b/drivers/bus/dpaa/dpaa_bus.c @@ -561,8 +561,24 @@ rte_dpaa_bus_probe(void) return 0; /* Device list creation is only done once */ - if (!process_once) + if (!process_once) { rte_dpaa_bus_dev_build(); + if (rte_eal_process_type() == RTE_PROC_PRIMARY) { + /* One time load of Qman/Bman drivers */ + ret = qman_global_init(); + if (ret) { + DPAA_PMD_ERR("QMAN initialization failed: %d", + ret); + return ret; + } + ret = bman_global_init(); + if (ret) { + DPAA_PMD_ERR("BMAN initialization failed: %d", + ret); + return ret; + } + } + } process_once = 1; /* If no device present on DPAA bus nothing needs to be done */ @@ -600,7 +616,8 @@ rte_dpaa_bus_probe(void) RTE_DEV_WHITELISTED)) { ret = drv->probe(drv, dev); if (ret) { - DPAA_BUS_ERR("Unable to probe.\n"); + DPAA_BUS_ERR("unable to probe:%s", + dev->name); } else { dev->driver = drv; dev->device.driver = &drv->driver; diff --git a/drivers/bus/dpaa/rte_bus_dpaa_version.map b/drivers/bus/dpaa/rte_bus_dpaa_version.map index 97f4f622d..cf428a54d 100644 --- a/drivers/bus/dpaa/rte_bus_dpaa_version.map +++ b/drivers/bus/dpaa/rte_bus_dpaa_version.map @@ -4,7 +4,6 @@ DPDK_17.11 { bman_acquire; bman_free_pool; bman_get_params; - bman_global_init; bman_new_pool; bman_query_free_buffers; bman_release; @@ -48,7 +47,6 @@ DPDK_17.11 { qman_enqueue_multi; qman_fq_fqid; qman_fq_state; - qman_global_init; qman_init_fq; qman_poll_dqrr; qman_query_fq_np; diff --git a/drivers/crypto/dpaa_sec/dpaa_sec.c b/drivers/crypto/dpaa_sec/dpaa_sec.c index 1e4f55b11..1db9bc381 100644 --- a/drivers/crypto/dpaa_sec/dpaa_sec.c +++ b/drivers/crypto/dpaa_sec/dpaa_sec.c @@ -3050,6 +3050,14 @@ cryptodev_dpaa_sec_probe(struct rte_dpaa_driver *dpaa_drv __rte_unused, } } + if (unlikely(!RTE_PER_LCORE(dpaa_io))) { + retval = rte_dpaa_portal_init((void *)1); + if (retval) { + DPAA_SEC_ERR("Unable to initialize portal"); + return retval; + } + } + /* Invoke PMD device initialization function */ retval = dpaa_sec_dev_init(cryptodev); if (retval == 0) diff --git a/drivers/net/dpaa/dpaa_ethdev.c b/drivers/net/dpaa/dpaa_ethdev.c index caf255d67..16b52b5e1 100644 --- a/drivers/net/dpaa/dpaa_ethdev.c +++ b/drivers/net/dpaa/dpaa_ethdev.c @@ -1576,20 +1576,6 @@ rte_dpaa_probe(struct rte_dpaa_driver *dpaa_drv __rte_unused, } if (!is_global_init && (rte_eal_process_type() == RTE_PROC_PRIMARY)) { - /* One time load of Qman/Bman drivers */ - ret = qman_global_init(); - if (ret) { - DPAA_PMD_ERR("QMAN initialization failed: %d", - ret); - return ret; - } - ret = bman_global_init(); - if (ret) { - DPAA_PMD_ERR("BMAN initialization failed: %d", - ret); - return ret; - } - if (access("/tmp/fmc.bin", F_OK) == -1) { RTE_LOG(INFO, PMD, "* FMC not configured.Enabling default mode\n"); From patchwork Thu Oct 17 12:44:03 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Nipun Gupta X-Patchwork-Id: 61393 X-Patchwork-Delegate: thomas@monjalon.net Return-Path: X-Original-To: patchwork@dpdk.org Delivered-To: patchwork@dpdk.org Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 74CB61EA0D; Thu, 17 Oct 2019 15:00:22 +0200 (CEST) Received: from inva021.nxp.com (inva021.nxp.com [92.121.34.21]) by dpdk.org (Postfix) with ESMTP id 727241E9AB for ; Thu, 17 Oct 2019 14:59:55 +0200 (CEST) Received: from inva021.nxp.com (localhost [127.0.0.1]) by inva021.eu-rdc02.nxp.com (Postfix) with ESMTP id 540BE20067B; Thu, 17 Oct 2019 14:59:55 +0200 (CEST) Received: from invc005.ap-rdc01.nxp.com (invc005.ap-rdc01.nxp.com [165.114.16.14]) by inva021.eu-rdc02.nxp.com (Postfix) with ESMTP id A6DD520011A; Thu, 17 Oct 2019 14:59:52 +0200 (CEST) Received: from GDB1.ap.freescale.net (gdb1.ap.freescale.net [10.232.132.179]) by invc005.ap-rdc01.nxp.com (Postfix) with ESMTP id 5DB324031F; Thu, 17 Oct 2019 20:59:49 +0800 (SGT) From: Nipun Gupta To: dev@dpdk.org Cc: ferruh.yigit@intel.com, hemant.agrawal@nxp.com, sachin.saxena@nxp.com, Shreyansh Jain Date: Thu, 17 Oct 2019 18:14:03 +0530 Message-Id: <20191017124403.26734-10-nipun.gupta@nxp.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20191017124403.26734-1-nipun.gupta@nxp.com> References: <20191011054657.21931-1-nipun.gupta@nxp.com> <20191017124403.26734-1-nipun.gupta@nxp.com> X-Virus-Scanned: ClamAV using ClamSMTP Subject: [dpdk-dev] [PATCH 9/9 v2] bus/fslmc: sanitize device name parsing for clarity X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" From: Shreyansh Jain remove unnecessary dup and free Signed-off-by: Shreyansh Jain --- drivers/bus/fslmc/fslmc_bus.c | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) 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