ibmvnic: fix rx buffer tracking and index management in replenish_rx_pool partial...
authorDwip N. Banerjee <dnbanerg@us.ibm.com>
Thu, 10 Dec 2020 01:53:31 +0000 (20:53 -0500)
committerDavid S. Miller <davem@davemloft.net>
Thu, 10 Dec 2020 03:06:10 +0000 (19:06 -0800)
commitc2af62256e8d6f3c2f72f8678efde75423490c76
tree3312dee56efb54304923e0719b436c622aad7ad5
parent5a40cce20871e9dd5bfebc639069ba9d6f10eecf
ibmvnic: fix rx buffer tracking and index management in replenish_rx_pool partial success

We observed that in the error case for batched send_subcrq_indirect() the
driver does not account for the partial success case. This caused Linux to
crash when free_map and pool index are inconsistent.

Driver needs to update the rx pools "available" count when some batched
sends worked but an error was encountered as part of the whole operation.
Also track replenish_add_buff_failure for statistic purposes.

Fixes: 4f0b6812e9b9a ("ibmvnic: Introduce batched RX buffer descriptor transmission")
Signed-off-by: Dwip N. Banerjee <dnbanerg@us.ibm.com>
Reviewed-by: Dany Madden <drt@linux.ibm.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/ethernet/ibm/ibmvnic.c