[dpdk-dev] [PATCH v2] kni: fix kni Rx fifo producer synchronization
Kiran Kumar
kkokkilagadda at caviumnetworks.com
Thu Aug 16 11:55:17 CEST 2018
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. So adding a write
barrier to make sure the values being synced before updating fifo_write.
Fixes: 3fc5ca2f6352 ("kni: initial import")
Signed-off-by: Kiran Kumar <kkokkilagadda at caviumnetworks.com>
Acked-by: Jerin Jacob <jerin.jacob at caviumnetworks.com>
---
v2 changes:
- Changed rx in headline
lib/librte_kni/rte_kni_fifo.h | 1 +
1 file changed, 1 insertion(+)
diff --git a/lib/librte_kni/rte_kni_fifo.h b/lib/librte_kni/rte_kni_fifo.h
index ac26a8c..4d6b33e 100644
--- a/lib/librte_kni/rte_kni_fifo.h
+++ b/lib/librte_kni/rte_kni_fifo.h
@@ -39,6 +39,7 @@ kni_fifo_put(struct rte_kni_fifo *fifo, void **data, unsigned num)
fifo->buffer[fifo_write] = data[i];
fifo_write = new_write;
}
+ rte_smp_wmb();
fifo->write = fifo_write;
return i;
}
--
2.7.4
More information about the dev
mailing list