From owner-freebsd-net@FreeBSD.ORG Wed Oct 31 13:10:33 2012 Return-Path: Delivered-To: net@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id C56DEDA9; Wed, 31 Oct 2012 13:10:33 +0000 (UTC) (envelope-from melifaro@FreeBSD.org) Received: from mail.ipfw.ru (unknown [IPv6:2a01:4f8:120:6141::2]) by mx1.freebsd.org (Postfix) with ESMTP id 5506C8FC16; Wed, 31 Oct 2012 13:10:33 +0000 (UTC) Received: from [2a02:6b8:0:401:222:4dff:fe50:cd2f] (helo=dhcp170-36-red.yandex.net) by mail.ipfw.ru with esmtpsa (TLSv1:CAMELLIA256-SHA:256) (Exim 4.76 (FreeBSD)) (envelope-from ) id 1TTY7M-0009dC-9U; Wed, 31 Oct 2012 17:14:00 +0400 Message-ID: <509122E1.3020408@FreeBSD.org> Date: Wed, 31 Oct 2012 17:08:49 +0400 From: "Alexander V. Chernikov" User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:13.0) Gecko/20120627 Thunderbird/13.0.1 MIME-Version: 1.0 To: Ryan Stone Subject: Re: ixgbe & if_igb RX ring locking References: <5079A9A1.4070403@FreeBSD.org> <20121015162926.GV89655@FreeBSD.org> <507D4F11.2030704@FreeBSD.org> <20121016124733.GC89655@glebius.int.ru> <50843D39.5000003@FreeBSD.org> In-Reply-To: Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Cc: Jack Vogel , net@freebsd.org X-BeenThere: freebsd-net@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: Networking and TCP/IP with FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 31 Oct 2012 13:10:33 -0000 On 22.10.2012 05:43, Ryan Stone wrote: > On Sun, Oct 21, 2012 at 2:21 PM, Alexander V. Chernikov > wrote: >>> ix:rx -> udp is also fairly obvious (here's one backtrace): >> The same question, where "udp" -> "ix:rx" can happen ? > > It can't happen directly as far as I can tell. But to trigger a > deadlock, "all" that has to happen is that a thread holds each mutex > in the cycle while trying to acquire the next mutex in the cycle. I Sorry, which mutex ? What cycle? > realize that in this case that requires five separate threads to all 5? > lose a race simultaneously, but it's still theoretically possible and > needs to be avoided. Can you please be more explicit? Once again, initial point of discussion was: do we _really_ need to unlock rx ring before calling if_input? It has been said that there are some complicated cases, where something bad can happen so we still need to call unlock. That's OK and we probably should try to fix such cases generally in networking stack if we can (maybe by saying explicitly that, say, ioctl calls are forbidden in ithreads). However, it is still unclear (at least to me) how both LORs can really happen in current code (especially given modified ixgbe driver in your traces). > _______________________________________________ > freebsd-net@freebsd.org mailing list > http://lists.freebsd.org/mailman/listinfo/freebsd-net > To unsubscribe, send any mail to "freebsd-net-unsubscribe@freebsd.org" > -- WBR, Alexander