kni: fix FIFO synchronization
authorPhil Yang <phil.yang@arm.com>
Mon, 8 Oct 2018 09:11:44 +0000 (17:11 +0800)
committerThomas Monjalon <thomas@monjalon.net>
Fri, 26 Oct 2018 16:10:14 +0000 (18:10 +0200)
commit0b05abe7bf9a46915bc1823753fc29c0a7b99ed1
tree453610ed1f481320e6d4e5421175e0251ad2f50e
parentede56cc18dba2db0d261b15815063394dcb2035a
kni: fix FIFO synchronization

With existing code in kni_fifo_put, rx_q values are not being updated
before updating fifo_write. While reading rx_q in kni_net_rx_normal,
This is causing the sync issue on other core. The same situation happens
in kni_fifo_get as well.

So syncing the values by adding memory barriers to make sure the values
being synced before updating fifo_write and fifo_read.

Fixes: 3fc5ca2f6352 ("kni: initial import")
Cc: stable@dpdk.org
Signed-off-by: Phil Yang <phil.yang@arm.com>
Reviewed-by: Honnappa Nagarahalli <honnappa.nagarahalli@arm.com>
Reviewed-by: Gavin Hu <gavin.hu@arm.com>
Reviewed-by: Ola Liljedahl <ola.liljedahl@arm.com>
Reviewed-by: Jerin Jacob <jerin.jacob@caviumnetworks.com>
Reviewed-by: Ferruh Yigit <ferruh.yigit@intel.com>
lib/librte_kni/rte_kni_fifo.h