Skip to content

Commit 3387fc2

Browse files
committed
ibmvnic: Return error code on TX scrq flush fail
jira LE-2742 Rebuild_History Non-Buildable kernel-5.14.0-503.35.1.el9_5 commit-author Nick Child <nnac123@linux.ibm.com> commit 5cb431d 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@linux.ibm.com> Link: https://lore.kernel.org/r/20240416164128.387920-1-nnac123@linux.ibm.com Signed-off-by: Paolo Abeni <pabeni@redhat.com> (cherry picked from commit 5cb431d) Signed-off-by: Jonathan Maple <jmaple@ciq.com>
1 parent 535735f commit 3387fc2

File tree

1 file changed

+7
-3
lines changed

1 file changed

+7
-3
lines changed

drivers/net/ethernet/ibm/ibmvnic.c

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2166,7 +2166,7 @@ static int ibmvnic_tx_scrq_flush(struct ibmvnic_adapter *adapter,
21662166
ibmvnic_tx_scrq_clean_buffer(adapter, tx_scrq);
21672167
else
21682168
ind_bufp->index = 0;
2169-
return 0;
2169+
return rc;
21702170
}
21712171

21722172
static netdev_tx_t ibmvnic_xmit(struct sk_buff *skb, struct net_device *netdev)
@@ -2218,7 +2218,9 @@ static netdev_tx_t ibmvnic_xmit(struct sk_buff *skb, struct net_device *netdev)
22182218
tx_dropped++;
22192219
tx_send_failed++;
22202220
ret = NETDEV_TX_OK;
2221-
ibmvnic_tx_scrq_flush(adapter, tx_scrq);
2221+
lpar_rc = ibmvnic_tx_scrq_flush(adapter, tx_scrq);
2222+
if (lpar_rc != H_SUCCESS)
2223+
goto tx_err;
22222224
goto out;
22232225
}
22242226

@@ -2233,8 +2235,10 @@ static netdev_tx_t ibmvnic_xmit(struct sk_buff *skb, struct net_device *netdev)
22332235
dev_kfree_skb_any(skb);
22342236
tx_send_failed++;
22352237
tx_dropped++;
2236-
ibmvnic_tx_scrq_flush(adapter, tx_scrq);
22372238
ret = NETDEV_TX_OK;
2239+
lpar_rc = ibmvnic_tx_scrq_flush(adapter, tx_scrq);
2240+
if (lpar_rc != H_SUCCESS)
2241+
goto tx_err;
22382242
goto out;
22392243
}
22402244

0 commit comments

Comments
 (0)