From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from dpdk.org (dpdk.org [92.243.14.124]) by inbox.dpdk.org (Postfix) with ESMTP id D126BA04DD; Wed, 18 Nov 2020 17:27:46 +0100 (CET) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 562BC3B5; Wed, 18 Nov 2020 17:27:44 +0100 (CET) Received: from mga09.intel.com (mga09.intel.com [134.134.136.24]) by dpdk.org (Postfix) with ESMTP id C552BA3 for ; Wed, 18 Nov 2020 17:27:42 +0100 (CET) IronPort-SDR: 9+oYcKc/fow2ZOd0bNyobxAgKx2WQRmmrNv04aIuN5sc525t0AupuMr1WW8UGcXmWX0BBYkoCN Cf3H8AII0Ghg== X-IronPort-AV: E=McAfee;i="6000,8403,9809"; a="171311002" X-IronPort-AV: E=Sophos;i="5.77,488,1596524400"; d="scan'208";a="171311002" X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga004.jf.intel.com ([10.7.209.38]) by orsmga102.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 18 Nov 2020 08:27:40 -0800 IronPort-SDR: 6I2vCB+8jJwJ4Wc+zkks64r58+wRJTlaDtk8S3RV5Z/Av+6thN4w4ygOpmlgqiNF4/M5vrq7Yl czm3pz0pcSCQ== X-IronPort-AV: E=Sophos;i="5.77,488,1596524400"; d="scan'208";a="476415690" Received: from aburakov-mobl.ger.corp.intel.com (HELO [10.213.228.188]) ([10.213.228.188]) by orsmga004-auth.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 18 Nov 2020 08:27:34 -0800 To: Yongxin Liu , dev@dpdk.org, thomas@monjalon.net References: <20201118025854.13455-1-yongxin.liu@windriver.com> From: "Burakov, Anatoly" Message-ID: Date: Wed, 18 Nov 2020 16:27:32 +0000 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:68.0) Gecko/20100101 Thunderbird/68.12.0 MIME-Version: 1.0 In-Reply-To: <20201118025854.13455-1-yongxin.liu@windriver.com> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit Subject: Re: [dpdk-dev] [PATCH v2] usertools/devbind: fix binding for built-in 1kernel drivers X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" On 18-Nov-20 2:58 AM, Yongxin Liu wrote: > In commit 681a67288655 ("usertools: check if module is loaded before > binding"), script will exit if no driver is found in /sys/module/. > > However, for built-in kernel driver, /sys/module/MODULENAME only > shows up if it has a version or at least one parameter. Take ixgbe > for example, after kernel commit 34a2a3b83e2c ("net/intel: remove > driver versions from Intel drivers"), and if ixgbe is built directly > into kernel, there is no ixgbe folder in /sys/module. So the devbind > script should not exit. > > Signed-off-by: Yongxin Liu > --- > > v2: > - fix git commit description style in commit log > - fix typo spelling > > --- > usertools/dpdk-devbind.py | 4 ---- > 1 file changed, 4 deletions(-) > > diff --git a/usertools/dpdk-devbind.py b/usertools/dpdk-devbind.py > index 99112b7ab..f3c0d9814 100755 > --- a/usertools/dpdk-devbind.py > +++ b/usertools/dpdk-devbind.py > @@ -530,10 +530,6 @@ def bind_all(dev_list, driver, force=False): > # driver generated error - it's not a valid device ID, so all is well > pass > > - # check if we're attempting to bind to a driver that isn't loaded > - if not module_is_loaded(driver.replace('-','_')): > - sys.exit("Error: Driver '%s' is not loaded." % driver) > - I believe there is a way to check if module is built-in, can't we use that? We could keep a list of built-in modules of interest that we can get from: cat /lib/modules/$(uname -r)/modules.builtin It's a bit more changes, but this is better than just removing the error check. > try: > dev_list = map(dev_id_from_dev_name, dev_list) > except ValueError as ex: > -- Thanks, Anatoly