summaryrefslogtreecommitdiff
path: root/drivers/net/ethernet/ibm
diff options
context:
space:
mode:
authorDwip N. Banerjee <dnbanerg@us.ibm.com>2020-12-10 04:53:31 +0300
committerDavid S. Miller <davem@davemloft.net>2020-12-10 06:06:10 +0300
commitc2af62256e8d6f3c2f72f8678efde75423490c76 (patch)
tree3312dee56efb54304923e0719b436c622aad7ad5 /drivers/net/ethernet/ibm
parent5a40cce20871e9dd5bfebc639069ba9d6f10eecf (diff)
downloadlinux-c2af62256e8d6f3c2f72f8678efde75423490c76.tar.xz
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>
Diffstat (limited to 'drivers/net/ethernet/ibm')
-rw-r--r--drivers/net/ethernet/ibm/ibmvnic.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/drivers/net/ethernet/ibm/ibmvnic.c b/drivers/net/ethernet/ibm/ibmvnic.c
index cb701a6c0712..a2191392ca4f 100644
--- a/drivers/net/ethernet/ibm/ibmvnic.c
+++ b/drivers/net/ethernet/ibm/ibmvnic.c
@@ -398,6 +398,8 @@ failure:
dev_kfree_skb_any(pool->rx_buff[index].skb);
pool->rx_buff[index].skb = NULL;
}
+ adapter->replenish_add_buff_failure += ind_bufp->index;
+ atomic_add(buffers_added, &pool->available);
ind_bufp->index = 0;
if (lpar_rc == H_CLOSED || adapter->failover_pending) {
/* Disable buffer pool replenishment and report carrier off if