diff mbox series

[net,1/3] ibmvnic: don't stop queue in xmit

Message ID 20211029220316.2003519-1-sukadev@linux.ibm.com (mailing list archive)
State Accepted
Commit 8878e46fcfd46b19964bd90e13b25dd94cbfc9be
Delegated to: Netdev Maintainers
Headers show
Series [net,1/3] ibmvnic: don't stop queue in xmit | expand

Checks

Context Check Description
netdev/cover_letter warning Series does not have a cover letter
netdev/fixes_present success Fixes tag present in non-next series
netdev/patch_count success Link
netdev/tree_selection success Clearly marked for net
netdev/subject_prefix success Link
netdev/cc_maintainers warning 7 maintainers not CCed: mpe@ellerman.id.au benh@kernel.crashing.org tlfalcon@linux.ibm.com linuxppc-dev@lists.ozlabs.org paulus@samba.org davem@davemloft.net kuba@kernel.org
netdev/source_inline success Was 0 now: 0
netdev/verify_signedoff success Signed-off-by tag matches author and committer
netdev/module_param success Was 0 now: 0
netdev/build_32bit success Errors and warnings before: 0 this patch: 0
netdev/kdoc success Errors and warnings before: 0 this patch: 0
netdev/verify_fixes success Fixes tag looks correct
netdev/checkpatch success total: 0 errors, 0 warnings, 0 checks, 8 lines checked
netdev/build_allmodconfig_warn success Errors and warnings before: 0 this patch: 0
netdev/header_inline success No static functions without inline keyword in header files

Commit Message

Sukadev Bhattiprolu Oct. 29, 2021, 10:03 p.m. UTC
If adapter's resetting bit is on, discard the packet but don't stop the
transmit queue - instead leave that to the reset code. With this change,
it is possible that we may get several calls to ibmvnic_xmit() that simply
discard packets and return.

But if we stop the queue here, we might end up doing so just after
__ibmvnic_open() started the queues (during a hard/soft reset) and before
the ->resetting bit was cleared. If that happens, there will be no one to
restart queue and transmissions will be blocked indefinitely.

This can cause a TIMEOUT reset and with auto priority failover enabled,
an unnecessary FAILOVER reset to less favored backing device and then a
FAILOVER back to the most favored backing device. If we hit the window
repeatedly, we can get stuck in a loop of TIMEOUT, FAILOVER, FAILOVER
resets leaving the adapter unusable for extended periods of time.

Fixes: 7f5b030830fe ("ibmvnic: Free skb's in cases of failure in transmit")
Reported-by: Abdul Haleem <abdhalee@in.ibm.com>
Reported-by: Vaishnavi Bhat <vaish123@in.ibm.com>
Signed-off-by: Sukadev Bhattiprolu <sukadev@linux.ibm.com>
---
 drivers/net/ethernet/ibm/ibmvnic.c | 2 --
 1 file changed, 2 deletions(-)

Comments

Dany Madden Oct. 29, 2021, 10:18 p.m. UTC | #1
On 2021-10-29 15:03, Sukadev Bhattiprolu wrote:
> If adapter's resetting bit is on, discard the packet but don't stop the
> transmit queue - instead leave that to the reset code. With this 
> change,
> it is possible that we may get several calls to ibmvnic_xmit() that 
> simply
> discard packets and return.
> 
> But if we stop the queue here, we might end up doing so just after
> __ibmvnic_open() started the queues (during a hard/soft reset) and 
> before
> the ->resetting bit was cleared. If that happens, there will be no one 
> to
> restart queue and transmissions will be blocked indefinitely.
> 
> This can cause a TIMEOUT reset and with auto priority failover enabled,
> an unnecessary FAILOVER reset to less favored backing device and then a
> FAILOVER back to the most favored backing device. If we hit the window
> repeatedly, we can get stuck in a loop of TIMEOUT, FAILOVER, FAILOVER
> resets leaving the adapter unusable for extended periods of time.
> 
> Fixes: 7f5b030830fe ("ibmvnic: Free skb's in cases of failure in 
> transmit")
> Reported-by: Abdul Haleem <abdhalee@in.ibm.com>
> Reported-by: Vaishnavi Bhat <vaish123@in.ibm.com>
> Signed-off-by: Sukadev Bhattiprolu <sukadev@linux.ibm.com>

Reviewed-by: Dany Madden <drt@linux.ibm.com>
patchwork-bot+netdevbpf@kernel.org Nov. 1, 2021, 1:20 p.m. UTC | #2
Hello:

This series was applied to netdev/net.git (master)
by David S. Miller <davem@davemloft.net>:

On Fri, 29 Oct 2021 15:03:14 -0700 you wrote:
> If adapter's resetting bit is on, discard the packet but don't stop the
> transmit queue - instead leave that to the reset code. With this change,
> it is possible that we may get several calls to ibmvnic_xmit() that simply
> discard packets and return.
> 
> But if we stop the queue here, we might end up doing so just after
> __ibmvnic_open() started the queues (during a hard/soft reset) and before
> the ->resetting bit was cleared. If that happens, there will be no one to
> restart queue and transmissions will be blocked indefinitely.
> 
> [...]

Here is the summary with links:
  - [net,1/3] ibmvnic: don't stop queue in xmit
    https://git.kernel.org/netdev/net/c/8878e46fcfd4
  - [net,2/3] ibmvnic: Process crqs after enabling interrupts
    https://git.kernel.org/netdev/net/c/6e20d00158f3
  - [net,3/3] ibmvnic: delay complete()
    https://git.kernel.org/netdev/net/c/6b278c0cb378

You are awesome, thank you!
diff mbox series

Patch

diff --git a/drivers/net/ethernet/ibm/ibmvnic.c b/drivers/net/ethernet/ibm/ibmvnic.c
index 8f17096e614d..a1533979c670 100644
--- a/drivers/net/ethernet/ibm/ibmvnic.c
+++ b/drivers/net/ethernet/ibm/ibmvnic.c
@@ -1914,8 +1914,6 @@  static netdev_tx_t ibmvnic_xmit(struct sk_buff *skb, struct net_device *netdev)
 	ind_bufp = &tx_scrq->ind_buf;
 
 	if (test_bit(0, &adapter->resetting)) {
-		if (!netif_subqueue_stopped(netdev, skb))
-			netif_stop_subqueue(netdev, queue_num);
 		dev_kfree_skb_any(skb);
 
 		tx_send_failed++;