Discussion of the implementations of VIRTIO specification
 help / color / mirror / Atom feed
From: "Samudrala, Sridhar" <sridhar.samudrala@intel.com>
To: si-wei liu <si-wei.liu@oracle.com>,
	"Michael S. Tsirkin" <mst@redhat.com>
Cc: Carolyn <carolyn.wyborny@intel.com>,
	Sameeh Jubran <sameeh@daynix.com>,
	Siwei Liu <loseweigh@gmail.com>,
	venu.busireddy@oracle.com, cohuck@redhat.com,
	virtio-dev <virtio-dev@lists.oasis-open.org>,
	liran.alon@oracle.com, Yan Vugenfirer <yan@daynix.com>,
	"Brandeburg, Jesse" <jesse.brandeburg@intel.com>,
	Boris Ostrovsky <boris.ostrovsky@oracle.com>
Subject: Re: [virtio-dev] [PATCH v4] content: Introduce VIRTIO_NET_F_STANDBY feature
Date: Thu, 29 Nov 2018 15:53:55 -0800	[thread overview]
Message-ID: <ff67ecc7-b3c0-658c-ee04-0d349555248d@intel.com> (raw)
In-Reply-To: <2f44fe5e-ee7d-96cd-dd85-f663fa04c7d0@oracle.com>

