[dpdk-stable] patch 'examples/multi_process: fix client crash with sparse ports' has been queued to LTS release 18.11.6
Kevin Traynor
ktraynor at redhat.com
Wed Dec 11 22:26:41 CET 2019
Hi,
FYI, your patch has been queued to LTS release 18.11.6
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/17/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.
Queued patches are on a temporary branch at:
https://github.com/kevintraynor/dpdk-stable-queue
This queued commit can be viewed at:
https://github.com/kevintraynor/dpdk-stable-queue/commit/f35ffead0d136ca6f7bea1a1d90095931ffab707
Thanks.
Kevin.
---
>From f35ffead0d136ca6f7bea1a1d90095931ffab707 Mon Sep 17 00:00:00 2001
From: Stephen Hemminger <sthemmin at microsoft.com>
Date: Mon, 5 Aug 2019 09:38:17 -0700
Subject: [PATCH] examples/multi_process: fix client crash with sparse ports
[ upstream commit 6b124806a3181855fed969d0ad8520831ae0d7e2 ]
The mp_client crashes if run on Azure or any system where ethdev
ports are owned. In that case, the tx_buffer and tx_stats for the
real port were initialized correctly, but the wrong port was used.
For example if the server has Ports 3 and 5. Then calling
rte_eth_tx_buffer_flush on any other buffer will dereference null
because the tx buffer for that port was not allocated.
Also:
- the flush code is common enough that it should not be marked
unlikely
- combine conditions to reduce indentation
- avoid unnecessary if() if sent is zero.
Fixes: e2366e74e029 ("examples: use buffered Tx")
Signed-off-by: Stephen Hemminger <sthemmin at microsoft.com>
Acked-by: Matan Azrad <matan at mellanox.com>
---
.../client_server_mp/mp_client/client.c | 18 +++++++++---------
1 file changed, 9 insertions(+), 9 deletions(-)
diff --git a/examples/multi_process/client_server_mp/mp_client/client.c b/examples/multi_process/client_server_mp/mp_client/client.c
index c23dd3f37..361d90b54 100644
--- a/examples/multi_process/client_server_mp/mp_client/client.c
+++ b/examples/multi_process/client_server_mp/mp_client/client.c
@@ -247,17 +247,17 @@ main(int argc, char *argv[])
for (;;) {
uint16_t i, rx_pkts;
- uint16_t port;
rx_pkts = rte_ring_dequeue_burst(rx_ring, pkts,
PKT_READ_SIZE, NULL);
- if (unlikely(rx_pkts == 0)){
- if (need_flush)
- for (port = 0; port < ports->num_ports; port++) {
- sent = rte_eth_tx_buffer_flush(ports->id[port], client_id,
- tx_buffer[port]);
- if (unlikely(sent))
- tx_stats->tx[port] += sent;
- }
+ if (rx_pkts == 0 && need_flush) {
+ for (i = 0; i < ports->num_ports; i++) {
+ uint16_t port = ports->id[i];
+
+ sent = rte_eth_tx_buffer_flush(port,
+ client_id,
+ tx_buffer[port]);
+ tx_stats->tx[port] += sent;
+ }
need_flush = 0;
continue;
--
2.21.0
---
Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- - 2019-12-11 21:24:16.579724700 +0000
+++ 0049-examples-multi_process-fix-client-crash-with-sparse-.patch 2019-12-11 21:24:12.708650370 +0000
@@ -1 +1 @@
-From 6b124806a3181855fed969d0ad8520831ae0d7e2 Mon Sep 17 00:00:00 2001
+From f35ffead0d136ca6f7bea1a1d90095931ffab707 Mon Sep 17 00:00:00 2001
@@ -5,0 +6,2 @@
+[ upstream commit 6b124806a3181855fed969d0ad8520831ae0d7e2 ]
+
@@ -21 +22,0 @@
-Cc: stable at dpdk.org
More information about the stable
mailing list