All of lore.kernel.org
 help / color / mirror / Atom feed
From: Siwei Liu <loseweigh@gmail.com>
To: Jiri Pirko <jiri@resnulli.us>
Cc: Alexander Duyck <alexander.h.duyck@intel.com>,
	virtio-dev@lists.oasis-open.org,
	"Michael S. Tsirkin" <mst@redhat.com>,
	Jakub Kicinski <kubakici@wp.pl>,
	Sridhar Samudrala <sridhar.samudrala@intel.com>,
	virtualization@lists.linux-foundation.org,
	Netdev <netdev@vger.kernel.org>,
	aaron.f.brown@intel.com, David Miller <davem@davemloft.net>
Subject: Re: [PATCH net-next v9 3/4] virtio_net: Extend virtio to use VF datapath when available
Date: Sun, 29 Apr 2018 01:56:30 -0700	[thread overview]
Message-ID: <CADGSJ23A4w=MmnP7CneBwk=eouS07HfK4=1UWTk3Dz3gBX0yjg__36167.1659666628$1524992091$gmane$org@mail.gmail.com> (raw)
In-Reply-To: <20180428094205.GM5632@nanopsycho.orion>

On Sat, Apr 28, 2018 at 2:42 AM, Jiri Pirko <jiri@resnulli.us> wrote:
> Fri, Apr 27, 2018 at 07:06:59PM CEST, sridhar.samudrala@intel.com wrote:
>>This patch enables virtio_net to switch over to a VF datapath when a VF
>>netdev is present with the same MAC address. It allows live migration
>>of a VM with a direct attached VF without the need to setup a bond/team
>>between a VF and virtio net device in the guest.
>>
>>The hypervisor needs to enable only one datapath at any time so that
>>packets don't get looped back to the VM over the other datapath. When a VF
>>is plugged, the virtio datapath link state can be marked as down. The
>>hypervisor needs to unplug the VF device from the guest on the source host
>>and reset the MAC filter of the VF to initiate failover of datapath to
>>virtio before starting the migration. After the migration is completed,
>>the destination hypervisor sets the MAC filter on the VF and plugs it back
>>to the guest to switch over to VF datapath.
>>
>>It uses the generic failover framework that provides 2 functions to create
>>and destroy a master failover netdev. When STANDBY feature is enabled, an
>>additional netdev(failover netdev) is created that acts as a master device
>>and tracks the state of the 2 lower netdevs. The original virtio_net netdev
>>is marked as 'standby' netdev and a passthru device with the same MAC is
>>registered as 'primary' netdev.
>>
>>This patch is based on the discussion initiated by Jesse on this thread.
>>https://marc.info/?l=linux-virtualization&m=151189725224231&w=2
>>
>
> When I enabled the standby feature (hardcoded), I have 2 netdevices now:
> 4: ens3: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc noqueue state UP group default qlen 1000
>     link/ether 52:54:00:b2:a7:f1 brd ff:ff:ff:ff:ff:ff
>     inet6 fe80::5054:ff:feb2:a7f1/64 scope link
>        valid_lft forever preferred_lft forever
> 5: ens3n_sby: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc fq_codel state UP group default qlen 1000
>     link/ether 52:54:00:b2:a7:f1 brd ff:ff:ff:ff:ff:ff
>     inet6 fe80::5054:ff:feb2:a7f1/64 scope link
>        valid_lft forever preferred_lft forever
>
> However, it seems to confuse my initscripts on Fedora:
> [root@test1 ~]# ifup ens3
> ./network-functions: line 78: [: /etc/dhcp/dhclient-ens3: binary operator expected
> ./network-functions: line 80: [: /etc/dhclient-ens3: binary operator expected
> ./network-functions: line 69: [: /var/lib/dhclient/dhclient-ens3: binary operator expected
>
You should teach Fedora and all cloud vendors to upgrade their
initscripts and other userspace tools, no?

> Determining IP information for ens3
> ens3n_sby...Cannot find device "ens3n_sby.pid"
> Cannot find device "ens3n_sby.lease"
>  failed.
>
> I tried to change the standby device mac:
> ip link set ens3n_sby addr 52:54:00:b2:a7:f2
> [root@test1 ~]# ifup ens3
>
> Determining IP information for ens3... done.
> [root@test1 ~]#
>
> But now the network does not work. I think that the mac change on
> standby device should be probably refused, no?
>
> When I change the mac back, all works fine.
>
>
> Now I try to change mac of the failover master:
> [root@test1 ~]# ip link set ens3 addr 52:54:00:b2:a7:f3
> RTNETLINK answers: Operation not supported
>
> That I did expect to work. I would expect this would change the mac of
> the master and both standby and primary slaves.
>
>
> Now I tried to add a primary pci device. I don't have any fancy VF on my
> test setup, but I expected the good old 8139cp to work:
> [root@test1 ~]# ethtool -i ens9
> driver: 8139cp
> ....
> [root@test1 ~]# ip link set ens9 addr 52:54:00:b2:a7:f1
>
> I see no message in dmesg, so I guess the failover module did not
> enslave this netdev. The mac change is not monitored. I would expect
> that it is and whenever a device changes mac to the failover one, it
> should be enslaved and whenever it changes mac back to something else,
> it should be released - the primary one ofcourse.
>
>
>
> [...]
>
>>+static int virtnet_get_phys_port_name(struct net_device *dev, char *buf,
>>+                                    size_t len)
>>+{
>>+      struct virtnet_info *vi = netdev_priv(dev);
>>+      int ret;
>>+
>>+      if (!virtio_has_feature(vi->vdev, VIRTIO_NET_F_STANDBY))
>>+              return -EOPNOTSUPP;
>>+
>>+      ret = snprintf(buf, len, "_sby");
>
> please avoid the "_".
>
> [...]

  reply	other threads:[~2018-04-29  8:56 UTC|newest]

Thread overview: 92+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-04-27 17:06 [PATCH net-next v9 0/4] Enable virtio_net to act as a standby for a passthru device Sridhar Samudrala
2018-04-27 17:06 ` [virtio-dev] " Sridhar Samudrala
2018-04-27 17:06 ` [PATCH net-next v9 1/4] virtio_net: Introduce VIRTIO_NET_F_STANDBY feature bit Sridhar Samudrala
2018-04-27 17:06   ` [virtio-dev] " Sridhar Samudrala
2018-04-28  7:50   ` Jiri Pirko
2018-04-28  7:50   ` Jiri Pirko
2018-04-30  2:47     ` Samudrala, Sridhar
2018-04-30  2:47       ` [virtio-dev] " Samudrala, Sridhar
2018-04-30  7:03       ` Jiri Pirko
2018-04-30 19:14         ` Samudrala, Sridhar
2018-04-30 19:14         ` Samudrala, Sridhar
2018-04-30 19:14           ` [virtio-dev] " Samudrala, Sridhar
2018-04-30  2:47     ` Samudrala, Sridhar
2018-04-27 17:06 ` Sridhar Samudrala
2018-04-27 17:06 ` [PATCH net-next v9 2/4] net: Introduce generic failover module Sridhar Samudrala
2018-04-27 17:06 ` Sridhar Samudrala
2018-04-27 17:06   ` [virtio-dev] " Sridhar Samudrala
2018-04-27 17:53   ` Jiri Pirko
2018-04-27 17:53   ` Jiri Pirko
2018-04-28  8:15   ` Jiri Pirko
2018-04-30  2:47     ` Samudrala, Sridhar
2018-04-30  2:47       ` [virtio-dev] " Samudrala, Sridhar
2018-04-30  2:47     ` Samudrala, Sridhar
2018-04-28  8:15   ` Jiri Pirko
2018-04-28  9:06   ` Jiri Pirko
2018-04-30  3:03     ` Samudrala, Sridhar
2018-04-30  3:03       ` [virtio-dev] " Samudrala, Sridhar
2018-04-30  3:03     ` Samudrala, Sridhar
2018-05-02 16:15     ` Jiri Pirko
2018-05-02 17:51       ` Samudrala, Sridhar
2018-05-02 17:51       ` Samudrala, Sridhar
2018-05-02 17:51         ` [virtio-dev] " Samudrala, Sridhar
2018-05-02 20:30         ` Michael S. Tsirkin
2018-05-02 20:30         ` Michael S. Tsirkin
2018-05-02 20:30           ` [virtio-dev] " Michael S. Tsirkin
2018-05-02 21:36           ` Samudrala, Sridhar
2018-05-02 21:36             ` [virtio-dev] " Samudrala, Sridhar
2018-05-02 21:39         ` Jiri Pirko
2018-05-02 21:39         ` Jiri Pirko
2018-05-02 21:39         ` Jiri Pirko
2018-05-02 21:39         ` Jiri Pirko
2018-05-02 16:15     ` Jiri Pirko
2018-04-27 17:06 ` [PATCH net-next v9 3/4] virtio_net: Extend virtio to use VF datapath when available Sridhar Samudrala
2018-04-27 17:06 ` Sridhar Samudrala
2018-04-27 17:06   ` [virtio-dev] " Sridhar Samudrala
2018-04-28  8:24   ` Jiri Pirko
2018-04-30  3:00     ` Samudrala, Sridhar
2018-04-30  3:00       ` [virtio-dev] " Samudrala, Sridhar
2018-04-30  7:12       ` Jiri Pirko
2018-04-30  7:12       ` Jiri Pirko
2018-04-30 19:26         ` Samudrala, Sridhar
2018-04-30 19:26           ` [virtio-dev] " Samudrala, Sridhar
2018-05-01  7:33           ` Jiri Pirko
2018-05-01  7:33           ` Jiri Pirko
2018-04-30 19:26         ` Samudrala, Sridhar
2018-04-30  3:00     ` Samudrala, Sridhar
2018-04-28  9:42   ` Jiri Pirko
2018-04-28  9:42   ` Jiri Pirko
2018-04-29  8:56     ` Siwei Liu [this message]
2018-04-29  8:56     ` Siwei Liu
2018-04-29  8:56       ` [virtio-dev] " Siwei Liu
2018-04-29 13:45       ` Jiri Pirko
2018-04-29 13:45       ` Jiri Pirko
2018-04-30  4:16     ` Samudrala, Sridhar
2018-04-30  4:16     ` Samudrala, Sridhar
2018-04-30  4:16       ` [virtio-dev] " Samudrala, Sridhar
2018-04-30  7:20       ` Jiri Pirko
2018-05-02  0:20         ` Samudrala, Sridhar
2018-05-02  0:20         ` Samudrala, Sridhar
2018-05-02  0:20           ` [virtio-dev] " Samudrala, Sridhar
2018-05-02  7:50           ` Jiri Pirko
2018-05-02  7:50           ` Jiri Pirko
2018-05-02 15:34             ` Samudrala, Sridhar
2018-05-02 15:34             ` Samudrala, Sridhar
2018-05-02 15:34               ` [virtio-dev] " Samudrala, Sridhar
2018-05-02 16:05               ` Jiri Pirko
2018-05-02 15:47             ` Michael S. Tsirkin
2018-05-02 15:47               ` [virtio-dev] " Michael S. Tsirkin
2018-05-02 16:04               ` Jiri Pirko
2018-05-02 16:04               ` Jiri Pirko
2018-05-02 15:47             ` Michael S. Tsirkin
2018-04-30  7:20       ` Jiri Pirko
2018-04-27 17:07 ` [PATCH net-next v9 4/4] netvsc: refactor notifier/event handling code to use the failover framework Sridhar Samudrala
2018-04-27 17:07 ` Sridhar Samudrala
2018-04-27 17:07   ` [virtio-dev] " Sridhar Samudrala
2018-04-27 17:45 ` [PATCH net-next v9 0/4] Enable virtio_net to act as a standby for a passthru device Jiri Pirko
2018-04-27 17:45 ` Jiri Pirko
2018-04-27 17:53   ` Samudrala, Sridhar
2018-04-27 17:53   ` Samudrala, Sridhar
2018-04-27 17:53     ` [virtio-dev] " Samudrala, Sridhar
2018-04-27 19:38     ` Jiri Pirko
2018-04-27 19:38     ` 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='CADGSJ23A4w=MmnP7CneBwk=eouS07HfK4=1UWTk3Dz3gBX0yjg__36167.1659666628$1524992091$gmane$org@mail.gmail.com' \
    --to=loseweigh@gmail.com \
    --cc=aaron.f.brown@intel.com \
    --cc=alexander.h.duyck@intel.com \
    --cc=davem@davemloft.net \
    --cc=jiri@resnulli.us \
    --cc=kubakici@wp.pl \
    --cc=mst@redhat.com \
    --cc=netdev@vger.kernel.org \
    --cc=sridhar.samudrala@intel.com \
    --cc=virtio-dev@lists.oasis-open.org \
    --cc=virtualization@lists.linux-foundation.org \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.