Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 49bbeb5

Browse files
Nick Childdavem330
authored andcommitted
ibmvnic: Free any outstanding tx skbs during scrq reset
There are 2 types of outstanding tx skb's: Type 1: Packets that are sitting in the drivers ind_buff that are waiting to be batch sent to the NIC. During a device reset, these are freed with a call to ibmvnic_tx_scrq_clean_buffer() Type 2: Packets that have been sent to the NIC and are awaiting a TX completion IRQ. These are free'd during a reset with a call to clean_tx_pools() During any reset which requires us to free the tx irq, ensure that the Type 2 skb references are freed. Since the irq is released, it is impossible for the NIC to inform of any completions. Furthermore, later in the reset process is a call to init_tx_pools() which marks every entry in the tx pool as free (ie not outstanding). So if the driver is to make a call to init_tx_pools(), it must first be sure that the tx pool is empty of skb references. This issue was discovered by observing the following in the logs during EEH testing: TX free map points to untracked skb (tso_pool 0 idx=4) TX free map points to untracked skb (tso_pool 0 idx=5) TX free map points to untracked skb (tso_pool 1 idx=36) Fixes: 65d6470 ("ibmvnic: clean pending indirect buffs during reset") Signed-off-by: Nick Child <[email protected]> Signed-off-by: David S. Miller <[email protected]>
1 parent 2ea8a02 commit 49bbeb5

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

drivers/net/ethernet/ibm/ibmvnic.c

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4061,6 +4061,12 @@ static void release_sub_crqs(struct ibmvnic_adapter *adapter, bool do_h_free)
40614061
adapter->num_active_tx_scrqs = 0;
40624062
}
40634063

4064+
/* Clean any remaining outstanding SKBs
4065+
* we freed the irq so we won't be hearing
4066+
* from them
4067+
*/
4068+
clean_tx_pools(adapter);
4069+
40644070
if (adapter->rx_scrq) {
40654071
for (i = 0; i < adapter->num_active_rx_scrqs; i++) {
40664072
if (!adapter->rx_scrq[i])

0 commit comments

Comments
 (0)