From: Andrew Lunn <andrew@lunn.ch>
To: Andy Ren <andy.ren@getcruise.com>
Cc: netdev@vger.kernel.org, richardbgobert@gmail.com,
davem@davemloft.net, wsa+renesas@sang-engineering.com,
edumazet@google.com, petrm@nvidia.com, kuba@kernel.org,
pabeni@redhat.com, corbet@lwn.net, linux-doc@vger.kernel.org,
linux-kernel@vger.kernel.org, roman.gushchin@linux.dev
Subject: Re: [PATCH net-next v2] netconsole: Enable live renaming for network interfaces used by netconsole
Date: Wed, 2 Nov 2022 01:48:09 +0100 [thread overview]
Message-ID: <Y2G+SYXyZAB/r3X0@lunn.ch> (raw)
In-Reply-To: <20221102002420.2613004-1-andy.ren@getcruise.com>
On Tue, Nov 01, 2022 at 05:24:20PM -0700, Andy Ren wrote:
> This patch enables support for live renaming of network interfaces
> initialized by netconsole.
>
> This resolves an issue seen when netconsole is configured to boot as a
> built-in kernel module with a kernel boot argument. As stated in the
> kernel man page - As a built-in, netconsole initializes immediately
> after NIC cards and will bring up the specified interface as soon as
> possible. Consequently, the renaming of specified interfaces will fail
> and return EBUSY. This is because by default, the kernel disallows live
> renaming unless the device explicitly sets a priv_flags bit
> (e.g: IFF_LIVE_RENAME_OK or IFF_LIVE_ADDR_CHANGE), and so renaming after
> a network interface is up returns EBUSY.
>
> The changes to the kernel are as of following:
>
> - Addition of a iface_live_renaming boolean flag to the netpoll struct,
> used to enable/disable interface live renaming. False by default
> - Changes to check for the aforementioned flag in network and ethernet
> driver interface renaming code
> - Adds a new optional "*" parameter to the netconsole configuration
> string that enables interface live renaming when included
> (e.g. netconsole=+*....). When this optional parameter is included,
> "iface_live_renaming" is set to true
> /**
> * eth_header - create the Ethernet header
> @@ -288,8 +289,10 @@ int eth_prepare_mac_addr_change(struct net_device *dev, void *p)
> {
> struct sockaddr *addr = p;
>
> - if (!(dev->priv_flags & IFF_LIVE_ADDR_CHANGE) && netif_running(dev))
> + if (!(dev->priv_flags & IFF_LIVE_ADDR_CHANGE) && netif_running(dev) &&
> + !netpoll_live_renaming_enabled(dev))
> return -EBUSY;
> +
> if (!is_valid_ether_addr(addr->sa_data))
> return -EADDRNOTAVAIL;
> return 0;
There is no mention of this in the commit message.
Changing the interface name while running is probably not an
issue. There are a few drivers which report the name to the firmware,
presumably for logging, and phoning home, but it should not otherwise
affect the hardware.
However, changing the MAC address does need changes to the hardware
configuration, and not all can do that while the interface is running.
So i think this last part needs some justification.
Andrew
next prev parent reply other threads:[~2022-11-02 0:49 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-11-02 0:24 [PATCH net-next v2] netconsole: Enable live renaming for network interfaces used by netconsole Andy Ren
2022-11-02 0:48 ` Andrew Lunn [this message]
2022-11-02 3:40 ` Jakub Kicinski
2022-11-02 17:14 ` Roman Gushchin
2022-11-02 19:54 ` Jakub Kicinski
2022-11-03 0:08 ` Roman Gushchin
2022-11-03 17:52 ` Ido Schimmel
2022-11-03 22:38 ` David Ahern
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=Y2G+SYXyZAB/r3X0@lunn.ch \
--to=andrew@lunn.ch \
--cc=andy.ren@getcruise.com \
--cc=corbet@lwn.net \
--cc=davem@davemloft.net \
--cc=edumazet@google.com \
--cc=kuba@kernel.org \
--cc=linux-doc@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=netdev@vger.kernel.org \
--cc=pabeni@redhat.com \
--cc=petrm@nvidia.com \
--cc=richardbgobert@gmail.com \
--cc=roman.gushchin@linux.dev \
--cc=wsa+renesas@sang-engineering.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).