On 11/29/2018 2:53 PM, si-wei liu wrote:
>
>
> On 11/29/2018 1:17 PM, Michael S. Tsirkin wrote:
>> On Thu, Nov 29, 2018 at 12:14:46PM -0800, si-wei liu wrote:
>>>
>>> On 11/28/2018 5:15 PM, Michael S. Tsirkin wrote:
>>>> On Wed, Nov 28, 2018 at 12:28:42PM -0800, si-wei liu wrote:
>>>>> On 11/28/2018 12:06 PM, Michael S. Tsirkin wrote:
>>>>>> On Wed, Nov 28, 2018 at 10:39:55AM -0800, Samudrala, Sridhar wrote:
>>>>>>> On 11/28/2018 9:35 AM, Michael S. Tsirkin wrote:
>>>>>>>> On Wed, Nov 28, 2018 at 09:31:32AM -0800, Samudrala, Sridhar 
>>>>>>>> wrote:
>>>>>>>>> On 11/28/2018 9:08 AM, Michael S. Tsirkin wrote:
>>>>>>>>>> On Mon, Nov 26, 2018 at 12:22:56PM -0800, Samudrala, Sridhar 
>>>>>>>>>> wrote:
>>>>>>>>>>>> Update:
>>>>>>>>>>>> I have just set the vf mac's address to 0 (ip link set 
>>>>>>>>>>>> ens2f0 vf 1 mac
>>>>>>>>>>>> 00:00:00:00:00:00) after unplugging it (the primary device) 
>>>>>>>>>>>> and the
>>>>>>>>>>>> pings started working again on the failover interface. So 
>>>>>>>>>>>> it seems
>>>>>>>>>>>> like the frames were arriving to the vf on the host.
>>>>>>>>>>>>
>>>>>>>>>>>>
>>>>>>>>>>> Yes. When the VF is unplugged, you need to reset the VFs MAC 
>>>>>>>>>>> so that the packets
>>>>>>>>>>> with VMs MAC start flowing via VF, bridge and the virtio 
>>>>>>>>>>> interface.
>>>>>>>>>>>
>>>>>>>>>>> Have you looked at this documentation that shows a sample 
>>>>>>>>>>> script to initiate live
>>>>>>>>>>> migration?
>>>>>>>>>>> https://www.kernel.org/doc/html/latest/networking/net_failover.html 
>>>>>>>>>>>
>>>>>>>>>>>
>>>>>>>>>>> -Sridhar
>>>>>>>>>> Interesting I didn't notice it does this. So in fact
>>>>>>>>>> just defining VF mac will immediately divert packets
>>>>>>>>>> to the VF? Given guest driver did not initialize VF
>>>>>>>>>> yet won't a bunch of packets be dropped?
>>>>>>>>> There is typo in my stmt above (VF->PF)
>>>>>>>>> When the VF is unplugged, you need to reset the VFs MAC so 
>>>>>>>>> that the packets
>>>>>>>>> with VMs MAC start flowing via PF, bridge and the virtio 
>>>>>>>>> interface.
>>>>>>>>>
>>>>>>>>> When the VF is plugged in, ideally the MAC filter for the VF 
>>>>>>>>> should be added to
>>>>>>>>> the HW once the guest driver comes up and can receive packets. 
>>>>>>>>> Currently with intel
>>>>>>>>> drivers, the filter gets added to HW as soon as the host admin 
>>>>>>>>> sets the VFs MAC via
>>>>>>>>> ndo_set_vf_mac() api. So potentially there could be packet 
>>>>>>>>> drops until the VF driver
>>>>>>>>> comes up in the VM.
>>>>>>>>>
>>>>>>>>>
>>>>>>>> Can this be fixed in the intel drivers?
>>>>>>> I just checked and it looks like this seems to have been 
>>>>>>> addressed in the
>>>>>>> ice 100Gb driver. Will bring this up issue internally to see if 
>>>>>>> we can change this
>>>>>>> behavior in i40e/ixgbe drivers.
>>>>>> Also what happens if the mac is programmed both in PF (e.g. with
>>>>>> macvtap) and VF? Ideally VF will take precedence.
>>>>> I'm seriously doubtful that legacy Intel NIC hardware can do that 
>>>>> instead of
>>>>> mucking around with software workaround in the PF driver. 
>>>>> Actually, the same
>>>>> applies to other NIC vendors when hardware sees duplicate filters. 
>>>>> There's
>>>>> no such control of precedence on one over the other.
>>>>>
>>>>>
>>>>> -Siwei
>>>>>
>>>>>
>>>> Well removing a MAC from the PF filter when we are adding it to the VF
>>>> filter should always be possible. Need to keep it in a separate 
>>>> list and
>>>> re-add it when removing the MAC from VF filter.  This can be 
>>>> handled in
>>>> the net core, no need for driver specific hacks.
>>> So that is what I ever said - essentially what you need is a netdev 
>>> API,
>>> rather than to add dirty hacks on each driver. That is fine, but how 
>>> would
>>> you implement it? Note there's no equivalent driver level .ndo API 
>>> to "move"
>>> filters, and all existing .ndo APIs manipulate at the MAC address 
>>> level as
>>> opposed to filters. Are you going to convince netdev this is the 
>>> right thing
>>> to do and we should add such API to the net core and each individual 
>>> driver?
>> There's no need for a new API IMO.
>> You drop it from list of uc macs, then call .ndo_set_rx_mode.
> Then still you need a new netlink API - effectively it alters the 
> running state of macvtap as it steals certain filters out from the NIC 
> that affects the datapath of macvtap. I assume we talk about some 
> kernel mechanism to do automatic datapath switching without involving 
> userspace management stack/orchestration software. In the kernel's 
> (net core's) view that also needs some weak binding/coordination 
> between the VF and the macvtap for which MAC filter needs to be 
> activated. Still this senses to me a new API rather than tweaking the 
> current and long-existing default behavior and making it work 
> transparently just for this case. Otherwise, without introducing a new 
> API, how does the userspace infer that the running kernel supports 
> this new behavior.

In case of virtio backed by macvtap, you can change the mac address of the macvtap
interface. When VF is plugged in, change macvtap's MAC to an unassigned MAC and bring
the virtio link down.
When VF in unplugged, set macvtap's MAC to VMs mac and bring up virtio link.



---------------------------------------------------------------------
To unsubscribe, e-mail: virtio-dev-unsubscribe@lists.oasis-open.org
For additional commands, e-mail: virtio-dev-help@lists.oasis-open.org


  reply	other threads:[~2018-11-29 23:53 UTC|newest]

Thread overview: 85+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-08-15 18:49 [virtio-dev] [PATCH v4] content: Introduce VIRTIO_NET_F_STANDBY feature Sridhar Samudrala
2018-08-27  8:40 ` [virtio-dev] " Cornelia Huck
2018-08-27 12:34   ` Michael S. Tsirkin
2018-08-27 16:50     ` Samudrala, Sridhar
2018-08-28 12:13       ` Michael S. Tsirkin
2018-09-07 21:34 ` [virtio-dev] " Michael S. Tsirkin
2018-09-12 15:17   ` Samudrala, Sridhar
2018-09-12 15:22     ` Michael S. Tsirkin
2018-09-18 10:20       ` Cornelia Huck
2018-09-18 10:37         ` Sameeh Jubran
2018-09-18 13:25           ` Michael S. Tsirkin
2018-09-18 18:30             ` Siwei Liu
2018-09-18 18:39               ` Michael S. Tsirkin
2018-09-18 19:10                 ` Siwei Liu
2018-09-20  3:04                   ` Michael S. Tsirkin
2018-09-19  5:03             ` Samudrala, Sridhar
2018-09-20  5:51             ` Sameeh Jubran
2018-09-18 13:35         ` Michael S. Tsirkin
2018-09-18 15:13           ` Venu Busireddy
2018-09-18 15:31             ` Michael S. Tsirkin
2018-09-18 18:48               ` Siwei Liu
2018-09-20  3:11                 ` Michael S. Tsirkin
2018-09-20 23:57                   ` Siwei Liu
2018-09-21  2:23                     ` Michael S. Tsirkin
2018-09-21  2:34                       ` Michael S. Tsirkin
2018-09-27  0:18                       ` Siwei Liu
2018-09-27  7:17                         ` Sameeh Jubran
2018-09-27 16:17                           ` Michael S. Tsirkin
2018-09-27 17:23                             ` Samudrala, Sridhar
2018-09-27 23:45                               ` Michael S. Tsirkin
2018-09-30  9:17                               ` Sameeh Jubran
2018-09-30 13:50                                 ` Sameeh Jubran
2018-09-27 16:32                         ` Michael S. Tsirkin
2018-10-02  8:42                           ` Siwei Liu
2018-10-02 12:43                             ` Michael S. Tsirkin
2018-10-05  0:03                               ` Siwei Liu
2018-10-05  5:17                                 ` Samudrala, Sridhar
2018-10-10 14:40                                   ` Michael S. Tsirkin
2018-10-11  0:16                                     ` Samudrala, Sridhar
2018-10-05 19:18                                 ` Michael S. Tsirkin
2018-10-08 22:06                                   ` Sameeh Jubran
2018-10-10 14:43                                     ` Michael S. Tsirkin
2018-10-11  1:26                                   ` Siwei Liu
2018-10-18 23:20                                     ` Siwei Liu
2018-10-18 23:40                                       ` Michael S. Tsirkin
2018-10-19  3:45                                     ` Michael S. Tsirkin
2018-11-21 15:39                                       ` Sameeh Jubran
2018-11-21 18:41                                         ` Michael S. Tsirkin
2018-11-21 20:04                                           ` Sameeh Jubran
2018-11-21 23:51                                             ` Samudrala, Sridhar
2018-11-22 13:55                                               ` Sameeh Jubran
2018-11-22 18:27                                             ` Michael S. Tsirkin
2018-11-26 15:13                                               ` Sameeh Jubran
2018-11-26 15:43                                                 ` Sameeh Jubran
2018-11-26 20:22                                                   ` Samudrala, Sridhar
2018-11-27 11:24                                                     ` Sameeh Jubran
2018-11-28 17:08                                                     ` Michael S. Tsirkin
2018-11-28 17:31                                                       ` Samudrala, Sridhar
2018-11-28 17:35                                                         ` Michael S. Tsirkin
2018-11-28 18:39                                                           ` Samudrala, Sridhar
2018-11-28 18:51                                                             ` Michael S. Tsirkin
2018-11-29  6:29                                                               ` Samudrala, Sridhar
2018-11-28 20:06                                                             ` Michael S. Tsirkin
2018-11-28 20:28                                                               ` si-wei liu
2018-11-28 20:43                                                                 ` Michael S. Tsirkin
2018-11-28 20:47                                                                   ` si-wei liu
2018-11-29  1:15                                                                 ` Michael S. Tsirkin
2018-11-29  6:37                                                                   ` Samudrala, Sridhar
2018-11-29 20:14                                                                   ` si-wei liu
2018-11-29 21:17                                                                     ` Michael S. Tsirkin
2018-11-29 22:53                                                                       ` si-wei liu
2018-11-29 23:53                                                                         ` Samudrala, Sridhar [this message]
2018-11-30  0:24                                                                           ` si-wei liu
2018-11-30  3:08                                                                             ` Samudrala, Sridhar
2018-11-30  4:46                                                                               ` si-wei liu
2018-11-30  6:21                                                                         ` Michael S. Tsirkin
2018-12-04  2:09                                                                           ` si-wei liu
2018-12-04  3:59                                                                             ` Michael S. Tsirkin
2018-12-05 16:18                                                                               ` Sameeh Jubran
2018-12-05 17:18                                                                                 ` Michael S. Tsirkin
2018-12-08  1:54                                                                                 ` si-wei liu
2018-12-10 15:13                                                                                   ` Sameeh Jubran
2018-12-10 15:34                                                                                     ` Sameeh Jubran
2018-12-10 17:46                                                                                       ` Michael S. Tsirkin
2018-12-11 15:50                                                                                         ` Sameeh Jubran

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=ff67ecc7-b3c0-658c-ee04-0d349555248d@intel.com \
    --to=sridhar.samudrala@intel.com \
    --cc=boris.ostrovsky@oracle.com \
    --cc=carolyn.wyborny@intel.com \
    --cc=cohuck@redhat.com \
    --cc=jesse.brandeburg@intel.com \
    --cc=liran.alon@oracle.com \
    --cc=loseweigh@gmail.com \
    --cc=mst@redhat.com \
    --cc=sameeh@daynix.com \
    --cc=si-wei.liu@oracle.com \
    --cc=venu.busireddy@oracle.com \
    --cc=virtio-dev@lists.oasis-open.org \
    --cc=yan@daynix.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