From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mellanox.co.il (mail-il-dmz.mellanox.com [193.47.165.129]) by dpdk.org (Postfix) with ESMTP id 9F51F322C for ; Fri, 30 Nov 2018 00:14:10 +0100 (CET) Received: from Internal Mail-Server by MTLPINE1 (envelope-from yskoh@mellanox.com) with ESMTPS (AES256-SHA encrypted); 30 Nov 2018 01:20:00 +0200 Received: from scfae-sc-2.mti.labs.mlnx (scfae-sc-2.mti.labs.mlnx [10.101.0.96]) by labmailer.mlnx (8.13.8/8.13.8) with ESMTP id wATNCW7t032075; Fri, 30 Nov 2018 01:14:04 +0200 From: Yongseok Koh To: Andrew Rybchenko Cc: Ivan Malov , dpdk stable Date: Thu, 29 Nov 2018 15:10:49 -0800 Message-Id: <20181129231202.30436-55-yskoh@mellanox.com> X-Mailer: git-send-email 2.11.0 In-Reply-To: <20181129231202.30436-1-yskoh@mellanox.com> References: <20181129231202.30436-1-yskoh@mellanox.com> Subject: [dpdk-stable] patch 'net/sfc: receive prepared packets even in Rx exception case' has been queued to LTS release 17.11.5 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: , X-List-Received-Date: Thu, 29 Nov 2018 23:14:11 -0000 Hi, FYI, your patch has been queued to LTS release 17.11.5 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/01/18. 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. If the code is different (ie: not only metadata diffs), due for example to a change in context or macro names, please double check it. Thanks. Yongseok --- >>From 6cbe58f994f9e35d86d5e37427bc2cdcf14ab266 Mon Sep 17 00:00:00 2001 From: Andrew Rybchenko Date: Wed, 3 Oct 2018 10:03:48 +0100 Subject: [PATCH] net/sfc: receive prepared packets even in Rx exception case [ upstream commit f609ee3f2a32806689e0f1d9d841c97e0409bf55 ] Make sure that number of prepared packets, completed and added Rx ring pointers are reset to zeros on queue purge at stop. Fixes: 638bddc99faa ("net/sfc: implement EF10 native Rx datapath") Signed-off-by: Andrew Rybchenko Reviewed-by: Ivan Malov --- drivers/net/sfc/sfc_ef10_rx.c | 16 +++++++++++----- 1 file changed, 11 insertions(+), 5 deletions(-) diff --git a/drivers/net/sfc/sfc_ef10_rx.c b/drivers/net/sfc/sfc_ef10_rx.c index bd2cbd096..7069c534e 100644 --- a/drivers/net/sfc/sfc_ef10_rx.c +++ b/drivers/net/sfc/sfc_ef10_rx.c @@ -489,11 +489,11 @@ sfc_ef10_recv_pkts(void *rx_queue, struct rte_mbuf **rx_pkts, uint16_t nb_pkts) uint16_t n_rx_pkts; efx_qword_t rx_ev; + n_rx_pkts = sfc_ef10_rx_prepared(rxq, rx_pkts, nb_pkts); + if (unlikely(rxq->flags & (SFC_EF10_RXQ_NOT_RUNNING | SFC_EF10_RXQ_EXCEPTION))) - return 0; - - n_rx_pkts = sfc_ef10_rx_prepared(rxq, rx_pkts, nb_pkts); + goto done; evq_old_read_ptr = rxq->evq_read_ptr; while (n_rx_pkts != nb_pkts && sfc_ef10_rx_get_event(rxq, &rx_ev)) { @@ -513,6 +513,7 @@ sfc_ef10_recv_pkts(void *rx_queue, struct rte_mbuf **rx_pkts, uint16_t nb_pkts) /* It is not a problem if we refill in the case of exception */ sfc_ef10_rx_qrefill(rxq); +done: return n_rx_pkts; } @@ -646,8 +647,9 @@ sfc_ef10_rx_qstart(struct sfc_dp_rxq *dp_rxq, unsigned int evq_read_ptr) { struct sfc_ef10_rxq *rxq = sfc_ef10_rxq_by_dp_rxq(dp_rxq); - rxq->prepared = 0; - rxq->completed = rxq->added = 0; + SFC_ASSERT(rxq->prepared == 0); + SFC_ASSERT(rxq->completed == 0); + SFC_ASSERT(rxq->added == 0); sfc_ef10_rx_qrefill(rxq); @@ -694,12 +696,16 @@ sfc_ef10_rx_qpurge(struct sfc_dp_rxq *dp_rxq) unsigned int i; struct sfc_ef10_rx_sw_desc *rxd; + rxq->prepared = 0; + for (i = rxq->completed; i != rxq->added; ++i) { rxd = &rxq->sw_ring[i & rxq->ptr_mask]; rte_mempool_put(rxq->refill_mb_pool, rxd->mbuf); rxd->mbuf = NULL; } + rxq->completed = rxq->added = 0; + rxq->flags &= ~SFC_EF10_RXQ_STARTED; } -- 2.11.0 --- Diff of the applied patch vs upstream commit (please double-check if non-empty: --- --- - 2018-11-29 15:01:47.669160581 -0800 +++ 0055-net-sfc-receive-prepared-packets-even-in-Rx-exceptio.patch 2018-11-29 15:01:45.132965000 -0800 @@ -1,13 +1,14 @@ -From f609ee3f2a32806689e0f1d9d841c97e0409bf55 Mon Sep 17 00:00:00 2001 +From 6cbe58f994f9e35d86d5e37427bc2cdcf14ab266 Mon Sep 17 00:00:00 2001 From: Andrew Rybchenko Date: Wed, 3 Oct 2018 10:03:48 +0100 Subject: [PATCH] net/sfc: receive prepared packets even in Rx exception case +[ upstream commit f609ee3f2a32806689e0f1d9d841c97e0409bf55 ] + Make sure that number of prepared packets, completed and added Rx ring pointers are reset to zeros on queue purge at stop. Fixes: 638bddc99faa ("net/sfc: implement EF10 native Rx datapath") -Cc: stable@dpdk.org Signed-off-by: Andrew Rybchenko Reviewed-by: Ivan Malov @@ -16,10 +17,10 @@ 1 file changed, 11 insertions(+), 5 deletions(-) diff --git a/drivers/net/sfc/sfc_ef10_rx.c b/drivers/net/sfc/sfc_ef10_rx.c -index 6a5052b93..5c0152d01 100644 +index bd2cbd096..7069c534e 100644 --- a/drivers/net/sfc/sfc_ef10_rx.c +++ b/drivers/net/sfc/sfc_ef10_rx.c -@@ -359,11 +359,11 @@ sfc_ef10_recv_pkts(void *rx_queue, struct rte_mbuf **rx_pkts, uint16_t nb_pkts) +@@ -489,11 +489,11 @@ sfc_ef10_recv_pkts(void *rx_queue, struct rte_mbuf **rx_pkts, uint16_t nb_pkts) uint16_t n_rx_pkts; efx_qword_t rx_ev; @@ -34,7 +35,7 @@ evq_old_read_ptr = rxq->evq_read_ptr; while (n_rx_pkts != nb_pkts && sfc_ef10_rx_get_event(rxq, &rx_ev)) { -@@ -383,6 +383,7 @@ sfc_ef10_recv_pkts(void *rx_queue, struct rte_mbuf **rx_pkts, uint16_t nb_pkts) +@@ -513,6 +513,7 @@ sfc_ef10_recv_pkts(void *rx_queue, struct rte_mbuf **rx_pkts, uint16_t nb_pkts) /* It is not a problem if we refill in the case of exception */ sfc_ef10_rx_qrefill(rxq); @@ -42,7 +43,7 @@ return n_rx_pkts; } -@@ -594,8 +595,9 @@ sfc_ef10_rx_qstart(struct sfc_dp_rxq *dp_rxq, unsigned int evq_read_ptr) +@@ -646,8 +647,9 @@ sfc_ef10_rx_qstart(struct sfc_dp_rxq *dp_rxq, unsigned int evq_read_ptr) { struct sfc_ef10_rxq *rxq = sfc_ef10_rxq_by_dp_rxq(dp_rxq); @@ -54,7 +55,7 @@ sfc_ef10_rx_qrefill(rxq); -@@ -642,12 +644,16 @@ sfc_ef10_rx_qpurge(struct sfc_dp_rxq *dp_rxq) +@@ -694,12 +696,16 @@ sfc_ef10_rx_qpurge(struct sfc_dp_rxq *dp_rxq) unsigned int i; struct sfc_ef10_rx_sw_desc *rxd;