[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20171219152057.1e19a0bc@cakuba.netronome.com>
Date: Tue, 19 Dec 2017 15:20:57 -0800
From: Jakub Kicinski <jakub.kicinski@...ronome.com>
To: Stephen Hemminger <stephen@...workplumber.org>
Cc: "Samudrala, Sridhar" <sridhar.samudrala@...el.com>,
netdev@...r.kernel.org, Stephen Hemminger <sthemmin@...rosoft.com>
Subject: Re: [RFC] hv_netvsc: automatically name slave VF network device
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@...el.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 :/
Powered by blists - more mailing lists