[virtio-dev] Re: [PATCH v7 net-next 2/4] net: Introduce generic failover module

2018-04-23 Thread Samudrala, Sridhar
On 4/22/2018 10:06 AM, Michael S. Tsirkin wrote: On Thu, Apr 19, 2018 at 06:42:02PM -0700, Sridhar Samudrala wrote: +#if IS_ENABLED(CONFIG_NET_FAILOVER) + +int failover_create(struct net_device *standby_dev, + struct failover **pfailover); Should we rename all these structs ne

[virtio-dev] Re: [PATCH v7 net-next 2/4] net: Introduce generic failover module

2018-04-22 Thread Michael S. Tsirkin
On Thu, Apr 19, 2018 at 06:42:02PM -0700, Sridhar Samudrala wrote: > +#if IS_ENABLED(CONFIG_NET_FAILOVER) > + > +int failover_create(struct net_device *standby_dev, > + struct failover **pfailover); Should we rename all these structs net_failover? It's possible to extend the concep

Re: [virtio-dev] Re: [PATCH v7 net-next 2/4] net: Introduce generic failover module

2018-04-20 Thread Michael S. Tsirkin
On Fri, Apr 20, 2018 at 08:56:57AM -0700, Alexander Duyck wrote: > On Fri, Apr 20, 2018 at 8:34 AM, Michael S. Tsirkin wrote: > > On Fri, Apr 20, 2018 at 08:21:00AM -0700, Samudrala, Sridhar wrote: > >> > > + finfo = netdev_priv(failover_dev); > >> > > + > >> > > + primary_dev = rtnl_dereference(f

Re: [virtio-dev] Re: [PATCH v7 net-next 2/4] net: Introduce generic failover module

2018-04-20 Thread Alexander Duyck
On Fri, Apr 20, 2018 at 8:34 AM, Michael S. Tsirkin wrote: > On Fri, Apr 20, 2018 at 08:21:00AM -0700, Samudrala, Sridhar wrote: >> > > + finfo = netdev_priv(failover_dev); >> > > + >> > > + primary_dev = rtnl_dereference(finfo->primary_dev); >> > > + standby_dev = rtnl_dereference(finfo->standby_

[virtio-dev] Re: [PATCH v7 net-next 2/4] net: Introduce generic failover module

2018-04-20 Thread Michael S. Tsirkin
On Fri, Apr 20, 2018 at 08:21:00AM -0700, Samudrala, Sridhar wrote: > > > + finfo = netdev_priv(failover_dev); > > > + > > > + primary_dev = rtnl_dereference(finfo->primary_dev); > > > + standby_dev = rtnl_dereference(finfo->standby_dev); > > > + > > > + if (slave_dev != primary_dev && slave_dev !=

[virtio-dev] Re: [PATCH v7 net-next 2/4] net: Introduce generic failover module

2018-04-20 Thread Samudrala, Sridhar
On 4/19/2018 7:44 PM, Michael S. Tsirkin wrote: On Thu, Apr 19, 2018 at 06:42:02PM -0700, Sridhar Samudrala 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

[virtio-dev] Re: [PATCH v7 net-next 2/4] net: Introduce generic failover module

2018-04-19 Thread Michael S. Tsirkin
On Thu, Apr 19, 2018 at 06:42:02PM -0700, Sridhar Samudrala wrote: > +static struct net_device *failover_get_bymac(u8 *mac, struct failover_ops > **ops) > +{ > + struct net_device *failover_dev; > + struct failover *failover; > + > + spin_lock(&failover_lock); > + list_for_each_ent

[virtio-dev] Re: [PATCH v7 net-next 2/4] net: Introduce generic failover module

2018-04-19 Thread Michael S. Tsirkin
On Thu, Apr 19, 2018 at 06:42:02PM -0700, Sridhar Samudrala 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 c