From: Nelson Escobar Date: Wed, 12 Oct 2016 20:11:28 +0000 (-0700) Subject: net/enic: fix Rx queue index when not using Rx scatter X-Git-Tag: spdx-start~5477 X-Git-Url: http://git.droids-corp.org/?a=commitdiff_plain;h=e8a71c46055a81f7d0b43515ebaf4763a6b419b9;p=dpdk.git net/enic: fix Rx queue index when not using Rx scatter The Rx scatter patch was accidentally setting the index of the secondary receive queue in the primary receive queue's initialization when the secondary receive queue wasn't needed and was disabled. This caused some misleading hardware counters in some situations. Fixes: 856d7ba7ed22 ("net/enic: support scattered Rx") Signed-off-by: Nelson Escobar Reviewed-by: John Daley --- diff --git a/drivers/net/enic/base/vnic_rq.c b/drivers/net/enic/base/vnic_rq.c index 0e700a122f..10a40c1b2d 100644 --- a/drivers/net/enic/base/vnic_rq.c +++ b/drivers/net/enic/base/vnic_rq.c @@ -87,9 +87,11 @@ void vnic_rq_init_start(struct vnic_rq *rq, unsigned int cq_index, iowrite32(0, &rq->ctrl->error_status); iowrite32(fetch_index, &rq->ctrl->fetch_index); iowrite32(posted_index, &rq->ctrl->posted_index); - if (rq->is_sop) - iowrite32(((rq->is_sop << 10) | rq->data_queue_idx), + if (rq->data_queue_enable) + iowrite32(((1 << 10) | rq->data_queue_idx), &rq->ctrl->data_ring); + else + iowrite32(0, &rq->ctrl->data_ring); } void vnic_rq_init(struct vnic_rq *rq, unsigned int cq_index, diff --git a/drivers/net/enic/base/vnic_rq.h b/drivers/net/enic/base/vnic_rq.h index 7d96b0fd3b..f3fd39f767 100644 --- a/drivers/net/enic/base/vnic_rq.h +++ b/drivers/net/enic/base/vnic_rq.h @@ -91,6 +91,7 @@ struct vnic_rq { uint16_t rxst_idx; uint32_t tot_pkts; uint16_t data_queue_idx; + uint8_t data_queue_enable; uint8_t is_sop; uint8_t in_use; struct rte_mbuf *pkt_first_seg; diff --git a/drivers/net/enic/enic_main.c b/drivers/net/enic/enic_main.c index 23bf535e20..e7117c1e70 100644 --- a/drivers/net/enic/enic_main.c +++ b/drivers/net/enic/enic_main.c @@ -640,10 +640,12 @@ int enic_alloc_rq(struct enic *enic, uint16_t queue_idx, if (mbufs_per_pkt > 1) { dev_info(enic, "Rq %u Scatter rx mode in use\n", queue_idx); + rq_sop->data_queue_enable = 1; rq_data->in_use = 1; } else { dev_info(enic, "Rq %u Scatter rx mode not being used\n", queue_idx); + rq_sop->data_queue_enable = 0; rq_data->in_use = 0; }