From: Veaceslav Falico <vfalico@gmail.com>
To: Yuval Mintz <Yuval.Mintz@qlogic.com>
Cc: netdev <netdev@vger.kernel.org>,
David Miller <davem@davemloft.net>,
Eric Dumazet <edumazet@google.com>,
Vlad Yasevich <vyasevic@redhat.com>,
stephen hemminger <stephen@networkplumber.org>,
Jerry Chu <hkchu@google.com>,
Ben Hutchings <bhutchings@solarflare.com>,
David Laight <David.Laight@ACULAB.COM>
Subject: Re: [PATCH net-next] net: print a notification on device rename
Date: Sun, 20 Jul 2014 23:17:59 +0200 [thread overview]
Message-ID: <20140720211759.GA28467@mikrodark.usersys.redhat.com> (raw)
In-Reply-To: <B5657A6538887040AD3A81F1008BEC63B01758@avmb3.qlogic.org>
On Sun, Jul 20, 2014 at 12:37:52PM +0000, Yuval Mintz wrote:
>> Currently it's done silently (from the kernel part), and thus it might be hard to
>> track the renames from logs.
>>
>> Add a simple netdev_info() to notify the rename, but only in case the previous
>> name was valid.
>
>Hi,
>
>Why you're at it, perhaps we could also consider adding an optional ndo callback
>in the drivers to notify them of the device name change?
>[e.g., multi-module dependencies where one would wish to inform the others
>of the name change]
There's already one, I think:
1142 ret = call_netdevice_notifiers(NETDEV_CHANGENAME, dev);
It's also possible to block it. Or did you mean something else?
Thank you!
>
>Cheers,
>Yuval
>
>>
>> CC: "David S. Miller" <davem@davemloft.net>
>> CC: Eric Dumazet <edumazet@google.com>
>> CC: Vlad Yasevich <vyasevic@redhat.com>
>> CC: stephen hemminger <stephen@networkplumber.org>
>> CC: Jerry Chu <hkchu@google.com>
>> CC: Ben Hutchings <bhutchings@solarflare.com>
>> CC: David Laight <David.Laight@ACULAB.COM>
>> Signed-off-by: Veaceslav Falico <vfalico@gmail.com>
>> ---
>> net/core/dev.c | 3 +++
>> 1 file changed, 3 insertions(+)
>>
>> diff --git a/net/core/dev.c b/net/core/dev.c index 239722a..d14ebf0 100644
>> --- a/net/core/dev.c
>> +++ b/net/core/dev.c
>> @@ -1113,6 +1113,9 @@ int dev_change_name(struct net_device *dev, const
>> char *newname)
>> return err;
>> }
>>
>> + if (oldname[0] && !strchr(oldname, '%'))
>> + netdev_info(dev, "renamed from %s\n", oldname);
>> +
>> old_assign_type = dev->name_assign_type;
>> dev->name_assign_type = NET_NAME_RENAMED;
>>
>
>________________________________
>
>This message and any attached documents contain information from QLogic Corporation or its wholly-owned subsidiaries that may be confidential. If you are not the intended recipient, you may not read, copy, distribute, or use this information. If you have received this transmission in error, please notify the sender immediately by reply e-mail and then delete this message.
next prev parent reply other threads:[~2014-07-20 21:20 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-07-17 18:33 [PATCH net-next] net: print a notification on device rename Veaceslav Falico
2014-07-20 12:37 ` Yuval Mintz
2014-07-20 21:17 ` Veaceslav Falico [this message]
2014-07-21 5:50 ` Yuval Mintz
2014-07-21 3:44 ` David Miller
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=20140720211759.GA28467@mikrodark.usersys.redhat.com \
--to=vfalico@gmail.com \
--cc=David.Laight@ACULAB.COM \
--cc=Yuval.Mintz@qlogic.com \
--cc=bhutchings@solarflare.com \
--cc=davem@davemloft.net \
--cc=edumazet@google.com \
--cc=hkchu@google.com \
--cc=netdev@vger.kernel.org \
--cc=stephen@networkplumber.org \
--cc=vyasevic@redhat.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).