Skip to content

Commit

Permalink
amd-xgbe: Add support for the netdev Tx watchdog
Browse files Browse the repository at this point in the history
Add support to be able to detect a hung Tx task by adding the netdev
ndo_tx_timeout function callback. Do not set the watchdog_timeo value
so as to use the system default time (currently 5 seconds).

Signed-off-by: Tom Lendacky <thomas.lendacky@amd.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
  • Loading branch information
Lendacky, Thomas authored and David S. Miller committed Apr 9, 2015
1 parent b876382 commit a8373f1
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 0 deletions.
9 changes: 9 additions & 0 deletions drivers/net/ethernet/amd/xgbe/xgbe-drv.c
Original file line number Diff line number Diff line change
Expand Up @@ -1600,6 +1600,14 @@ static int xgbe_change_mtu(struct net_device *netdev, int mtu)
return 0;
}

static void xgbe_tx_timeout(struct net_device *netdev)
{
struct xgbe_prv_data *pdata = netdev_priv(netdev);

netdev_warn(netdev, "tx timeout, device restarting\n");
schedule_work(&pdata->restart_work);
}

static struct rtnl_link_stats64 *xgbe_get_stats64(struct net_device *netdev,
struct rtnl_link_stats64 *s)
{
Expand Down Expand Up @@ -1764,6 +1772,7 @@ static const struct net_device_ops xgbe_netdev_ops = {
.ndo_validate_addr = eth_validate_addr,
.ndo_do_ioctl = xgbe_ioctl,
.ndo_change_mtu = xgbe_change_mtu,
.ndo_tx_timeout = xgbe_tx_timeout,
.ndo_get_stats64 = xgbe_get_stats64,
.ndo_vlan_rx_add_vid = xgbe_vlan_rx_add_vid,
.ndo_vlan_rx_kill_vid = xgbe_vlan_rx_kill_vid,
Expand Down
3 changes: 3 additions & 0 deletions drivers/net/ethernet/amd/xgbe/xgbe-main.c
Original file line number Diff line number Diff line change
Expand Up @@ -491,6 +491,9 @@ static int xgbe_probe(struct platform_device *pdev)

netdev->priv_flags |= IFF_UNICAST_FLT;

/* Use default watchdog timeout */
netdev->watchdog_timeo = 0;

xgbe_init_rx_coalesce(pdata);
xgbe_init_tx_coalesce(pdata);

Expand Down

0 comments on commit a8373f1

Please sign in to comment.