net/enic: fix crash due to static max number of queues
authorHyong Youb Kim <hyonkim@cisco.com>
Tue, 23 Jan 2018 01:05:28 +0000 (17:05 -0800)
committerFerruh Yigit <ferruh.yigit@intel.com>
Mon, 29 Jan 2018 09:04:28 +0000 (10:04 +0100)
commit6c45c330589d334c4f7b729e61ae30a6acfcc119
tree81758fff82c82f1a08be1edad0aee710477dd14c
parent7d8f6c20cc7cb4b1ab7fecd411faa51664651f3c
net/enic: fix crash due to static max number of queues

ENIC_CQ_MAX, ENIC_WQ_MAX and others are arbitrary values that
prevent the app from using more queues when they are available on
hardware. Remove them and dynamically allocate vnic_cq and such
arrays to accommodate all available hardware queues.

As a side effect of removing ENIC_CQ_MAX, this commit fixes a segfault
that would happen when the app requests more than 16 CQs, because
enic_set_vnic_res() does not consider ENIC_CQ_MAX. For example, the
following command causes a crash.

testpmd -- --rxq=16 --txq=16

Fixes: ce93d3c36db0 ("net/enic: fix resource check failures when bonding devices")
Cc: stable@dpdk.org
Signed-off-by: Hyong Youb Kim <hyonkim@cisco.com>
Reviewed-by: John Daley <johndale@cisco.com>
drivers/net/enic/enic.h
drivers/net/enic/enic_ethdev.c
drivers/net/enic/enic_main.c