numam-dpdk/examples/multi_process
Stephen Hemminger 6b124806a3 examples/multi_process: fix client crash with sparse ports
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: e2366e74e0 ("examples: use buffered Tx")
Cc: stable@dpdk.org

Signed-off-by: Stephen Hemminger <sthemmin@microsoft.com>
Acked-by: Matan Azrad <matan@mellanox.com>
2019-11-25 23:52:00 +01:00
..
client_server_mp examples/multi_process: fix client crash with sparse ports 2019-11-25 23:52:00 +01:00
hotplug_mp examples/multi_process: build with meson 2019-06-04 12:35:06 +02:00
simple_mp examples/multi_process: build with meson 2019-06-04 12:35:06 +02:00
symmetric_mp examples: check status of getting link info 2019-10-07 15:00:54 +02:00
Makefile examples: detect default build directory 2019-03-30 01:12:15 +01:00