net/bnxt: fix freeing all VNICs during port stop
authorSomnath Kotur <somnath.kotur@broadcom.com>
Thu, 21 Nov 2019 07:57:40 +0000 (13:27 +0530)
committerFerruh Yigit <ferruh.yigit@intel.com>
Tue, 26 Nov 2019 17:05:15 +0000 (18:05 +0100)
commitb7e5f647e24b52b3f6c73dd3be56f8907abedc70
tree96f7852566492414e8a5205a8622152b05724acd
parentb6d42ce526a460a9dc4c79c680a9f47386b9c382
net/bnxt: fix freeing all VNICs during port stop

Now that vnics are created only as part of the flow creation cmds
and not during init, we cannot rely on iterating only through
'nr_vnics'. We need to sweep all the vnics by using 'max_vnics'
otherwise a vnic with a stale 'rx_queue_cnt' might be left lingering
post a port stop/start operation. This could lead to a segfault.
This change is required because of the recent fix made by commit to
"fix flow creation with non-consecutive group ids".

Fixes: fcdd7210aa1f ("net/bnxt: fix flow creation with non-consecutive group ids")

Signed-off-by: Somnath Kotur <somnath.kotur@broadcom.com>
Reviewed-by: Ajit Khaparde <ajit.khaparde@broadcom.com>
drivers/net/bnxt/bnxt_vnic.c