]> git.baikalelectronics.ru Git - kernel.git/commit
ibmvnic: Free and re-allocate scrqs when tx/rx scrqs change
authorNathan Fontenot <nfont@linux.vnet.ibm.com>
Mon, 19 Feb 2018 19:30:31 +0000 (13:30 -0600)
committerDavid S. Miller <davem@davemloft.net>
Wed, 21 Feb 2018 19:20:06 +0000 (14:20 -0500)
commit0b65e1067cb02fc23a628c6d38840abf19a1346b
tree2ac87d42d4e15720ad5e7843cde520d7ff29544a
parentf1e83692dd11875386264a34fcbf1998564fb496
ibmvnic: Free and re-allocate scrqs when tx/rx scrqs change

When the driver resets it is possible that the number of tx/rx
sub-crqs can change. This patch handles this so that the driver does
not try to access non-existent sub-crqs.

The count for releasing sub crqs depends on the adapter state. The
active queue count is not set in probe, so if we are relasing in probe
state we use the request queue count.

Additionally, a parameter is added to release_sub_crqs() so that
we know if the h_call to free the sub-crq needs to be made. In
the reset path we have to do a reset of the main crq, which is
a free followed by a register of the main crq. The free of main
crq results in all of the sub crq's being free'ed. When updating
sub-crq count in the reset path we do not want to h_free the
sub-crqs, they are already free'ed.

Signed-off-by: Nathan Fontenot <nfont@linux.vnet.ibm.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/ethernet/ibm/ibmvnic.c