[dpdk-stable] patch 'net/tap: fix blocked Rx packets' has been queued to LTS release 17.11.10

luca.boccassi at gmail.com luca.boccassi at gmail.com
Thu Dec 19 15:33:25 CET 2019


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 e728ce98e6c6ed5990619a6419b74a8a1e77cc29 Mon Sep 17 00:00:00 2001
From: Marcin Smoczynski <marcinx.smoczynski at intel.com>
Date: Mon, 23 Sep 2019 15:22:47 +0200
Subject: [PATCH] net/tap: fix blocked Rx packets

[ upstream commit d070c3413164e3f8f7fa4c4325d7df50a8275f39 ]

When OS sends more packets than are being read with a single
'rte_eth_rx_burst' call, rx packets are getting stucked in the tap pmd
and are unable to receive, because trigger_seen is getting updated
and consecutive calls are not getting any packets.

Do not update trigger_seen unless less than a max number of packets were
received allowing next call to receive the rest.

Remove unnecessary compiler barrier.

Fixes: a0d8e807d9de ("net/tap: add Rx trigger")

Signed-off-by: Marcin Smoczynski <marcinx.smoczynski at intel.com>
Tested-by: Mariusz Drost <mariuszx.drost at intel.com>
Tested-by: Konstantin Ananyev <konstantin.ananyev at intel.com>
Reviewed-by: Keith Wiles <keith.wiles at intel.com>
---
 drivers/net/tap/rte_eth_tap.c | 7 ++++---
 1 file changed, 4 insertions(+), 3 deletions(-)

diff --git a/drivers/net/tap/rte_eth_tap.c b/drivers/net/tap/rte_eth_tap.c
index 220421623b..341a5e00ce 100644
--- a/drivers/net/tap/rte_eth_tap.c
+++ b/drivers/net/tap/rte_eth_tap.c
@@ -308,9 +308,7 @@ pmd_rx_burst(void *queue, struct rte_mbuf **bufs, uint16_t nb_pkts)
 
 	if (trigger == rxq->trigger_seen)
 		return 0;
-	if (trigger)
-		rxq->trigger_seen = trigger;
-	rte_compiler_barrier();
+
 	for (num_rx = 0; num_rx < nb_pkts; ) {
 		struct rte_mbuf *mbuf = rxq->pool;
 		struct rte_mbuf *seg = NULL;
@@ -386,6 +384,9 @@ end:
 	rxq->stats.ipackets += num_rx;
 	rxq->stats.ibytes += num_rx_bytes;
 
+	if (trigger && num_rx < nb_pkts)
+		rxq->trigger_seen = trigger;
+
 	return num_rx;
 }
 
-- 
2.20.1

---
  Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- -	2019-12-19 14:32:28.622902251 +0000
+++ 0058-net-tap-fix-blocked-Rx-packets.patch	2019-12-19 14:32:26.109297904 +0000
@@ -1,8 +1,10 @@
-From d070c3413164e3f8f7fa4c4325d7df50a8275f39 Mon Sep 17 00:00:00 2001
+From e728ce98e6c6ed5990619a6419b74a8a1e77cc29 Mon Sep 17 00:00:00 2001
 From: Marcin Smoczynski <marcinx.smoczynski at intel.com>
 Date: Mon, 23 Sep 2019 15:22:47 +0200
 Subject: [PATCH] net/tap: fix blocked Rx packets
 
+[ upstream commit d070c3413164e3f8f7fa4c4325d7df50a8275f39 ]
+
 When OS sends more packets than are being read with a single
 'rte_eth_rx_burst' call, rx packets are getting stucked in the tap pmd
 and are unable to receive, because trigger_seen is getting updated
@@ -14,7 +16,6 @@
 Remove unnecessary compiler barrier.
 
 Fixes: a0d8e807d9de ("net/tap: add Rx trigger")
-Cc: stable at dpdk.org
 
 Signed-off-by: Marcin Smoczynski <marcinx.smoczynski at intel.com>
 Tested-by: Mariusz Drost <mariuszx.drost at intel.com>
@@ -25,22 +26,21 @@
  1 file changed, 4 insertions(+), 3 deletions(-)
 
 diff --git a/drivers/net/tap/rte_eth_tap.c b/drivers/net/tap/rte_eth_tap.c
-index 922371c295..a13d8d50d7 100644
+index 220421623b..341a5e00ce 100644
 --- a/drivers/net/tap/rte_eth_tap.c
 +++ b/drivers/net/tap/rte_eth_tap.c
-@@ -353,10 +353,8 @@ pmd_rx_burst(void *queue, struct rte_mbuf **bufs, uint16_t nb_pkts)
+@@ -308,9 +308,7 @@ pmd_rx_burst(void *queue, struct rte_mbuf **bufs, uint16_t nb_pkts)
  
  	if (trigger == rxq->trigger_seen)
  		return 0;
 -	if (trigger)
 -		rxq->trigger_seen = trigger;
-+
- 	process_private = rte_eth_devices[rxq->in_port].process_private;
 -	rte_compiler_barrier();
++
  	for (num_rx = 0; num_rx < nb_pkts; ) {
  		struct rte_mbuf *mbuf = rxq->pool;
  		struct rte_mbuf *seg = NULL;
-@@ -433,6 +431,9 @@ end:
+@@ -386,6 +384,9 @@ end:
  	rxq->stats.ipackets += num_rx;
  	rxq->stats.ibytes += num_rx_bytes;
  


More information about the stable mailing list