From owner-svn-src-all@FreeBSD.ORG Mon Dec 8 08:36:05 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id BE60DB4C; Mon, 8 Dec 2014 08:36:05 +0000 (UTC) Received: from mail.fer.hr (mail.fer.hr [161.53.72.233]) (using TLSv1 with cipher AES128-SHA (128/128 bits)) (Client CN "mail.fer.hr", Issuer "TERENA SSL CA" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 511D2D73; Mon, 8 Dec 2014 08:36:04 +0000 (UTC) Received: from x23 (161.53.63.210) by MAIL.fer.hr (161.53.72.233) with Microsoft SMTP Server (TLS) id 14.2.342.3; Mon, 8 Dec 2014 09:35:55 +0100 Date: Mon, 8 Dec 2014 09:36:06 +0100 From: Marko Zec To: Craig Rodrigues Subject: Re: svn commit: r275599 - in head/sys/ofed/include: linux net Message-ID: <20141208093606.0960142f@x23> In-Reply-To: <201412080726.sB87Q0Yw034908@svn.freebsd.org> References: <201412080726.sB87Q0Yw034908@svn.freebsd.org> X-Mailer: Claws Mail 3.11.1 (GTK+ 2.24.22; amd64-portbld-freebsd10.0) MIME-Version: 1.0 Content-Type: text/plain; charset="US-ASCII" Content-Transfer-Encoding: 7bit X-Originating-IP: [161.53.63.210] Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org, hselasky@freebsd.org X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 08 Dec 2014 08:36:05 -0000 On Mon, 8 Dec 2014 07:26:00 +0000 Craig Rodrigues wrote: > Author: rodrigc > Date: Mon Dec 8 07:25:59 2014 > New Revision: 275599 > URL: https://svnweb.freebsd.org/changeset/base/275599 > > Log: > Use CURVNET macros inside inet_get_local_port_range() function. > Without this fix, a kernel with VIMAGE + Infiniband will panic on > bootup. Why is CURVNET_SET_QUIET() used here instead of plain CURVNET_SET()? inet_get_local_port_range() seems to be called from only two functions: cma_alloc_any_port() and cma_init(). Did the panic ocur in both, or only in cma_init()? If so, then CURVNET_SET() should have been placed only inside cma_init() and not in inet_get_local_port_range(). And perhaps all of this stuff could have been completely avoided if cma_init() was scheduled to fire with curvnet contex already set to vnet0, using proper SYSINIT scheduling instead of module_init(), i.e. after SI_SUB_VNET and before SI_SUB_VNET_DONE? Finally, the comment re. extra #includes and LIST_HEAD seems confusing since TD_TO_VNET() macro requires both sys/jail.h and net/vnet.h, and this dependency is unrelated to the LIST_HEAD macro cited in commit log. Marko > Certain necessary #include statements require LIST_HEAD. > Add these includes to ofed/include/linux/list.h, because > LIST_HEAD is specifically overridden in this file. > > PR: 191468 > Differential Revision: D1279 > Reviewed by: hselasky > > Modified: > head/sys/ofed/include/linux/list.h > head/sys/ofed/include/net/ip.h > > Modified: head/sys/ofed/include/linux/list.h > ============================================================================== > --- head/sys/ofed/include/linux/list.h Mon Dec 8 07:14:25 > 2014 (r275598) +++ head/sys/ofed/include/linux/list.h > Mon Dec 8 07:25:59 2014 (r275599) @@ -40,6 +40,7 @@ > #include > #include > #include > +#include > #include > #include > #include > @@ -53,6 +54,7 @@ > #include > #include > #include > +#include > > #include > #include > > Modified: head/sys/ofed/include/net/ip.h > ============================================================================== > --- head/sys/ofed/include/net/ip.h Mon Dec 8 07:14:25 > 2014 (r275598) +++ head/sys/ofed/include/net/ip.h Mon > Dec 8 07:25:59 2014 (r275599) @@ -45,8 +45,10 @@ > #ifdef INET > static inline void inet_get_local_port_range(int *low, int *high) > { > + CURVNET_SET_QUIET(TD_TO_VNET(curthread)); > *low = V_ipport_firstauto; > *high = V_ipport_lastauto; > + CURVNET_RESTORE(); > } > > static inline void >