Skip to contentSkip to conversation

ibmvnic: fix rx buffer tracking and index management in replenish_rx_pool partial success

PATCH Applied Dany Madden 2 participants 2 messages Dec 10, 2020

Subsystems (4)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 ibmvnic: fix rx buffer tracking and index management in replenish_rx_pool partial success

From: "Dwip N. Banerjee" <[email protected]>

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")
---
 drivers/net/ethernet/ibm/ibmvnic.c | 2 ++
 1 file changed, 2 insertions(+)
drivers/net/ethernet/ibm/ibmvnic.c +2 -0
index cb701a6c0712..a2191392ca4f 100644
@@ -398,6 +398,8 @@ static void replenish_rx_pool(struct ibmvnic_adapter *adapter,
 		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
Signature · 1 line
2.18.2
maintainer Applied
#1 lore raw

From: Dany Madden <[email protected]>
Date: Wed, 9 Dec 2020 20:53:31 -0500

Quoted 6 lines

From: "Dwip N. Banerjee" <[email protected]>

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.

Quoted 7 lines

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")

Applied, thanks.