* [Intel-wired-lan] [PATCH net-next v1 1/2] net/core: print message for allmulticast
2023-02-14 21:01 [Intel-wired-lan] [PATCH net-next v1 0/2] net/core: commmon prints for promisc Jesse Brandeburg
@ 2023-02-14 21:01 ` Jesse Brandeburg
2023-02-14 21:01 ` [Intel-wired-lan] [PATCH net-next v1 2/2] net/core: refactor promiscuous mode message Jesse Brandeburg
2023-02-16 9:40 ` [Intel-wired-lan] [PATCH net-next v1 0/2] net/core: commmon prints for promisc patchwork-bot+netdevbpf
2 siblings, 0 replies; 5+ messages in thread
From: Jesse Brandeburg @ 2023-02-14 21:01 UTC (permalink / raw)
To: kuba, davem, pabeni; +Cc: netdev, edumazet, intel-wired-lan, Jesse Brandeburg
When the user sets or clears the IFF_ALLMULTI flag in the netdev, there are
no log messages printed to the kernel log to indicate anything happened.
This is inexplicably different from most other dev->flags changes, and
could suprise the user.
Typically this occurs from user-space when a user:
ip link set eth0 allmulticast <on|off>
However, other devices like bridge set allmulticast as well, and many
other flows might trigger entry into allmulticast as well.
The new message uses the standard netdev_info print and looks like:
[ 413.246110] ixgbe 0000:17:00.0 eth0: entered allmulticast mode
[ 415.977184] ixgbe 0000:17:00.0 eth0: left allmulticast mode
Signed-off-by: Jesse Brandeburg <jesse.brandeburg@intel.com>
---
net/core/dev.c | 2 ++
1 file changed, 2 insertions(+)
diff --git a/net/core/dev.c b/net/core/dev.c
index 7307a0c15c9f..ad1e6482e1c1 100644
--- a/net/core/dev.c
+++ b/net/core/dev.c
@@ -8391,6 +8391,8 @@ static int __dev_set_allmulti(struct net_device *dev, int inc, bool notify)
}
}
if (dev->flags ^ old_flags) {
+ netdev_info(dev, "%s allmulticast mode\n",
+ dev->flags & IFF_ALLMULTI ? "entered" : "left");
dev_change_rx_flags(dev, IFF_ALLMULTI);
dev_set_rx_mode(dev);
if (notify)
--
2.31.1
_______________________________________________
Intel-wired-lan mailing list
Intel-wired-lan@osuosl.org
https://lists.osuosl.org/mailman/listinfo/intel-wired-lan
^ permalink raw reply related [flat|nested] 5+ messages in thread* [Intel-wired-lan] [PATCH net-next v1 2/2] net/core: refactor promiscuous mode message
2023-02-14 21:01 [Intel-wired-lan] [PATCH net-next v1 0/2] net/core: commmon prints for promisc Jesse Brandeburg
2023-02-14 21:01 ` [Intel-wired-lan] [PATCH net-next v1 1/2] net/core: print message for allmulticast Jesse Brandeburg
@ 2023-02-14 21:01 ` Jesse Brandeburg
2023-02-16 9:10 ` Paolo Abeni
2023-02-16 9:40 ` [Intel-wired-lan] [PATCH net-next v1 0/2] net/core: commmon prints for promisc patchwork-bot+netdevbpf
2 siblings, 1 reply; 5+ messages in thread
From: Jesse Brandeburg @ 2023-02-14 21:01 UTC (permalink / raw)
To: kuba, davem, pabeni; +Cc: netdev, edumazet, intel-wired-lan, Jesse Brandeburg
The kernel stack can be more consistent by printing the IFF_PROMISC
aka promiscuous enable/disable messages with the standard netdev_info
message which can include bus and driver info as well as the device.
typical command usage from user space looks like:
ip link set eth0 promisc <on|off>
But lots of utilities such as bridge, tcpdump, etc put the interface into
promiscuous mode.
old message:
[ 406.034418] device eth0 entered promiscuous mode
[ 408.424703] device eth0 left promiscuous mode
new message:
[ 406.034431] ice 0000:17:00.0 eth0: entered promiscuous mode
[ 408.424715] ice 0000:17:00.0 eth0: left promiscuous mode
Signed-off-by: Jesse Brandeburg <jesse.brandeburg@intel.com>
---
I'm unsure about this one because it's changing a long standard kernel
message to a slightly different format. I think the new way looks better
and has more information.
---
net/core/dev.c | 5 ++---
1 file changed, 2 insertions(+), 3 deletions(-)
diff --git a/net/core/dev.c b/net/core/dev.c
index ad1e6482e1c1..357081b0113c 100644
--- a/net/core/dev.c
+++ b/net/core/dev.c
@@ -8321,9 +8321,8 @@ static int __dev_set_promiscuity(struct net_device *dev, int inc, bool notify)
}
}
if (dev->flags != old_flags) {
- pr_info("device %s %s promiscuous mode\n",
- dev->name,
- dev->flags & IFF_PROMISC ? "entered" : "left");
+ netdev_info(dev, "%s promiscuous mode\n",
+ dev->flags & IFF_PROMISC ? "entered" : "left");
if (audit_enabled) {
current_uid_gid(&uid, &gid);
audit_log(audit_context(), GFP_ATOMIC,
--
2.31.1
_______________________________________________
Intel-wired-lan mailing list
Intel-wired-lan@osuosl.org
https://lists.osuosl.org/mailman/listinfo/intel-wired-lan
^ permalink raw reply related [flat|nested] 5+ messages in thread* Re: [Intel-wired-lan] [PATCH net-next v1 2/2] net/core: refactor promiscuous mode message
2023-02-14 21:01 ` [Intel-wired-lan] [PATCH net-next v1 2/2] net/core: refactor promiscuous mode message Jesse Brandeburg
@ 2023-02-16 9:10 ` Paolo Abeni
0 siblings, 0 replies; 5+ messages in thread
From: Paolo Abeni @ 2023-02-16 9:10 UTC (permalink / raw)
To: Jesse Brandeburg, kuba, davem; +Cc: netdev, edumazet, intel-wired-lan
On Tue, 2023-02-14 at 13:01 -0800, Jesse Brandeburg wrote:
> The kernel stack can be more consistent by printing the IFF_PROMISC
> aka promiscuous enable/disable messages with the standard netdev_info
> message which can include bus and driver info as well as the device.
>
> typical command usage from user space looks like:
> ip link set eth0 promisc <on|off>
>
> But lots of utilities such as bridge, tcpdump, etc put the interface into
> promiscuous mode.
>
> old message:
> [ 406.034418] device eth0 entered promiscuous mode
> [ 408.424703] device eth0 left promiscuous mode
>
> new message:
> [ 406.034431] ice 0000:17:00.0 eth0: entered promiscuous mode
> [ 408.424715] ice 0000:17:00.0 eth0: left promiscuous mode
>
> Signed-off-by: Jesse Brandeburg <jesse.brandeburg@intel.com>
> ---
> I'm unsure about this one because it's changing a long standard kernel
> message to a slightly different format. I think the new way looks better
> and has more information.
I guess the relevant question here is if such kind of messages are
somewhat implicitly part of uAPI.
AFAIK the answer is "no", at least for info-level msg, so the patch
LGTM.
Thanks,
Paolo
_______________________________________________
Intel-wired-lan mailing list
Intel-wired-lan@osuosl.org
https://lists.osuosl.org/mailman/listinfo/intel-wired-lan
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [Intel-wired-lan] [PATCH net-next v1 0/2] net/core: commmon prints for promisc
2023-02-14 21:01 [Intel-wired-lan] [PATCH net-next v1 0/2] net/core: commmon prints for promisc Jesse Brandeburg
2023-02-14 21:01 ` [Intel-wired-lan] [PATCH net-next v1 1/2] net/core: print message for allmulticast Jesse Brandeburg
2023-02-14 21:01 ` [Intel-wired-lan] [PATCH net-next v1 2/2] net/core: refactor promiscuous mode message Jesse Brandeburg
@ 2023-02-16 9:40 ` patchwork-bot+netdevbpf
2 siblings, 0 replies; 5+ messages in thread
From: patchwork-bot+netdevbpf @ 2023-02-16 9:40 UTC (permalink / raw)
To: Jesse Brandeburg; +Cc: netdev, edumazet, intel-wired-lan, kuba, pabeni, davem
Hello:
This series was applied to netdev/net-next.git (master)
by Paolo Abeni <pabeni@redhat.com>:
On Tue, 14 Feb 2023 13:01:15 -0800 you wrote:
> Add a print to the kernel log for allmulticast entry and exit, and
> standardize the print for entry and exit of promiscuous mode.
>
> These prints are useful to both user and developer and should have the
> triggering driver/bus/device info that netdev_info (optionally) gives.
>
> Jesse Brandeburg (2):
> net/core: print message for allmulticast
> net/core: refactor promiscuous mode message
>
> [...]
Here is the summary with links:
- [net-next,v1,1/2] net/core: print message for allmulticast
https://git.kernel.org/netdev/net-next/c/802dcbd6f30f
- [net-next,v1,2/2] net/core: refactor promiscuous mode message
https://git.kernel.org/netdev/net-next/c/3ba0bf47edf9
You are awesome, thank you!
--
Deet-doot-dot, I am a bot.
https://korg.docs.kernel.org/patchwork/pwbot.html
_______________________________________________
Intel-wired-lan mailing list
Intel-wired-lan@osuosl.org
https://lists.osuosl.org/mailman/listinfo/intel-wired-lan
^ permalink raw reply [flat|nested] 5+ messages in thread