WSL2-Linux-Kernel/drivers/net/ethernet/ibm
Nick Child 1d885efda8 ibmvnic: Free any outstanding tx skbs during scrq reset
[ Upstream commit 49bbeb5719c2f56907d3a9623b47c6c15c2c431d ]

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: 65d6470d13 ("ibmvnic: clean pending indirect buffs during reset")
Signed-off-by: Nick Child <nnac123@linux.ibm.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Sasha Levin <sashal@kernel.org>
2024-07-05 09:14:41 +02:00
..
ehea net: ehea: fix possible memory leak in ehea_register_port() 2022-11-03 23:59:18 +09:00
emac
Kconfig
Makefile
ibmveth.c ibmveth: Remove condition to recompute TCP header checksum. 2023-10-10 21:59:07 +02:00
ibmveth.h
ibmvnic.c ibmvnic: Free any outstanding tx skbs during scrq reset 2024-07-05 09:14:41 +02:00
ibmvnic.h ibmvnic: Allow queueing resets during probe 2022-07-12 16:34:56 +02:00