summaryrefslogtreecommitdiff
path: root/drivers
diff options
context:
space:
mode:
authorJohn Daley <johndale@cisco.com>2016-07-10 14:15:30 -0700
committerThomas Monjalon <thomas.monjalon@6wind.com>2016-07-15 23:37:13 +0200
commit954828b8be39f3b77a1869f0371bc9d759b075de (patch)
treed4f91f129525891fb6fdb46fdeff737da506fc05 /drivers
parent0473ffe33832b8803f2653bc97eaa094b30ee5bb (diff)
downloaddpdk-954828b8be39f3b77a1869f0371bc9d759b075de.zip
dpdk-954828b8be39f3b77a1869f0371bc9d759b075de.tar.gz
dpdk-954828b8be39f3b77a1869f0371bc9d759b075de.tar.xz
net/enic: fix crash when changing number of queues
The check that all Tx and Rx queues were set up was not adequate when reconfiguring with a different number of queues. Only the number of completion queues (CQs) was being used to make the determination, but the CQ array is shared between the underlying Rx and Tx queues. Check that the internal Rx, Tx and CQs are all set up before completing port configuration. Fixes: fefed3d1e62c ("enic: new driver") Signed-off-by: John Daley <johndale@cisco.com> Reviewed-by: Nelson Escobar <neescoba@cisco.com>
Diffstat (limited to 'drivers')
-rw-r--r--drivers/net/enic/enic_ethdev.c14
1 files changed, 13 insertions, 1 deletions
diff --git a/drivers/net/enic/enic_ethdev.c b/drivers/net/enic/enic_ethdev.c
index 3c87b49..21ac48f 100644
--- a/drivers/net/enic/enic_ethdev.c
+++ b/drivers/net/enic/enic_ethdev.c
@@ -142,9 +142,21 @@ static int enicpmd_dev_setup_intr(struct enic *enic)
if (!enic->cq[index].ctrl)
break;
}
-
if (enic->cq_count != index)
return 0;
+ for (index = 0; index < enic->wq_count; index++) {
+ if (!enic->wq[index].ctrl)
+ break;
+ }
+ if (enic->wq_count != index)
+ return 0;
+ /* check start of packet (SOP) RQs only in case scatter is disabled. */
+ for (index = 0; index < enic->rq_count; index++) {
+ if (!enic->rq[enic_sop_rq(index)].ctrl)
+ break;
+ }
+ if (enic->rq_count != index)
+ return 0;
ret = enic_alloc_intr_resources(enic);
if (ret) {