From: Stephen Hemminger <stephen@networkplumber.org>
To: Jakub Kicinski <jakub.kicinski@netronome.com>
Cc: "Samudrala, Sridhar" <sridhar.samudrala@intel.com>,
netdev@vger.kernel.org,
Stephen Hemminger <sthemmin@microsoft.com>
Subject: Re: [RFC] hv_netvsc: automatically name slave VF network device
Date: Tue, 19 Dec 2017 15:44:05 -0800 [thread overview]
Message-ID: <20171219154405.5bb35eff@xeon-e3> (raw)
In-Reply-To: <20171219152057.1e19a0bc@cakuba.netronome.com>
On Tue, 19 Dec 2017 15:20:57 -0800
Jakub Kicinski <jakub.kicinski@netronome.com> wrote:
> On Tue, 19 Dec 2017 14:50:17 -0800, Stephen Hemminger wrote:
> > On Tue, 19 Dec 2017 14:44:37 -0800
> > "Samudrala, Sridhar" <sridhar.samudrala@intel.com> wrote:
> >
> > > -static void __netvsc_vf_setup(struct net_device *ndev,
> > > > - struct net_device *vf_netdev)
> > > > -{
> > > > - int ret;
> > > > + /* set the name of VF device based on upper device name */
> > > > + snprintf(vf_name, IFNAMSIZ, "%s_vf", ndev->name);
> > > > + ret = dev_change_name(vf_netdev, vf_name);
> > > > + if (ret != 0)
> > > > + netdev_warn(vf_netdev,
> > > > + "can not rename device: (%d)\n", ret);
> > >
> > > It is possible that upper device name can change after this call. I
> > > noticed this
> > > when i tried this approach with virtio_net.
> > >
> > > Also, what should happen if the upper device is unloaded? Should we rename
> > > the VF name?
> >
> > Yes upper device can change name. So sure, netdevice could trap that
> > in callback (it already has notifier) and rename VF. Will add that in V2.
> >
> > If upper device is unloaded then it is already decoupled from the VF.
> > There is no good value to change it back to. The orignal name probably
> > has been reused by then.
>
> Both of those issues would be solved by just exposing phys_port_name
> from the VF driver, and letting systemd do its thing independent of
> magic bonds.
>
> Reluctance to do driver work aside :/
The port name for Mellanox driver is already set in the driver as a numeric value.
It indicates which port is used.
This won't work.
next prev parent reply other threads:[~2017-12-19 23:44 UTC|newest]
Thread overview: 15+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-12-19 19:35 [RFC] hv_netvsc: automatically name slave VF network device Stephen Hemminger
2017-12-19 20:32 ` Jakub Kicinski
2017-12-19 20:44 ` Stephen Hemminger
2017-12-19 21:18 ` Jakub Kicinski
2017-12-19 21:29 ` Stephen Hemminger
2017-12-19 21:55 ` Jakub Kicinski
2017-12-19 22:06 ` Stephen Hemminger
2017-12-19 22:24 ` Jakub Kicinski
2017-12-19 22:51 ` Stephen Hemminger
2017-12-19 22:44 ` Samudrala, Sridhar
2017-12-19 22:50 ` Stephen Hemminger
2017-12-19 23:20 ` Jakub Kicinski
2017-12-19 23:44 ` Stephen Hemminger [this message]
2017-12-19 23:53 ` Jakub Kicinski
2017-12-20 6:41 ` Jiri Pirko
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=20171219154405.5bb35eff@xeon-e3 \
--to=stephen@networkplumber.org \
--cc=jakub.kicinski@netronome.com \
--cc=netdev@vger.kernel.org \
--cc=sridhar.samudrala@intel.com \
--cc=sthemmin@microsoft.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).