Message ID | 20250205-netconsole-v3-0-132a31f17199@purestorage.com |
---|---|
Headers | show |
Series | netconsole: allow selection of egress interface via MAC address | expand |
On Wed, 05 Feb 2025 22:21:31 -0700 Uday Shankar wrote: > Currently, netconsole has two methods of configuration - module > parameter and configfs. The former interface allows for netconsole > activation earlier during boot (by specifying the module parameter on > the kernel command line), so it is preferred for debugging issues which > arise before userspace is up/the configfs interface can be used. The > module parameter syntax requires specifying the egress interface name. > This requirement makes it hard to use for a couple reasons: > - The egress interface name can be hard or impossible to predict. For > example, installing a new network card in a system can change the > interface names assigned by the kernel. > - When constructing the module parameter, one may have trouble > determining the original (kernel-assigned) name of the interface > (which is the name that should be given to netconsole) if some stable > interface naming scheme is in effect. A human can usually look at > kernel logs to determine the original name, but this is very painful > if automation is constructing the parameter. > > For these reasons, allow selection of the egress interface via MAC > address when configuring netconsole using the module parameter. Update > the netconsole documentation with an example of the new syntax. > Selection of egress interface by MAC address via configfs is far less > interesting (since when this interface can be used, one should be able > to easily convert between MAC address and interface name), so it is left > unimplemented. Sounds like dev_getbyhwaddr_rcu() will warn here. Either wrap it in RCU temporarily or combine the series with Breno's patch to add a new helper?
This series adds support for selecting a netconsole egress interface by specifying the MAC address (in place of the interface name) in the boot/module parameter. Signed-off-by: Uday Shankar <ushankar@purestorage.com> --- Changes in v3: - Rename MAC_ADDR_LEN to MAC_ADDR_STR_LEN (Johannes Berg) - Link to v2: https://lore.kernel.org/r/20250204-netconsole-v2-0-5ef5eb5f6056@purestorage.com --- Uday Shankar (2): net, treewide: define and use MAC_ADDR_STR_LEN netconsole: allow selection of egress interface via MAC address Documentation/networking/netconsole.rst | 6 +++- drivers/net/netconsole.c | 2 +- drivers/nvmem/brcm_nvram.c | 2 +- drivers/nvmem/layouts/u-boot-env.c | 2 +- include/linux/if_ether.h | 3 ++ include/linux/netpoll.h | 6 ++++ lib/net_utils.c | 4 +-- net/core/netpoll.c | 51 +++++++++++++++++++++++++-------- net/mac80211/debugfs_sta.c | 5 ++-- 9 files changed, 60 insertions(+), 21 deletions(-) --- base-commit: 3924fa995cdf3752f2f89f8de72834c4638c5ebf change-id: 20250204-netconsole-4c610e2f871c Best regards,