* [PATCH net-next] net: vlan: suppress "failed to kill vid" warnings
@ 2020-02-10 12:35 Julian Wiedmann
2020-02-10 13:04 ` David Miller
0 siblings, 1 reply; 4+ messages in thread
From: Julian Wiedmann @ 2020-02-10 12:35 UTC (permalink / raw)
To: David Miller; +Cc: netdev, Julian Wiedmann
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().
Signed-off-by: Julian Wiedmann <jwi@linux.ibm.com>
---
net/8021q/vlan_core.c | 5 ++---
1 file changed, 2 insertions(+), 3 deletions(-)
diff --git a/net/8021q/vlan_core.c b/net/8021q/vlan_core.c
index a313165e7a67..78ec2e1b14d1 100644
--- a/net/8021q/vlan_core.c
+++ b/net/8021q/vlan_core.c
@@ -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);
--
2.17.1
^ permalink raw reply related [flat|nested] 4+ messages in thread
* Re: [PATCH net-next] net: vlan: suppress "failed to kill vid" warnings
2020-02-10 12:35 [PATCH net-next] net: vlan: suppress "failed to kill vid" warnings Julian Wiedmann
@ 2020-02-10 13:04 ` David Miller
2020-02-10 13:15 ` Julian Wiedmann
0 siblings, 1 reply; 4+ messages in thread
From: David Miller @ 2020-02-10 13:04 UTC (permalink / raw)
To: jwi; +Cc: netdev
Please resend this without the <> around the netdev list, I think that
caused it to not make it to the mailing list (and thus patchwork).
Thank you.
^ permalink raw reply [flat|nested] 4+ messages in thread
* [PATCH net-next] net: vlan: suppress "failed to kill vid" warnings
@ 2020-02-10 13:10 Julian Wiedmann
0 siblings, 0 replies; 4+ messages in thread
From: Julian Wiedmann @ 2020-02-10 13:10 UTC (permalink / raw)
To: David Miller; +Cc: netdev, Julian Wiedmann
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().
Signed-off-by: Julian Wiedmann <jwi@linux.ibm.com>
---
net/8021q/vlan_core.c | 5 ++---
1 file changed, 2 insertions(+), 3 deletions(-)
diff --git a/net/8021q/vlan_core.c b/net/8021q/vlan_core.c
index a313165e7a67..78ec2e1b14d1 100644
--- a/net/8021q/vlan_core.c
+++ b/net/8021q/vlan_core.c
@@ -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);
--
2.17.1
^ permalink raw reply related [flat|nested] 4+ messages in thread
* Re: [PATCH net-next] net: vlan: suppress "failed to kill vid" warnings
2020-02-10 13:04 ` David Miller
@ 2020-02-10 13:15 ` Julian Wiedmann
0 siblings, 0 replies; 4+ messages in thread
From: Julian Wiedmann @ 2020-02-10 13:15 UTC (permalink / raw)
To: David Miller; +Cc: netdev
On 10.02.20 14:04, David Miller wrote:
>
> Please resend this without the <> around the netdev list, I think that
> caused it to not make it to the mailing list (and thus patchwork).
>
> Thank you.
>
Done, thanks for the heads-up!
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2020-02-10 13:31 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2020-02-10 12:35 [PATCH net-next] net: vlan: suppress "failed to kill vid" warnings Julian Wiedmann
2020-02-10 13:04 ` David Miller
2020-02-10 13:15 ` Julian Wiedmann
-- strict thread matches above, loose matches on Subject: below --
2020-02-10 13:10 Julian Wiedmann
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox