distributor: fix handshake synchronization
authorLukasz Wojciechowski <l.wojciechow@partner.samsung.com>
Sat, 17 Oct 2020 03:06:45 +0000 (05:06 +0200)
committerDavid Marchand <david.marchand@redhat.com>
Mon, 19 Oct 2020 08:57:17 +0000 (10:57 +0200)
commitbea84d5592eb2658cf8c36214a9db75d398efa1c
treed6c5aee2ed090a91c4e3c227b09b76a6e3186c3c
parent894080cf8ae4e84d3e078bca8768437f520f715e
distributor: fix handshake synchronization

rte_distributor_return_pkt function which is run on worker cores
must wait for distributor core to clear handshake on retptr64
before using those buffers. While the handshake is set distributor
core controls buffers and any operations on worker side might overwrite
buffers which are unread yet.
Same situation appears in the legacy single distributor. Function
rte_distributor_return_pkt_single shouldn't modify the bufptr64 until
handshake on it is cleared by distributor lcore.

Fixes: 775003ad2f96 ("distributor: add new burst-capable library")
Cc: stable@dpdk.org
Signed-off-by: Lukasz Wojciechowski <l.wojciechow@partner.samsung.com>
Acked-by: David Hunt <david.hunt@intel.com>
Reviewed-by: Honnappa Nagarahalli <honnappa.nagarahalli@arm.com>
lib/librte_distributor/rte_distributor.c
lib/librte_distributor/rte_distributor_single.c