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 A97F8A04DD; Thu, 19 Nov 2020 08:21:19 +0100 (CET) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 4BFE9F3E; Thu, 19 Nov 2020 08:21:17 +0100 (CET) Received: from NAM11-CO1-obe.outbound.protection.outlook.com (mail-co1nam11on2041.outbound.protection.outlook.com [40.107.220.41]) by dpdk.org (Postfix) with ESMTP id 095582AB for ; Thu, 19 Nov 2020 08:21:15 +0100 (CET) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=gIgCNTELGX0HMS7Et+fHw2xoaue0p0y3uliu767EPmFkTN+/OVytFXej27P1hQtRyerBfWF9HDLLL64lTWyvLpj2zebrBlL9EM8RmZpa/v6vOp/1YST8WE3jug20nsAMoKjW7Lgbc4O1N0XcmKAtgOW/JUAW6WHmfjjlcsgMgCkv+N5qkSy9yN9A04W5n3VsGVPthsotQgexUmPp6cnG9yIW7x15WXr2RC+Fc1RuR9HyVHGeadST9dp6XWe8dmTNhEHdviOeQvvTPVaBAd3Hknpl6tSUkU0qVDemtW/zZXOl3tAWMj6XSikLWEVVmTuDQ9GcSmIDWFPyPoS8h4U5jw== 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=eAcYHq/gLmQSapwFBDmHEVh9bzQ3TJ1mC2k1FS2KKpw=; b=EBXCWWRvJF75enojPwwXVw+8TKbrSOeZHJ4l0aY7Qdkhwrk8mKzf7w6aXzWCcMOdT2VnAntPPSBUXIPtzQs5XN6wGgxM2DQD+2JvGWpIGneRuyLj5shTicrjKpA4x+Q4JZXYiCxIhWEDF83tUHDSMS6cUN/jpCodPwukEh4gKa6V0UK+UA+IVdNXLrJCs16Bygoav8dWtqMvKLrIc9pT000UrQMX4yT7WLJ8u/+IeJgES/h5qIoApJXvveMUxxg6NLTqWkk3F2tMnIRhnFr+3VefFKv1JBHFekghJ+nLz1UMeD/td2DEVTYv8im2ACzj1+ptKq9diH0H0mpHso++5A== 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=eAcYHq/gLmQSapwFBDmHEVh9bzQ3TJ1mC2k1FS2KKpw=; b=jYLwBYq9+fW4xiIZCjpPwJh2lbHP9x4e/NW/ZwZi6zX9dmAH6kRlsIyB73gbEsAHMqvGBkf1BiVsdGrMO2HcD+qFYedoWwmJbb7EnYoU37mKpN28e5EoChwZYOiNV+N0fKtRJuU4fzslkRRl3+9/gebtx0gnap7XBqFjB75ORXg= Authentication-Results: dpdk.org; dkim=none (message not signed) header.d=none;dpdk.org; dmarc=none action=none header.from=windriver.com; Received: from BYAPR11MB2600.namprd11.prod.outlook.com (2603:10b6:a02:c8::15) by BY5PR11MB4401.namprd11.prod.outlook.com (2603:10b6:a03:1be::13) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3564.28; Thu, 19 Nov 2020 07:21:12 +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.3589.022; Thu, 19 Nov 2020 07:21:11 +0000 From: Yongxin Liu To: dev@dpdk.org, anatoly.burakov@intel.com, thomas@monjalon.net Date: Thu, 19 Nov 2020 15:16:46 +0800 Message-Id: <20201119071646.10052-1-yongxin.liu@windriver.com> X-Mailer: git-send-email 2.14.4 In-Reply-To: <20201118025854.13455-1-yongxin.liu@windriver.com> References: <20201118025854.13455-1-yongxin.liu@windriver.com> Content-Type: text/plain X-Originating-IP: [60.247.85.82] X-ClientProxiedBy: HK2PR04CA0078.apcprd04.prod.outlook.com (2603:1096:202:15::22) To BYAPR11MB2600.namprd11.prod.outlook.com (2603:10b6:a02:c8::15) MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 Received: from pek-lpggp6.wrs.com (60.247.85.82) by HK2PR04CA0078.apcprd04.prod.outlook.com (2603:1096:202:15::22) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3589.20 via Frontend Transport; Thu, 19 Nov 2020 07:21:10 +0000 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 45d5d2c1-4dcc-4ed9-c3bd-08d88c5bb145 X-MS-TrafficTypeDiagnostic: BY5PR11MB4401: X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:374; X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: lnfYq5AGesEqrb+GQJjZHi8W5Fo9BpyVmmhJqsauSFBdZ0vR9FTiy4thXatFxF/q+5ZmMaWjI80q4t/o9AX5Xr1iXS0d5UFRwjTsygvFnCr3LMuNYqpvFO3xv6cpoTxd+NI4Xd+HMfaCYc4iDKNGi1zWtdZpcN5zEIXa62VkVqTfiz22nWiEFNOv5enPD+dyClqOfRGaNaj1EXbpJPn0UBf9V4aa7Ob67H3ImTpoPktmMlpg+6tSoEATaK4ms6C6H7sS6wLVf6NdTlq3xfLeqsjM2nv7WWmD5pca3dbLV05xBfgtoNRqH5hy7xSOn8402qH2exswf35R5yMyaJuXGg== 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)(366004)(39850400004)(376002)(396003)(346002)(136003)(6666004)(36756003)(44832011)(2616005)(26005)(956004)(478600001)(16526019)(186003)(86362001)(66556008)(316002)(6512007)(6486002)(1076003)(66476007)(66946007)(6506007)(5660300002)(52116002)(83380400001)(8676002)(8936002)(2906002); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData: xj8S7yrgtvGY+Vihvp32H89qiTettrlVI1Uxjf9iXExexACveu2eSvBa2lnhwhXtUM2G9tN3y2Wd1hLS7b8oB6xODdm1A/jkBspkoqjwtmu86Np7w0LFMRB0P+sYx3g5NKN6q2xUeaTTxXUS0z4gdpxHhcqI4wiBTR8kFNV3SrBJ+WGQak0ZP/drHdyCEe4W9/Re0D1i+TkaEs8s+PghtRQN74xpvDIh7c5UqhgaLpJx+WAXQtD6v/SHG/kTTlvq41dlLikxVTPJUKqCie5iTI0HYp1CqyVHhgSOssQxi4dU4+0Aub7t2BVEKWHi4KbhR3w859+3pl1nNOLcxGEgPOOERRMvBJdV0TinJEuafMuwL6djphlBP/JKRYYEhFb+DnD2XUyp9sS9+7SbyxQDNsDpVnJW8b8EXwXsAjZeP6U38xiM6OU9BP8zfeT4l2qYOe9HNjDV7LO73iXi1GWVSzsOrvfs/rgV/xb8Gna2H4DsdDtrI8mKNby3sfk3NaXGnryAu1Xc2VpSLuygDKO5ervw8k3oVsU3UZs5C7xPNGaE+6kC7vVW/uKQpPlkpXzXDhZAVBRWAlCWi1710ePTb2crCHmLsKMrDs8dNgjuaFeElpHQAzPD+RqwXnLuFicZ5SWF0DsJoLGFC2IvyNoQvg== X-OriginatorOrg: windriver.com X-MS-Exchange-CrossTenant-Network-Message-Id: 45d5d2c1-4dcc-4ed9-c3bd-08d88c5bb145 X-MS-Exchange-CrossTenant-AuthSource: BYAPR11MB2600.namprd11.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 19 Nov 2020 07:21:11.8995 (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: etsb2JaZdMG8f+arxkF1PZHqigMpB316M3O8AHUg7spkjBD8nYd+x8CF+gTKpwkr4FbMJFwVLUyqOEfGy4+QX/hUFDqE4O5SukotsxdtDTA= X-MS-Exchange-Transport-CrossTenantHeadersStamped: BY5PR11MB4401 Subject: [dpdk-dev] [PATCH v3] 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" 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/. 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. Thanks for Anatoly Burakov's advice. Signed-off-by: Yongxin Liu --- v3: - Add built-in module list in loaded_modules for checking instead of removing error check. v2: - fix git commit description style in commit log - fix typo spelling --- usertools/dpdk-devbind.py | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/usertools/dpdk-devbind.py b/usertools/dpdk-devbind.py index 99112b7ab..5b34ccd2a 100755 --- a/usertools/dpdk-devbind.py +++ b/usertools/dpdk-devbind.py @@ -181,7 +181,13 @@ def module_is_loaded(module): loaded_modules = sysfs_mods - return module in sysfs_mods + # add built-in modules as loaded + builtin_mods = subprocess.check_output(["cat /lib/modules/$(uname -r)/modules.builtin"], shell=True).splitlines() + for mod in builtin_mods: + mod_name = os.path.basename(mod.decode("utf8")).split(".ko", 1) + loaded_modules.append(mod_name[0]) + + return module in loaded_modules def check_modules(): -- 2.14.4