From a6eb5997664cb2176461f27fd26a32adc86b2afd Mon Sep 17 00:00:00 2001
From: Ido Segev <idose@amazon.com>
Date: Tue, 26 Jan 2021 19:32:22 +0100
Subject: [PATCH 077/107] net/ena: flush Rx buffers memory pool cache

As the refill called as part of ena_start(), we end up the refill
progress with stuck buffers at the caller core cache.

Calling to flush the cache results with invalidate this cache and free
those stuck buffers.

Fixes: 1173fca25af9 ("ena: add polling-mode driver")
Cc: stable@dpdk.org

Signed-off-by: Ido Segev <idose@amazon.com>
Reviewed-by: Michal Krawczyk <mk@semihalf.com>
Reviewed-by: Igor Chauskin <igorch@amazon.com>
---
 drivers/net/ena/ena_ethdev.c | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/drivers/net/ena/ena_ethdev.c b/drivers/net/ena/ena_ethdev.c
index 7040c7160f..0ac578df27 100644
--- a/drivers/net/ena/ena_ethdev.c
+++ b/drivers/net/ena/ena_ethdev.c
@@ -1254,6 +1254,10 @@ static int ena_queue_start(struct ena_ring *ring)
 		PMD_INIT_LOG(ERR, "Failed to populate rx ring !");
 		return ENA_COM_FAULT;
 	}
+	/* Flush per-core RX buffers pools cache as they can be used on other
+	 * cores as well.
+	 */
+	rte_mempool_cache_flush(NULL, ring->mb_pool);
 
 	return 0;
 }
-- 
2.25.1

