Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.0 required=3.0 tests=HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,SIGNED_OFF_BY,SPF_PASS,USER_AGENT_NEOMUTT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 49C31C282C0 for ; Tue, 22 Jan 2019 02:38:53 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 1F81B20870 for ; Tue, 22 Jan 2019 02:38:53 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726907AbfAVCiv (ORCPT ); Mon, 21 Jan 2019 21:38:51 -0500 Received: from mga03.intel.com ([134.134.136.65]:30130 "EHLO mga03.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725950AbfAVCiv (ORCPT ); Mon, 21 Jan 2019 21:38:51 -0500 X-Amp-Result: UNSCANNABLE X-Amp-File-Uploaded: False Received: from orsmga002.jf.intel.com ([10.7.209.21]) by orsmga103.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 21 Jan 2019 18:38:50 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.56,504,1539673200"; d="scan'208";a="127797407" Received: from shbuild888.sh.intel.com (HELO localhost) ([10.239.147.114]) by orsmga002.jf.intel.com with ESMTP; 21 Jan 2019 18:38:49 -0800 Date: Tue, 22 Jan 2019 10:39:39 +0800 From: Feng Tang To: Alexander Duyck Cc: Jeff Kirsher , "David S . Miller" , intel-wired-lan , Netdev Subject: Re: [Intel-wired-lan] [PATCH] igb: Make driver init async Message-ID: <20190122023939.sm37g4eqb5d5ixyb@shbuild888> References: <1548059825-78171-1-git-send-email-feng.tang@intel.com> <20190122014029.wrqvt3hfl3ee7g2x@shbuild888> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: NeoMutt/20170609 (1.8.3) Sender: netdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org Hi Alexander, On Mon, Jan 21, 2019 at 06:29:51PM -0800, Alexander Duyck wrote: > On Mon, Jan 21, 2019 at 5:39 PM Feng Tang wrote: > > > > Hi Duyck, > > > > Thanks for your review! > > > > On Mon, Jan 21, 2019 at 02:50:08PM -0800, Alexander Duyck wrote: > > > On Mon, Jan 21, 2019 at 12:36 AM Feng Tang wrote: > > > > > > > > When optimizing boot time for a platform with igb module, we found the > > > > igb driver probe will take about 45 ms, make the probe asynchronous > > > > will save quite some time as the init runs in parallel with other > > > > asynchronous drivers. > > > > > > > > In theory, this could be applied to some other drivers like igc or > > > > e1000, but we don't have HW to verify that. > > > > > > > > Signed-off-by: Feng Tang > > > > > > I really don't like this patch. This seems like you are tuning for a > > > specific platform or system setup by making changes to the driver. Is > > > there any reason why you couldn't just pass the module parameter > > > "igb.async_probe" to accomplish the same thing? > > > > Thanks for the info. I didn't make it clear, in some case we need it to > > be builtin, and this doesn't work per my try. > > Well then why not try implementing a similar feature that could be > used for built-in drivers. My point is that it is really bad to be > modifying a driver to work for a specific use case. It makes the > driver overly brittle from a maintenance point of view. Ok, I see. > > > > I suspect most people > > > won't care that much about the 45ms boot time difference, and if we > > > > Yes, 45ms is trivial to Desktop/Server. But our platform is for automotive > > and IOTG case, and these count there. US Department of Transportation > > has a requirement that the rear-view camera needs to be functional in 2 > > seconds after power on. To achieve that, we've done things to get 20ms > > from PCI init, 5ms from disabling some ACPI_PM clocksource :) > > That is your set of requirements. There are multiple other users of > this driver out there. We cannot just go in and arbitrarily change > core behaviors for one specific use case. I would much prefer this to > be something that can be changed either via a sysctl or via a module > parameter so that we can have this behavior turned off by default if > so desired. > > > > were to make this sort of change it should probably be more > > > generically applied to either PCI devices or network devices instead > > > of doing this one driver at a time. > > > > Agree. I also mentioned this in commit log, I didn't do it for other drivers > > as I don't have HW to verify, and I would be happy to proceed if > > experts for those HW think this change is fine. > > You normally don't need to test all possible hardware that could be > impacted by a change, but what you should do is try to test what you > have available. > > This sort of change would make more sense as a PCI feature where you > essentially cause endpoint devices to asynchronously probe instead of > doing so synchronously if a certain kernel module parameter is set. > Otherwise if you ever change drivers in the future for some design you > will have to submit yet another patch for this. So for example one > thing you might look at doing is adding a new option for the "pci=" > module parameter. You could specify for example something like > "pci=async_probe=pci:8086:1533" and then that would specify all i210 This is really a good suggestion, which is much more flexible. I will do some try in this direction. > adapters with that device ID would be asynchronously probed instead of > going through the standard probe path. > > > Technically I think it's fine, as making them async will only push their > > init later, which won't break their existing dependence. And there should > > be very few modules which depend on network drivers. > > Actually this will break functionality on the 82576 quad port > adapters. Specifically we are using a static counter to identify which > groupings of 4 ports belonged together using the global_quad_port_a > value. With this changing to asynchronous you will end up confusing > the driver resulting in it randomly assigning WOL to possibly the > wrong port since the async code doesn't guarantee ordering of the > probe routines. Didn't know that, and thanks for the detaied info! - Feng > That would be another good reason why this should be handled as a per > PCI device/function type feature instead of trying to just make it > apply to all of igb. > > > Thanks, > > Feng > > > > Thanks. > > - Alex