From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S965324AbbLRBjr (ORCPT ); Thu, 17 Dec 2015 20:39:47 -0500 Received: from mx0b-00082601.pphosted.com ([67.231.153.30]:27386 "EHLO mx0b-00082601.pphosted.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S965162AbbLRBjp (ORCPT ); Thu, 17 Dec 2015 20:39:45 -0500 Date: Thu, 17 Dec 2015 17:39:20 -0800 From: Calvin Owens To: Stephen Hemminger CC: , , , , , , , Subject: Re: [PATCH] netconsole: Initialize after all core networking drivers Message-ID: <20151218013906.GA1715233@devbig337.prn1.facebook.com> References: <20151217235239.GA1444048@devbig337.prn1.facebook.com> <20151217171057.6c0d3b35@xeon-e3> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Disposition: inline In-Reply-To: <20151217171057.6c0d3b35@xeon-e3> User-Agent: Mutt/1.5.20 (2009-12-10) X-Originating-IP: [192.168.52.123] X-Proofpoint-Spam-Reason: safe X-FB-Internal: Safe X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10432:,, definitions=2015-12-18_01:,, signatures=0 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thursday 12/17 at 17:10 -0800, Stephen Hemminger wrote: > On Thu, 17 Dec 2015 15:52:39 -0800 > Calvin Owens wrote: > > > With built-in netconsole and IXGBE, configuring netconsole via the kernel > > cmdline results in the following panic at boot: > > > > netpoll: netconsole: device eth0 not up yet, forcing it > > usb 2-1: new high-speed USB device number 2 using ehci-pci > > ixgbe 0000:03:00.0: registered PHC device on eth0 > > BUG: unable to handle kernel NULL pointer dereference at 0000000000000810 > > > > Call Trace: > > [] ? vxlan_get_rx_port+0x41/0xa0 > > [] ixgbe_open+0x4e8/0x540 > > [] __dev_open+0xac/0x120 > > [] dev_open+0x36/0x70 > > [] netpoll_setup+0x23c/0x300 > > [] ? netpoll_parse_options+0x19a/0x200 > > [] ? option_setup+0x1f/0x1f > > [] init_netconsole+0xda/0x262 > > [] ? option_setup+0x1f/0x1f > > [] do_one_initcall+0x88/0x1b0 > > [] kernel_init_freeable+0x14a/0x1e3 > > [] ? do_early_param+0x8c/0x8c > > [] ? rest_init+0x80/0x80 > > [] kernel_init+0xe/0xe0 > > [] ret_from_fork+0x3f/0x70 > > [] ? rest_init+0x80/0x80 > > > > This happens because IXGBE assumes that vxlan has already been initialized. > > The cleanest way to fix this is to just initialize netconsole after all the > > other core networking stuff has completed. > > > > Signed-off-by: Calvin Owens > > Fixing this by changing Makefile order is too fragile. > You are depending on the fact that Makefile order determines link order > and that determines initialization order. Down that path demons lie. Hmm, include/linux/init.h explicitly states that "Ordering inside the subsections is determined by link order", and has since before the beginning of the history in Git. I agree it seems magic/scary, but as Eric says I would imagine this behavior is relied upon in other places.