Skip to contentSkip to conversation

net: vlan: suppress "failed to kill vid" warnings

PATCH RESEND Applied Julian Wiedmann 2 participants 2 messages Feb 17, 2020

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

PATCH RESEND 1/1 net: vlan: suppress "failed to kill vid" warnings

When a real dev unregisters, vlan_device_event() also unregisters all of its vlan interfaces. For each VID this ends up in __vlan_vid_del(), which attempts to remove the VID from the real dev's VLAN filter.

But the unregistering real dev might no longer be able to issue the required IOs, and return an error. Subsequently we raise a noisy warning msg that is not appropriate for this situation: the real dev is being torn down anyway, there shouldn't be any worry about cleanly releasing all of its HW-internal resources.

So to avoid scaring innocent users, suppress this warning when the failed deletion happens on an unregistering device. While at it also convert the raw pr_warn() to a more fitting netdev_warn().

---
 net/8021q/vlan_core.c | 5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)
net/8021q/vlan_core.c +2 -3
index a313165e7a67..78ec2e1b14d1 100644
@@ -359,9 +359,8 @@ static void __vlan_vid_del(struct vlan_info *vlan_info,
 	int err;
 
 	err = vlan_kill_rx_filter_info(dev, proto, vid);
-	if (err)
-		pr_warn("failed to kill vid %04x/%d for device %s\n",
-			proto, vid, dev->name);
+	if (err && dev->reg_state != NETREG_UNREGISTERING)
+		netdev_warn(dev, "failed to kill vid %04x/%d\n", proto, vid);
 
 	list_del(&vid_info->list);
 	kfree(vid_info);
Signature · 1 line
2.17.1
maintainer Applied
#1 lore raw

From: Julian Wiedmann <[email protected]>
Date: Mon, 17 Feb 2020 13:27:58 +0100

Quoted 10 lines

When a real dev unregisters, vlan_device_event() also unregisters all of its vlan interfaces. For each VID this ends up in __vlan_vid_del(), which attempts to remove the VID from the real dev's VLAN filter.

But the unregistering real dev might no longer be able to issue the required IOs, and return an error. Subsequently we raise a noisy warning msg that is not appropriate for this situation: the real dev is being torn down anyway, there shouldn't be any worry about cleanly releasing all of its HW-internal resources.

Quoted 6 lines

So to avoid scaring innocent users, suppress this warning when the failed deletion happens on an unregistering device. While at it also convert the raw pr_warn() to a more fitting netdev_warn().

Applied, thank you.