[v1,6/9] net/octeon_ep: fix DMA incompletion
Checks
Commit Message
This patch fixes the DMA incompletion
during packet reads.
Signed-off-by: Sathesh Edara <sedara@marvell.com>
---
drivers/net/octeon_ep/otx_ep_common.h | 8 ++++++++
drivers/net/octeon_ep/otx_ep_rxtx.c | 4 ++++
2 files changed, 12 insertions(+)
@@ -345,6 +345,14 @@ struct otx_ep_droq {
*/
void *pkts_sent_reg;
+ /** Fix for DMA incompletion during pkt reads.
+ * This variable is used to initiate a sent_reg_read
+ * that completes pending dma
+ * this variable is used as lvalue so compiler cannot optimize
+ * the reads.
+ */
+ uint32_t sent_reg_val;
+
/* Statistics for this DROQ. */
struct otx_ep_droq_stats stats;
@@ -917,6 +917,10 @@ otx_ep_droq_read_packet(struct otx_ep_device *otx_ep,
struct rte_mbuf *first_buf = NULL;
struct rte_mbuf *last_buf = NULL;
+ /* csr read helps to flush pending dma */
+ droq->sent_reg_val = rte_read32(droq->pkts_sent_reg);
+ rte_rmb();
+
while (pkt_len < total_pkt_len) {
int cpy_len = 0;