From mboxrd@z Thu Jan 1 00:00:00 1970 From: Stephen Hemminger Subject: Re: [PATCH net-next v12 1/5] net: Introduce generic failover module Date: Fri, 25 May 2018 15:37:44 -0700 Message-ID: <20180525153744.2b53c449@xeon-e3> References: <1527180917-39737-1-git-send-email-sridhar.samudrala@intel.com> <1527180917-39737-2-git-send-email-sridhar.samudrala@intel.com> Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Cc: mst@redhat.com, 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, jiri@resnulli.us, aaron.f.brown@intel.com, anjali.singhai@intel.com To: Sridhar Samudrala Return-path: Received: from mail-pg0-f68.google.com ([74.125.83.68]:46150 "EHLO mail-pg0-f68.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1030394AbeEYWhr (ORCPT ); Fri, 25 May 2018 18:37:47 -0400 Received: by mail-pg0-f68.google.com with SMTP id a3-v6so2841293pgt.13 for ; Fri, 25 May 2018 15:37:47 -0700 (PDT) In-Reply-To: <1527180917-39737-2-git-send-email-sridhar.samudrala@intel.com> Sender: netdev-owner@vger.kernel.org List-ID: On Thu, 24 May 2018 09:55:13 -0700 Sridhar Samudrala wrote: > + spin_lock(&failover_lock); Since register is not in fast path, this should be a mutex? > +int failover_slave_unregister(struct net_device *slave_dev) > +{ > + struct net_device *failover_dev; > + struct failover_ops *fops; > + > + if (!netif_is_failover_slave(slave_dev)) > + goto done; > + > + ASSERT_RTNL(); > + > + failover_dev = failover_get_bymac(slave_dev->perm_addr, &fops); > + if (!failover_dev) > + goto done; Since the slave device must have a master device set already, why not use that instead of searching by MAC address on unregister or link change.