From mboxrd@z Thu Jan 1 00:00:00 1970 From: Jiri Pirko Subject: Re: [PATCH net-next v9 2/4] net: Introduce generic failover module Date: Fri, 27 Apr 2018 19:53:45 +0200 Message-ID: <20180427175345.GF5632@nanopsycho.orion> References: <1524848820-42258-1-git-send-email-sridhar.samudrala@intel.com> <1524848820-42258-3-git-send-email-sridhar.samudrala@intel.com> 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, aaron.f.brown@intel.com To: Sridhar Samudrala Return-path: Received: from mail-wr0-f196.google.com ([209.85.128.196]:42596 "EHLO mail-wr0-f196.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752553AbeD0Rxr (ORCPT ); Fri, 27 Apr 2018 13:53:47 -0400 Received: by mail-wr0-f196.google.com with SMTP id v5-v6so2538684wrf.9 for ; Fri, 27 Apr 2018 10:53:46 -0700 (PDT) Content-Disposition: inline In-Reply-To: <1524848820-42258-3-git-send-email-sridhar.samudrala@intel.com> Sender: netdev-owner@vger.kernel.org List-ID: Fri, Apr 27, 2018 at 07:06:58PM CEST, sridhar.samudrala@intel.com wrote: >This provides a generic interface for paravirtual drivers to listen >for netdev register/unregister/link change events from pci ethernet >devices with the same MAC and takeover their datapath. The notifier and >event handling code is based on the existing netvsc implementation. > >It exposes 2 sets of interfaces to the paravirtual drivers. >1. For paravirtual drivers like virtio_net that use 3 netdev model, the > the failover module provides interfaces to create/destroy additional > master netdev and all the slave events are managed internally. > net_failover_create() > net_failover_destroy() > A failover netdev is created that acts a master device and controls 2 > slave devices. The original virtio_net netdev is registered as 'standby' > netdev and a passthru/vf device with the same MAC gets registered as > 'primary' netdev. Both 'standby' and 'primary' netdevs are associated > with the same 'pci' device. The user accesses the network interface via > 'failover' netdev. The 'failover' netdev chooses 'primary' netdev as > default for transmits when it is available with link up and running. >2. For existing netvsc driver that uses 2 netdev model, no master netdev > is created. The paravirtual driver registers each instance of netvsc > as a 'failover' netdev along with a set of ops to manage the slave > events. There is no 'standby' netdev in this model. A passthru/vf device > with the same MAC gets registered as 'primary' netdev. > net_failover_register() > net_failover_unregister() > >Signed-off-by: Sridhar Samudrala >--- > include/linux/netdevice.h | 16 + > include/net/net_failover.h | 62 ++++ > net/Kconfig | 10 + > net/core/Makefile | 1 + > net/core/net_failover.c | 892 +++++++++++++++++++++++++++++++++++++++++++++ > 5 files changed, 981 insertions(+) > create mode 100644 include/net/net_failover.h > create mode 100644 net/core/net_failover.c checkpatch says: _exportax/0002-net-Introduce-generic-failover-module.patch ---------------------------------------------------------- WARNING: added, moved or deleted file(s), does MAINTAINERS need updating? #92: new file mode 100644 Please add an entry to the MAINTAINERS file.