From mboxrd@z Thu Jan 1 00:00:00 1970 From: Jiri Pirko Subject: Re: [RFC PATCH net-next v5 3/4] virtio_net: Extend virtio to use VF datapath when available Date: Mon, 9 Apr 2018 10:07:51 +0200 Message-ID: <20180409080751.GE19345@nanopsycho> References: <1522962503-3963-1-git-send-email-sridhar.samudrala@intel.com> <1522962503-3963-4-git-send-email-sridhar.samudrala@intel.com> <20180406124814.GA24525@nanopsycho> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Cc: mst@redhat.com, stephen@networkplumber.org, davem@davemloft.net, netdev@vger.kernel.org, virtualization@lists.linux-foundation.org, virtio-dev@lists.oasis-open.org, jesse.brandeburg@intel.com, alexander.h.duyck@intel.com, kubakici@wp.pl, jasowang@redhat.com, loseweigh@gmail.com To: "Samudrala, Sridhar" Return-path: Received: from mail-wm0-f68.google.com ([74.125.82.68]:51040 "EHLO mail-wm0-f68.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751502AbeDIIHx (ORCPT ); Mon, 9 Apr 2018 04:07:53 -0400 Received: by mail-wm0-f68.google.com with SMTP id t67so16971083wmt.0 for ; Mon, 09 Apr 2018 01:07:52 -0700 (PDT) Content-Disposition: inline In-Reply-To: Sender: netdev-owner@vger.kernel.org List-ID: Sat, Apr 07, 2018 at 12:59:14AM CEST, sridhar.samudrala@intel.com wrote: >On 4/6/2018 5:48 AM, Jiri Pirko wrote: >> Thu, Apr 05, 2018 at 11:08:22PM CEST, sridhar.samudrala@intel.com wrote: [...] >> > +static int virtnet_bypass_join_child(struct net_device *bypass_netdev, >> > + struct net_device *child_netdev) >> > +{ >> > + struct virtnet_bypass_info *vbi; >> > + bool backup; >> > + >> > + vbi = netdev_priv(bypass_netdev); >> > + backup = (child_netdev->dev.parent == bypass_netdev->dev.parent); >> > + if (backup ? rtnl_dereference(vbi->backup_netdev) : >> > + rtnl_dereference(vbi->active_netdev)) { >> > + netdev_info(bypass_netdev, >> > + "%s attempting to join bypass dev when %s already present\n", >> > + child_netdev->name, backup ? "backup" : "active"); >> Bypass module should check if there is already some other netdev >> enslaved and refuse right there. > >This will work for virtio-net with 3 netdev model, but this check has to be done by netvsc >as its bypass_netdev is same as the backup_netdev. >Will add a flag while registering with the bypass module to indicate if the driver is doing >a 2 netdev or 3 netdev model and based on that flag this check can be done in bypass module >for 3 netdev scenario. Just let me undestand it clearly. What I expect the difference would be between 2netdev and3 netdev model is this: 2netdev: bypass_master / / VF_slave 3netdev: bypass_master / \ / \ VF_slave backup_slave Is that correct? If not, how does it look like? Thanks!