OSDN Git Service

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)
commitd7c0ef36bde03af0d119d895bba4cc0362e79dbb
tree2ac87d42d4e15720ad5e7843cde520d7ff29544a
parentd9043c102e73b9abc01f2120d47ba8195823172a
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