From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from dpdk.org (dpdk.org [92.243.14.124]) by inbox.dpdk.org (Postfix) with ESMTP id A9009A04F0 for ; Thu, 19 Dec 2019 15:40:25 +0100 (CET) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 9E4411BFD8; Thu, 19 Dec 2019 15:40:25 +0100 (CET) Received: from mail-wm1-f43.google.com (mail-wm1-f43.google.com [209.85.128.43]) by dpdk.org (Postfix) with ESMTP id AD3BE1BFE3 for ; Thu, 19 Dec 2019 15:40:24 +0100 (CET) Received: by mail-wm1-f43.google.com with SMTP id q9so5688011wmj.5 for ; Thu, 19 Dec 2019 06:40:24 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=EdqFtNKevqUY6+RPu9uILzvaV/W5kcAsY5cBHB+tFXE=; b=TkoevoZ8tckF18jWQUkncdvmUGbproYTlM47TUU1uzbAeSq2QH7KhqXP4nO+SDHJKB lGVV1cFrcC1XctG5iCbK7FWI4mTRpC1CW/ugoRdAcdD82HmpXYqueTvjTOH1mY8YJtnE d/AnOAyZ8fBqpShqUeK18JsjG6RMOrsnRj0fKw5fzWvGaHqSwKn57G075Je67xcSZ+no lQKRR5fHMPJew8WkFNmGSpiAP/sVM2koBJinb4hLqPzm+HTt62+WnkfRUoXYz6QwKbpN os5G9s831BFOQCm9MuB9GNIqckMmGyigl9+rpySeU80ROBEewjnPmEZLn6aaA0hyJUqg MrQg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=EdqFtNKevqUY6+RPu9uILzvaV/W5kcAsY5cBHB+tFXE=; b=qdF5GVn3ymICkoXEsILAKhNjiekzlNHohkGdvz9Uza3MjH/liCNcjvxVv+pONronJg K9/V+srvdrjyfop9rx0sRy22xdHC4IJf5vbslZQ/vPkYa1tpfKl4Ky5ntpc3Usm3NFP5 eItvwHh/jxNF910NwH5I0hQ12ybThH0Moy1xU2RX/kioAA1VGdvSM0YqWmUkUy94+Xtw Gzttpqhawdzqw6cfD1Ua8E2TYrBIACd7a+bX6DPdYjpS4GGjKLsDGCVloEhLbs6+K21d ozJMuwBd8eVAcSOScqV+mH4peq2i6eZlJqulECpH+R8O2d08AGMiiShLuqcRR5/JSogQ HQiA== X-Gm-Message-State: APjAAAWbh3mVnn17ZDveLxx2RX6OMsUKhFarC2p+m7qg7bPa8cSgXgHR hnkeIiJ4d//yTaqYXF6qSa0= X-Google-Smtp-Source: APXvYqz3o83jfFieBugiYSWywsIVt/17HkVg3KToyPl/rGBfD1qO/Fad0C2zV2kHTbTLmarDI66Y+w== X-Received: by 2002:a7b:cd0a:: with SMTP id f10mr10908237wmj.56.1576766424363; Thu, 19 Dec 2019 06:40:24 -0800 (PST) Received: from localhost ([88.98.246.218]) by smtp.gmail.com with ESMTPSA id z8sm6605839wrq.22.2019.12.19.06.40.23 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 19 Dec 2019 06:40:23 -0800 (PST) From: luca.boccassi@gmail.com To: Nipun Gupta Cc: Radu Bulie , dpdk stable Date: Thu, 19 Dec 2019 14:34:05 +0000 Message-Id: <20191219143447.21506-98-luca.boccassi@gmail.com> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20191219143447.21506-1-luca.boccassi@gmail.com> References: <20191219143447.21506-1-luca.boccassi@gmail.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Subject: [dpdk-stable] patch 'net/dpaa2: add retry and timeout in packet enqueue API' has been queued to LTS release 17.11.10 X-BeenThere: stable@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: patches for DPDK stable branches List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: stable-bounces@dpdk.org Sender: "stable" Hi, FYI, your patch has been queued to LTS release 17.11.10 Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet. It will be pushed if I get no objections before 12/21/19. So please shout if anyone has objections. Also note that after the patch there's a diff of the upstream commit vs the patch applied to the branch. This will indicate if there was any rebasing needed to apply to the stable branch. If there were code changes for rebasing (ie: not only metadata diffs), please double check that the rebase was correctly done. Thanks. Luca Boccassi --- >From 78ffee310f5b56511603de118258819e2b255f45 Mon Sep 17 00:00:00 2001 From: Nipun Gupta Date: Tue, 5 Nov 2019 19:53:16 +0530 Subject: [PATCH] net/dpaa2: add retry and timeout in packet enqueue API [ upstream commit ce4fd609b4d7724533ccf9eb8b667afadc5a1687 ] 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") 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 | 36 ++++++++++++++++++++----- 2 files changed, 31 insertions(+), 7 deletions(-) diff --git a/drivers/bus/fslmc/portal/dpaa2_hw_pvt.h b/drivers/bus/fslmc/portal/dpaa2_hw_pvt.h index ece1a7d432..4f7e49cc3c 100644 --- a/drivers/bus/fslmc/portal/dpaa2_hw_pvt.h +++ b/drivers/bus/fslmc/portal/dpaa2_hw_pvt.h @@ -63,6 +63,8 @@ #define DPAA2_DQRR_RING_SIZE 16 /** 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; - dpaa2_q->tx_pkts += frames_to_send; - nb_pkts -= frames_to_send; + num_tx += loop; + dpaa2_q->tx_pkts += loop; + nb_pkts -= loop; } return num_tx; @@ -653,12 +666,21 @@ send_n_return: if (loop) { unsigned int i = 0; + retry_count = 0; while (i < loop) { - i += qbman_swp_enqueue_multiple(swp, &eqdesc, + ret = qbman_swp_enqueue_multiple(swp, &eqdesc, &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; - dpaa2_q->tx_pkts += loop; + num_tx += i; + dpaa2_q->tx_pkts += i; } skip_tx: return num_tx; -- 2.20.1 --- Diff of the applied patch vs upstream commit (please double-check if non-empty: --- --- - 2019-12-19 14:32:30.234433702 +0000 +++ 0098-net-dpaa2-add-retry-and-timeout-in-packet-enqueue-AP.patch 2019-12-19 14:32:26.229300284 +0000 @@ -1,8 +1,10 @@ -From ce4fd609b4d7724533ccf9eb8b667afadc5a1687 Mon Sep 17 00:00:00 2001 +From 78ffee310f5b56511603de118258819e2b255f45 Mon Sep 17 00:00:00 2001 From: Nipun Gupta Date: Tue, 5 Nov 2019 19:53:16 +0530 Subject: [PATCH] net/dpaa2: add retry and timeout in packet enqueue API +[ upstream commit ce4fd609b4d7724533ccf9eb8b667afadc5a1687 ] + 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 @@ -10,22 +12,21 @@ 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(-) + drivers/bus/fslmc/portal/dpaa2_hw_pvt.h | 2 ++ + drivers/net/dpaa2/dpaa2_rxtx.c | 36 ++++++++++++++++++++----- + 2 files changed, 31 insertions(+), 7 deletions(-) diff --git a/drivers/bus/fslmc/portal/dpaa2_hw_pvt.h b/drivers/bus/fslmc/portal/dpaa2_hw_pvt.h -index db6dad5444..4ed82f5749 100644 +index ece1a7d432..4f7e49cc3c 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 +@@ -63,6 +63,8 @@ + #define DPAA2_DQRR_RING_SIZE 16 + /** DPAA2_MAX_TX_RETRY_COUNT) { @@ -62,26 +62,23 @@ } - num_tx += frames_to_send; +- dpaa2_q->tx_pkts += frames_to_send; - nb_pkts -= frames_to_send; + num_tx += loop; ++ dpaa2_q->tx_pkts += loop; + nb_pkts -= loop; } - dpaa2_q->tx_pkts += num_tx; return num_tx; -@@ -1153,13 +1166,22 @@ send_n_return: + +@@ -653,12 +666,21 @@ send_n_return: 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); + &fd_arr[i], loop - i); + if (unlikely(ret < 0)) { + retry_count++; + if (retry_count > DPAA2_MAX_TX_RETRY_COUNT) @@ -92,66 +89,12 @@ + } } - num_tx += loop; +- dpaa2_q->tx_pkts += loop; + num_tx += i; ++ dpaa2_q->tx_pkts += 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 @@ send_n_return: - 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; -- 2.20.1