From: John Daley Date: Wed, 29 Jun 2016 23:03:21 +0000 (-0700) Subject: net/enic: fix Rx queue init after restarting a device X-Git-Url: http://git.droids-corp.org/?a=commitdiff_plain;h=04f976899ff1add55c531e72aa06ff954f1093c1;p=dpdk.git net/enic: fix Rx queue init after restarting a device If you stop, then start a port that had already received some packets, the NIC could fetch discriptors from the wrong location. This could effectivly reduce the size of the Rx queue by a random amount and cause packet drop or reduced performance. Reset the NIC fetch index to 0 when allocating and posting mbuf addresses to the NIC. Fixes: 947d860c821f ("enic: improve Rx performance") Signed-off-by: John Daley Reviewed-by: Nelson Escobar --- diff --git a/drivers/net/enic/enic_main.c b/drivers/net/enic/enic_main.c index dc831b48fb..0475cc17b6 100644 --- a/drivers/net/enic/enic_main.c +++ b/drivers/net/enic/enic_main.c @@ -334,6 +334,7 @@ enic_alloc_rx_queue_mbufs(struct enic *enic, struct vnic_rq *rq) dev_debug(enic, "port=%u, qidx=%u, Write %u posted idx, %u sw held\n", enic->port_id, rq->index, rq->posted_index, rq->rx_nb_hold); iowrite32(rq->posted_index, &rq->ctrl->posted_index); + iowrite32(0, &rq->ctrl->fetch_index); rte_rmb(); return 0;