From owner-freebsd-net@FreeBSD.ORG Thu Sep 27 12:53:58 2012 Return-Path: Delivered-To: freebsd-net@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 43F451065673 for ; Thu, 27 Sep 2012 12:53:58 +0000 (UTC) (envelope-from jhb@freebsd.org) Received: from bigwig.baldwin.cx (bigknife-pt.tunnel.tserv9.chi1.ipv6.he.net [IPv6:2001:470:1f10:75::2]) by mx1.freebsd.org (Postfix) with ESMTP id 186038FC22 for ; Thu, 27 Sep 2012 12:53:58 +0000 (UTC) Received: from jhbbsd.localnet (unknown [209.249.190.124]) by bigwig.baldwin.cx (Postfix) with ESMTPSA id 5EB29B944; Thu, 27 Sep 2012 08:53:57 -0400 (EDT) From: John Baldwin To: Ryan Stone Date: Thu, 27 Sep 2012 07:58:43 -0400 User-Agent: KMail/1.13.5 (FreeBSD/8.2-CBSD-20110714-p20; KDE/4.5.5; amd64; ; ) References: <201209261538.11588.jhb@freebsd.org> In-Reply-To: MIME-Version: 1.0 Content-Type: Text/Plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit Message-Id: <201209270758.43445.jhb@freebsd.org> X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.2.7 (bigwig.baldwin.cx); Thu, 27 Sep 2012 08:53:57 -0400 (EDT) Cc: freebsd-net@freebsd.org, Jack Vogel , Vijay Singh Subject: Re: ixgbe rx & tx locks X-BeenThere: freebsd-net@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Networking and TCP/IP with FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 27 Sep 2012 12:53:58 -0000 On Wednesday, September 26, 2012 5:28:09 pm Ryan Stone wrote: > On Wed, Sep 26, 2012 at 3:38 PM, John Baldwin wrote: > >> ix:rx -> udp -> udpinp -> in_multi_mtx -> ix:core -> ix:rx > > > > Hmm, I'm not sure where the 'in_multi_mtx -> ix:core' bit comes from. > > I think that is the broken part of this. The SIOCADDMULTI and SIOCDELMULTI > > ioctls are invoked without any stack locks held, so it shouldn't come from > > there. > > I gave the backtrace for this part. in_joingroup_locked is called > with the in_multi_mtx held, which calls if_addmulti, which calls the > ioctl handler. My bad. Too many locks. :( We do drop the IF_ADDR_LOCK when calling if_ioctl from if_addmulti(), but you are correct, in_multi_mtx is held. Not sure how resolvable that is. Many drivers need to do a fair bit of work in SIOCADDMULTI/SIOCDELMUTLI (that is, reprogram the entire multicast table). One alternative might be to use a separate lock just for the MAC filters. That might break the in_multi_mtx -> ix:core order by letting you avoid grabbing ix:core for those ioctls. -- John Baldwin