From mboxrd@z Thu Jan 1 00:00:00 1970 From: Mahesh Bandewar Subject: Re: [PATCH v2 4/5] ipvlan: protect addresses with internal spinlock Date: Tue, 7 Jul 2015 21:05:00 -0700 Message-ID: References: <20150703125132.24121.50592.stgit@buzz> <20150703125840.24121.91556.stgit@buzz> Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Cc: linux-netdev , "David S. Miller" , Jiri Benc To: Konstantin Khlebnikov Return-path: Received: from mail-yk0-f169.google.com ([209.85.160.169]:35071 "EHLO mail-yk0-f169.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750886AbbGHEFU (ORCPT ); Wed, 8 Jul 2015 00:05:20 -0400 Received: by ykfs198 with SMTP id s198so92258602ykf.2 for ; Tue, 07 Jul 2015 21:05:19 -0700 (PDT) In-Reply-To: <20150703125840.24121.91556.stgit@buzz> Sender: netdev-owner@vger.kernel.org List-ID: On Fri, Jul 3, 2015 at 5:58 AM, Konstantin Khlebnikov wrote: > Inet6addr notifier is atomic and runs in bh context without RTNL when > ipv6 receives router advertisement packet and performs autoconfiguration. > > This patch adds ipvl_port->addr_lock and helpers: ipvlan_addr_lock_bh, > ipvlan_addr_unlock_bh for protecting ipvlan addresses and hash table. > Frankly I'm not comfortable adding spin-locks all over. I think any config that mostly takes place with RTNL makes sense but this inet6addr needs to be thought through and implanting spin-locks in IPvlan is a work-around for a problem some where else. Why can't a work-queue that takes RTNL to call inet6addr-notifier be implemented when called from bh? > Signed-off-by: Konstantin Khlebnikov > --- > drivers/net/ipvlan/ipvlan.h | 11 +++++++++++ > drivers/net/ipvlan/ipvlan_core.c | 2 -- > drivers/net/ipvlan/ipvlan_main.c | 33 ++++++++++++++++++++++++++++++--- > 3 files changed, 41 insertions(+), 5 deletions(-) > [snip]