[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20171219145017.78b60959@xeon-e3>
Date: Tue, 19 Dec 2017 14:50:17 -0800
From: Stephen Hemminger <stephen@...workplumber.org>
To: "Samudrala, Sridhar" <sridhar.samudrala@...el.com>
Cc: 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: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.
Powered by blists - more mailing lists