fm10k: use txqueue parameter in fm10k_tx_timeout

Make use of the new txqueue parameter to the .ndo_tx_timeout function.
In fm10k_tx_timeout, remove the now unnecessary loop to determine which
Tx queue is stuck. Instead, just double check the specified queue

This could be improved further to attempt resetting only the specific
queue that got stuck. However, that is a much larger refactor and has
been left as a future improvement.

Signed-off-by: Jacob Keller <jacob.e.keller@intel.com>
Tested-by: Andrew Bowers <andrewx.bowers@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
This commit is contained in:
Jacob Keller 2019-12-19 12:10:00 -08:00 committed by WeebDataHoarder
parent fd93824053
commit 64f0da227e

View file

@ -813,7 +813,38 @@ static int fm10k_change_mtu(struct net_device *dev, int new_mtu)
/**
* fm10k_tx_timeout - Respond to a Tx Hang
* @netdev: network interface device structure
* @txqueue: the index of the Tx queue that timed out
**/
#if ( LINUX_VERSION_CODE >= KERNEL_VERSION(5,6,0) )
static void fm10k_tx_timeout(struct net_device *netdev, unsigned int txqueue)
{
struct fm10k_intfc *interface = netdev_priv(netdev);
struct fm10k_ring *tx_ring;
bool real_tx_hang = false;
if (txqueue >= interface->num_tx_queues) {
WARN(1, "invalid Tx queue index %d", txqueue);
return;
}
tx_ring = interface->tx_ring[txqueue];
if (check_for_tx_hang(tx_ring) && fm10k_check_tx_hang(tx_ring))
real_tx_hang = true;
#define TX_TIMEO_LIMIT 16000
if (real_tx_hang) {
fm10k_tx_timeout_reset(interface);
} else {
netif_info(interface, drv, netdev,
"Fake Tx hang detected with timeout of %d seconds\n",
netdev->watchdog_timeo / HZ);
/* fake Tx hang - increase the kernel timeout */
if (netdev->watchdog_timeo < TX_TIMEO_LIMIT)
netdev->watchdog_timeo *= 2;
}
}
#else
static void fm10k_tx_timeout(struct net_device *netdev)
{
struct fm10k_intfc *interface = netdev_priv(netdev);
@ -840,6 +871,8 @@ static void fm10k_tx_timeout(struct net_device *netdev)
netdev->watchdog_timeo *= 2;
}
}
#endif
/**
* fm10k_host_mbx_ready - Check PF interface's mailbox readiness