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 32921A09DF; Thu, 3 Dec 2020 09:25:42 +0100 (CET) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id C7F53C982; Thu, 3 Dec 2020 09:25:40 +0100 (CET) Received: from NAM12-BN8-obe.outbound.protection.outlook.com (mail-bn8nam12on2084.outbound.protection.outlook.com [40.107.237.84]) by dpdk.org (Postfix) with ESMTP id C744937AF for ; Thu, 3 Dec 2020 09:25:37 +0100 (CET) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=miq4cXs2XkwekTx618pbGNUKgCQZqHz1YPEWolmWh0nth7maOTKwhcfbtplPc2vQeVyzNFyNXViwNeurrdOjpaQosO/iBEpWzekyPcw6zMZHWCRQXypTnZLpMy2f5q8x36o4lFyTY8kyU5s5AjPRLtvnocJlzBdqU0SzjudkNiQm+l/EPfPugjA6pTM7IWyIRkLFq9+faDExVmoeNBDlx5RmO1pGl4qKPUCq/mKjieBmWucfpox3jE96bh1fnoN8tU52hMVJd92o/+L+s2FT1UkLjClmlmI7E5GoVUsYg1FZpj4FGFRVlZCzXt8jPThsDcYaMZTwjx++scn+KwDigQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=y2Nt7TjzOmIh1JzRJ67gypunFEvEPSHanfy5lkVEXbo=; b=G3GQxIzgv3ytwUO7TW+KsgJ+5hqXAqNs7QHeYPG0of6NEVvzH6pJeMPSReMS1xmTDn3MGAmzDlowAhT/jMXczkj4AzPMH477WAUvbFgsDQZ2e0yErxnnXf8b3PWgzbpY4R/zPmPbKAqp1katC5Ma7LKkZgD3o4MjJo50LV8pjTS8+Km8joDmvl8+laNPZMR9XXYNIiuI7lPKDMY/Wx9QRU7ya/x8OS1ovQcXBYw/29BYqzsPChDvyQSDEBcYM+RvabMCDSTybYHVSajYxKVB41k7GmvENTQJrfa9qiU8kLN1ddOAJXc/xZItOjw490WDOYJLAXO9Io0bT3mapafAhA== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=windriver.com; dmarc=pass action=none header.from=windriver.com; dkim=pass header.d=windriver.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=windriversystems.onmicrosoft.com; s=selector2-windriversystems-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=y2Nt7TjzOmIh1JzRJ67gypunFEvEPSHanfy5lkVEXbo=; b=OrGeWRc21siAPEJh6y4dtlKSEFbYpa9Ss25eKmV1jHLJljVtgzz7JU8g+t2t7kUnLOutL6L5y7plsJ9FkFCeJGjj8vgZ3YL6nFTCTPvl8yFqpjpUDhV5Ut4zBu+J8V0UR9OkNpGqJzTE2QCbyLqg+j61WIoP/kh0bLZJ7yyxq6c= Received: from BYAPR11MB2600.namprd11.prod.outlook.com (2603:10b6:a02:c8::15) by BY5PR11MB4005.namprd11.prod.outlook.com (2603:10b6:a03:18c::15) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3632.17; Thu, 3 Dec 2020 08:25:34 +0000 Received: from BYAPR11MB2600.namprd11.prod.outlook.com ([fe80::9c3a:15e0:fe83:ffd9]) by BYAPR11MB2600.namprd11.prod.outlook.com ([fe80::9c3a:15e0:fe83:ffd9%7]) with mapi id 15.20.3632.018; Thu, 3 Dec 2020 08:25:34 +0000 From: "Liu, Yongxin" To: "Liu, Yongxin" , "dev@dpdk.org" , "anatoly.burakov@intel.com" , "thomas@monjalon.net" Thread-Topic: [dpdk-dev] [PATCH v5] usertools/devbind: fix binding for built-in kernel drivers Thread-Index: AQHWyU3eovrdFOACj0yHQxZY3A8HTQ== Date: Thu, 3 Dec 2020 08:25:34 +0000 Message-ID: References: <20201118025854.13455-1-yongxin.liu@windriver.com> <20201123030533.17944-1-yongxin.liu@windriver.com> In-Reply-To: <20201123030533.17944-1-yongxin.liu@windriver.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: authentication-results: windriver.com; dkim=none (message not signed) header.d=none;windriver.com; dmarc=none action=none header.from=windriver.com; x-originating-ip: [60.247.85.82] x-ms-publictraffictype: Email x-ms-office365-filtering-correlation-id: 4ea22524-c336-4e77-7b36-08d897650181 x-ms-traffictypediagnostic: BY5PR11MB4005: x-ms-exchange-transport-forked: True x-microsoft-antispam-prvs: x-ms-oob-tlc-oobclassifiers: OLM:1051; x-ms-exchange-senderadcheck: 1 x-microsoft-antispam: BCL:0; x-microsoft-antispam-message-info: aBzhQQMd9o+3xtgC2/L48FSmDGXE1asmBOl/exO4vwegxz90cSB5FQdLlCuf6Yym6rMI87ovf6PRT8pYwVm9fsboWFsalrLI2h7gZxjXVfsuplp1S0gbv8N5Wh4UGIWdEzvvc+McvYYn+UiVWZc5R3eEjsUeIHL10QEpPp1C+WZeZLaodL4Z1zidMr77ALGfzzr/MRBmnIRQSt7DNXiJ/bRUqlgYZMpd/oOIr6h7ip09XbpkpbBvDefN7RoX/2uFB5IeYFMDo+J9qWpbWgrvr75y4SgyXI/jHX2OM64o5IZlZ9OyB9RY/iTzZc9V1WQn x-forefront-antispam-report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:BYAPR11MB2600.namprd11.prod.outlook.com; PTR:; CAT:NONE; SFS:(4636009)(346002)(366004)(39850400004)(376002)(136003)(396003)(53546011)(110136005)(9686003)(2906002)(186003)(26005)(316002)(7696005)(33656002)(6506007)(71200400001)(8936002)(76116006)(5660300002)(66476007)(66446008)(66946007)(66556008)(64756008)(52536014)(478600001)(86362001)(55016002)(83380400001); DIR:OUT; SFP:1101; x-ms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E6H0ldwztIHBhU613VWtbSegRdBFsaPUUvWFlK1gRoqIoWl?= =?us-ascii?Q?RO3R/AX5MpV1CI20LLCjjR3UWfP44rx+ucYolO46yjmVWB6ilKXH7b95RxTe?= =?us-ascii?Q?WKcLR10iq/AS3+rmF3dCY571D+ECge+sMMvVJcFUWZI=3D?= Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-OriginatorOrg: windriver.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-AuthSource: BYAPR11MB2600.namprd11.prod.outlook.com X-MS-Exchange-CrossTenant-Network-Message-Id: 4ea22524-c336-4e77-7b36-08d897650181 X-MS-Exchange-CrossTenant-originalarrivaltime: 03 Dec 2020 08:25:34.5139 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 8ddb2873-a1ad-4a18-ae4e-4644631433be X-MS-Exchange-CrossTenant-mailboxtype: HOSTED X-MS-Exchange-CrossTenant-userprincipalname: kszZGMMea7ED7HUi5Y6atvXzUbDw2uc2OQL0FPIMb1WDxFJ/z9o1g8DMMg9BLb08046Fijj42LKmSh6TpVWZ/VWkKKz5fTp2QhKeor0DnTg= X-MS-Exchange-Transport-CrossTenantHeadersStamped: BY5PR11MB4005 Subject: Re: [dpdk-dev] [PATCH v5] usertools/devbind: fix binding for built-in kernel 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" Hi Anatoly, Do you have any further comments on this v5? Or you can submit your own patch directly. I am really expecting this issue to be fixed. Thank you very much. Yongxin > -----Original Message----- > From: dev On Behalf Of Yongxin Liu > Sent: Monday, November 23, 2020 11:06 > To: dev@dpdk.org; anatoly.burakov@intel.com; thomas@monjalon.net > Subject: [dpdk-dev] [PATCH v5] usertools/devbind: fix binding for built-i= n > kernel drivers >=20 > A driver can be loaded as a dynamic module or a built-in module. > In commit 681a67288655 ("usertools: check if module is loaded before > binding"), script only checks modules in /sys/module/. >=20 > However, for built-in kernel driver, it only shows up in /sys/module/, if > it has a version or at least one parameter. So add check for modules in > /lib/modules/$(uname -r)/modules.builtin. >=20 > Signed-off-by: Yongxin Liu > --- >=20 > v5: > - Make code robust and more memory efficient. >=20 > v4: > - Replace shell call with platform.uname(). Check file existence > before reading. >=20 > v3: > - Add built-in module list in loaded_modules for checking > instead of removing error check. >=20 > v2: > - fix git commit description style in commit log > - fix typo spelling >=20 > --- > usertools/dpdk-devbind.py | 13 ++++++++++++- > 1 file changed, 12 insertions(+), 1 deletion(-) >=20 > diff --git a/usertools/dpdk-devbind.py b/usertools/dpdk-devbind.py index > 054ad2e1c..4bc0b6207 100755 > --- a/usertools/dpdk-devbind.py > +++ b/usertools/dpdk-devbind.py > @@ -7,6 +7,7 @@ > import os > import subprocess > import argparse > +import platform >=20 > from glob import glob > from os.path import exists, basename > @@ -107,7 +108,17 @@ def module_is_loaded(module): >=20 > loaded_modules =3D sysfs_mods >=20 > - return module in sysfs_mods > + # add built-in modules as loaded > + release =3D platform.uname().release > + filename =3D os.path.join("/lib/modules/", release, "modules.builtin= ") > + if os.path.exists(filename): > + try: > + with open(filename) as f: > + loaded_modules +=3D > [os.path.splitext(os.path.basename(mod))[0] for mod in f] > + except IOError: > + print("Warning: cannot read list of built-in kernel > + modules") > + > + return module in loaded_modules >=20 >=20 > def check_modules(): > -- > 2.14.4