From mboxrd@z Thu Jan 1 00:00:00 1970 From: Stephen Hemminger Subject: Re: [RFC PATCH] virtio_net: Extend virtio to use VF datapath when available Date: Tue, 19 Dec 2017 14:53:45 -0800 Message-ID: <20171219145345.3c261273@xeon-e3> References: <20171219174259-mutt-send-email-mst@kernel.org> <20171219095548.61d70d10@xeon-e3> <20171219.132117.666798483874609477.davem@davemloft.net> <20171219104159.30d9caaf@xeon-e3> <344f0afc-b4aa-9f1a-15b8-166ba97d270b@intel.com> <20171219114627.76dac732@xeon-e3> Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Cc: David Miller , mst@redhat.com, netdev@vger.kernel.org, virtualization@lists.linux-foundation.org, alexander.duyck@gmail.com, jesse.brandeburg@intel.com To: "Samudrala, Sridhar" Return-path: Received: from mail-pl0-f68.google.com ([209.85.160.68]:33301 "EHLO mail-pl0-f68.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751496AbdLSWxr (ORCPT ); Tue, 19 Dec 2017 17:53:47 -0500 Received: by mail-pl0-f68.google.com with SMTP id 1so6414433plv.0 for ; Tue, 19 Dec 2017 14:53:47 -0800 (PST) In-Reply-To: Sender: netdev-owner@vger.kernel.org List-ID: On Tue, 19 Dec 2017 14:37:50 -0800 "Samudrala, Sridhar" wrote: > On 12/19/2017 11:46 AM, Stephen Hemminger wrote: > > On Tue, 19 Dec 2017 11:42:33 -0800 > > "Samudrala, Sridhar" wrote: > > =20 > >> On 12/19/2017 10:41 AM, Stephen Hemminger wrote: =20 > >>> On Tue, 19 Dec 2017 13:21:17 -0500 (EST) > >>> David Miller wrote: > >>> =20 > >>>> From: Stephen Hemminger > >>>> Date: Tue, 19 Dec 2017 09:55:48 -0800 > >>>> =20 > >>>>> could be 10ms, just enough to let udev do its renaming =20 > >>>> Please, move to some kind of notification or event based handling of > >>>> this problem. > >>>> > >>>> No delay is safe, what if userspace gets swapped out or whatever > >>>> else might make userspace stall unexpectedly? > >>>> =20 > >>> The plan is to remove the delay and do the naming in the kernel. > >>> This was suggested by Lennart since udev is only doing naming policy > >>> because kernel names were not repeatable. > >>> > >>> This makes the VF show up as "ethN_vf" on Hyper-V which is user frien= dly. > >>> > >>> Patch is pending. =20 > >> Do we really need to delay the setup until the name is changed? > >> Can't we call dev_set_mtu() and dev_open() until dev_change_name() is = done? > >> > >> Thanks > >> Sridhar =20 > > You can call dev_set_mtu, but when dev_open is done the device name > > can not be changed by userspace. =20 > I did a quick test to remove the delay and also the dev_open() call and=20 > i don't see > any issues with virtio taking over the VF datapath. > Only the netdev_info() messages may show old device name. >=20 > Any specific scenario where we need to explicitly call=C2=A0 VF's dev_ope= n()=20 > in the VF setup process? > I tried i40evf driver loaded after virtio_net=C2=A0 AND=C2=A0 virtio_net = loading=20 > after i40evf. >=20 > Thanks > Sridhar It happens with hotplug. It is possible on Hyper-V to hotplug SR-IOV on and off while guest is running. If SR-IOV is disabled in host then the VF device is removed (hotplug) and the inverse. If the master device is up then the VF device should be brought up by the master device.