From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mga03.intel.com (mga03.intel.com [134.134.136.65]) by dpdk.org (Postfix) with ESMTP id 4229B8D97 for ; Mon, 18 Jan 2016 15:19:24 +0100 (CET) Received: from orsmga002.jf.intel.com ([10.7.209.21]) by orsmga103.jf.intel.com with ESMTP; 18 Jan 2016 06:19:23 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.22,312,1449561600"; d="scan'208";a="893017377" Received: from yliu-dev.sh.intel.com (HELO yliu-dev) ([10.239.66.49]) by orsmga002.jf.intel.com with ESMTP; 18 Jan 2016 06:19:22 -0800 Date: Mon, 18 Jan 2016 22:21:25 +0800 From: Yuanhan Liu To: Kamil Rytarowski Message-ID: <20160118142125.GD19531@yliu-dev.sh.intel.com> References: <1449588833-485-1-git-send-email-Kamil.Rytarowski@caviumnetworks.com> <1449667198-27218-1-git-send-email-Kamil.Rytarowski@caviumnetworks.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1449667198-27218-1-git-send-email-Kamil.Rytarowski@caviumnetworks.com> User-Agent: Mutt/1.5.23 (2014-03-12) Cc: dev@dpdk.org Subject: Re: [dpdk-dev] [PATCH v5 1/2] tools: Add support for handling built-in kernel modules X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: patches and discussions about DPDK List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 18 Jan 2016 14:19:24 -0000 Hi Kamil, First of all, sorry for no one has reviewed your patches for over one month! You may want to ping more often (say, per week) next time if it still happenes :) Another thing is that there is no maintainer for tools code. On Wed, Dec 09, 2015 at 02:19:57PM +0100, Kamil Rytarowski wrote: > Currently dpdk_nic_bind.py detects Linux kernel modules via reading > /proc/modules. Built-in ones aren't listed there and therefore they are not > being found by the script. > > Add support for checking built-in modules with parsing the sysfs files. > > This commit obsoletes the /proc/modules parsing approach. > > Signed-off-by: Kamil Rytarowski > Signed-off-by: David Marchand > --- > tools/dpdk_nic_bind.py | 27 +++++++++++++++++---------- > 1 file changed, 17 insertions(+), 10 deletions(-) > > diff --git a/tools/dpdk_nic_bind.py b/tools/dpdk_nic_bind.py > index f02454e..e161062 100755 > --- a/tools/dpdk_nic_bind.py > +++ b/tools/dpdk_nic_bind.py > @@ -156,22 +156,29 @@ def check_modules(): > '''Checks that igb_uio is loaded''' > global dpdk_drivers > > - fd = file("/proc/modules") > - loaded_mods = fd.readlines() > - fd.close() > - > # list of supported modules > mods = [{"Name" : driver, "Found" : False} for driver in dpdk_drivers] > > # first check if module is loaded > - for line in loaded_mods: > + try: > + # Get list of syfs modules, some of them might be builtin and merge with mods > + sysfs_path = '/sys/module/' > + > + # Get the list of directories in sysfs_path > + sysfs_mods = [os.path.join(sysfs_path,o) for o in os.listdir(sysfs_path) if os.path.isdir(os.path.join(sysfs_path,o))] Minor nit: it's quite a long line; you may need break it. And space is needed after ','. Otherwise, this patch looks good to me. --yliu