blob: 3e1074862c940685a4b2804b87ccb9b32d1b332e [file] [log] [blame]
John Lo55bf5c92016-07-04 23:23:32 -04001From 8d336ba9cbcb4832b992201497afe07afcd4f2e1 Mon Sep 17 00:00:00 2001
2From: John Daley <johndale@cisco.com>
3Date: Fri, 1 Jul 2016 12:32:45 -0700
4Subject: [PATCH 19/25] enic: fix Rx queue initialization after restarting a
5 device
6
7If you stop then start a port that had already received some packets,
8the NIC could fetch discriptors from the wrong location. This could
9effectivly reduce the size of the Rx queue by a random amount and
10cause packet drop or reduced performance.
11
12Reset the NIC fetch index to 0 when allocating and posting mbuf
13addresses to the NIC.
14
15Fixes: 947d860c821f ("enic: improve Rx performance")
16
17Signed-off-by: John Daley <johndale@cisco.com>
18Reviewed-by: Nelson Escobar <neescoba@cisco.com>
19---
20 drivers/net/enic/enic_main.c | 1 +
21 1 file changed, 1 insertion(+)
22
23diff --git a/drivers/net/enic/enic_main.c b/drivers/net/enic/enic_main.c
24index be17707..68532d3 100644
25--- a/drivers/net/enic/enic_main.c
26+++ b/drivers/net/enic/enic_main.c
27@@ -346,6 +346,7 @@ enic_alloc_rx_queue_mbufs(struct enic *enic, struct vnic_rq *rq)
28 dev_debug(enic, "port=%u, qidx=%u, Write %u posted idx, %u sw held\n",
29 enic->port_id, rq->index, rq->posted_index, rq->rx_nb_hold);
30 iowrite32(rq->posted_index, &rq->ctrl->posted_index);
31+ iowrite32(0, &rq->ctrl->fetch_index);
32 rte_rmb();
33
34 // printf("posted %d buffers to %s rq\n", rq->ring.desc_count,
35--
362.7.0
37