Skip to contentSkip to conversation

tg3: allow ethtool -p to work for NICs in down state

net-next Applied Jon Maxwell 3 participants 3 messages Apr 2, 2019

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

Make tg3 behave like other drivers and let "ethtool -p" identify the NIC even when it's in the DOWN state. Before this patch it would get an error as follows if the NIC was down:

# ip link set down dev em4
# ethtool -p em4
Cannot identify NIC: Resource temporarily unavailable

With this patch ethtool identify works regardless of whether the NIC is up or down as it does for other drivers.

---
 drivers/net/ethernet/broadcom/tg3.c | 3 ---
 1 file changed, 3 deletions(-)
drivers/net/ethernet/broadcom/tg3.c +0 -3
index 328373e0578f..3e458394f149 100644
@@ -12763,9 +12763,6 @@ static int tg3_set_phys_id(struct net_device *dev,
 {
 	struct tg3 *tp = netdev_priv(dev);
 
-	if (!netif_running(tp->dev))
-		return -EAGAIN;
-
 	switch (state) {
 	case ETHTOOL_ID_ACTIVE:
 		return 1;	/* cycle on/off once per second */
Signature · 1 line
2.13.6
maintainer Acked-by
#1 lore raw
Quoted 5 lines · Jon Maxwell

Make tg3 behave like other drivers and let "ethtool -p" identify the NIC even when it's in the DOWN state. Before this patch it would get an error as follows if the NIC was down:

Quoted 8 lines
# ip link set down dev em4
# ethtool -p em4
Cannot identify NIC: Resource temporarily unavailable

With this patch ethtool identify works regardless of whether the NIC is up or down as it does for other drivers.

We used to power down the chip in tg3_close() and that's why we cannot do ethtool -p after close. We don't do that any more so this is fine. Thanks.

maintainer Applied
#2 lore raw
In reply to Jon Maxwell

From: Jon Maxwell <[email protected]>
Date: Tue, 2 Apr 2019 16:07:56 +1100

Quoted 4 lines

Make tg3 behave like other drivers and let "ethtool -p" identify the NIC even when it's in the DOWN state. Before this patch it would get an error as follows if the NIC was down:

Quoted 8 lines
# ip link set down dev em4
# ethtool -p em4
Cannot identify NIC: Resource temporarily unavailable

With this patch ethtool identify works regardless of whether the NIC is up or down as it does for other drivers.

Applied, thanks Jon.