Skip to content

Commit 526f28b

Browse files
vbnogueiradavem330
authored andcommitted
net/sched: act_mirred: Add carrier check
There are cases where the device is adminstratively UP, but operationally down. For example, we have a physical device (Nvidia ConnectX-6 Dx, 25Gbps) who's cable was pulled out, here is its ip link output: 5: ens2f1: <NO-CARRIER,BROADCAST,MULTICAST,UP> mtu 1500 qdisc mq state DOWN mode DEFAULT group default qlen 1000 link/ether b8:ce:f6:4b:68:35 brd ff:ff:ff:ff:ff:ff altname enp179s0f1np1 As you can see, it's administratively UP but operationally down. In this case, sending a packet to this port caused a nasty kernel hang (so nasty that we were unable to capture it). Aborting a transmit based on operational status (in addition to administrative status) fixes the issue. Fixes: 1da177e ("Linux-2.6.12-rc2") Acked-by: Jamal Hadi Salim <[email protected]> Signed-off-by: Victor Nogueira <[email protected]> v1->v2: Add fixes tag v2->v3: Remove blank line between tags + add change log, suggested by Leon Signed-off-by: David S. Miller <[email protected]>
1 parent 6686317 commit 526f28b

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

net/sched/act_mirred.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -264,7 +264,7 @@ TC_INDIRECT_SCOPE int tcf_mirred_act(struct sk_buff *skb,
264264
goto out;
265265
}
266266

267-
if (unlikely(!(dev->flags & IFF_UP))) {
267+
if (unlikely(!(dev->flags & IFF_UP)) || !netif_carrier_ok(dev)) {
268268
net_notice_ratelimited("tc mirred to Houston: device %s is down\n",
269269
dev->name);
270270
goto out;

0 commit comments

Comments
 (0)