Patch "ibmvnic: Return error code on TX scrq flush fail" has been added to the 6.1-stable tree

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



This is a note to let you know that I've just added the patch titled

    ibmvnic: Return error code on TX scrq flush fail

to the 6.1-stable tree which can be found at:
    http://www.kernel.org/git/?p=linux/kernel/git/stable/stable-queue.git;a=summary

The filename of the patch is:
     ibmvnic-return-error-code-on-tx-scrq-flush-fail.patch
and it can be found in the queue-6.1 subdirectory.

If you, or anyone else, feels it should not be added to the stable tree,
please let <stable@xxxxxxxxxxxxxxx> know about it.



commit 6fe1eb78b481382090dd8b44609a90174898483d
Author: Nick Child <nnac123@xxxxxxxxxxxxx>
Date:   Tue Apr 16 11:41:28 2024 -0500

    ibmvnic: Return error code on TX scrq flush fail
    
    [ Upstream commit 5cb431dcf8048572e9ffc6c30cdbd8832cbe502d ]
    
    In ibmvnic_xmit() if ibmvnic_tx_scrq_flush() returns H_CLOSED then
    it will inform upper level networking functions to disable tx
    queues. H_CLOSED signals that the connection with the vnic server is
    down and a transport event is expected to recover the device.
    
    Previously, ibmvnic_tx_scrq_flush() was hard-coded to return success.
    Therefore, the queues would remain active until ibmvnic_cleanup() is
    called within do_reset().
    
    The problem is that do_reset() depends on the RTNL lock. If several
    ibmvnic devices are resetting then there can be a long wait time until
    the last device can grab the lock. During this time the tx/rx queues
    still appear active to upper level functions.
    
    FYI, we do make a call to netif_carrier_off() outside the RTNL lock but
    its calls to dev_deactivate() are also dependent on the RTNL lock.
    
    As a result, large amounts of retransmissions were observed in a short
    period of time, eventually leading to ETIMEOUT. This was specifically
    seen with HNV devices, likely because of even more RTNL dependencies.
    
    Therefore, ensure the return code of ibmvnic_tx_scrq_flush() is
    propagated to the xmit function to allow for an earlier (and lock-less)
    response to a transport event.
    
    Signed-off-by: Nick Child <nnac123@xxxxxxxxxxxxx>
    Link: https://lore.kernel.org/r/20240416164128.387920-1-nnac123@xxxxxxxxxxxxx
    Signed-off-by: Paolo Abeni <pabeni@xxxxxxxxxx>
    Stable-dep-of: bdf5d13aa05e ("ibmvnic: Don't reference skb after sending to VIOS")
    Signed-off-by: Sasha Levin <sashal@xxxxxxxxxx>

diff --git a/drivers/net/ethernet/ibm/ibmvnic.c b/drivers/net/ethernet/ibm/ibmvnic.c
index 6d17738c1c536..7fe1fefef9934 100644
--- a/drivers/net/ethernet/ibm/ibmvnic.c
+++ b/drivers/net/ethernet/ibm/ibmvnic.c
@@ -2181,7 +2181,7 @@ static int ibmvnic_tx_scrq_flush(struct ibmvnic_adapter *adapter,
 		ibmvnic_tx_scrq_clean_buffer(adapter, tx_scrq);
 	else
 		ind_bufp->index = 0;
-	return 0;
+	return rc;
 }
 
 static netdev_tx_t ibmvnic_xmit(struct sk_buff *skb, struct net_device *netdev)
@@ -2234,7 +2234,9 @@ static netdev_tx_t ibmvnic_xmit(struct sk_buff *skb, struct net_device *netdev)
 		tx_dropped++;
 		tx_send_failed++;
 		ret = NETDEV_TX_OK;
-		ibmvnic_tx_scrq_flush(adapter, tx_scrq);
+		lpar_rc = ibmvnic_tx_scrq_flush(adapter, tx_scrq);
+		if (lpar_rc != H_SUCCESS)
+			goto tx_err;
 		goto out;
 	}
 
@@ -2249,8 +2251,10 @@ static netdev_tx_t ibmvnic_xmit(struct sk_buff *skb, struct net_device *netdev)
 		dev_kfree_skb_any(skb);
 		tx_send_failed++;
 		tx_dropped++;
-		ibmvnic_tx_scrq_flush(adapter, tx_scrq);
 		ret = NETDEV_TX_OK;
+		lpar_rc = ibmvnic_tx_scrq_flush(adapter, tx_scrq);
+		if (lpar_rc != H_SUCCESS)
+			goto tx_err;
 		goto out;
 	}
 




[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux