From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id 4983CA054F for ; Mon, 15 Feb 2021 14:29:07 +0100 (CET) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 44ED51606E3; Mon, 15 Feb 2021 14:29:07 +0100 (CET) Received: from youngberry.canonical.com (youngberry.canonical.com [91.189.89.112]) by mails.dpdk.org (Postfix) with ESMTP id 7FFF81606DC for ; Mon, 15 Feb 2021 14:29:05 +0100 (CET) Received: from 2.general.paelzer.uk.vpn ([10.172.196.173] helo=Keschdeichel.fritz.box) by youngberry.canonical.com with esmtpsa (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.86_2) (envelope-from ) id 1lBdvy-0003bz-IA; Mon, 15 Feb 2021 13:29:02 +0000 From: Christian Ehrhardt To: Yongxin Liu Cc: Anatoly Burakov , dpdk stable Date: Mon, 15 Feb 2021 14:28:57 +0100 Message-Id: <20210215132857.1855675-5-christian.ehrhardt@canonical.com> X-Mailer: git-send-email 2.30.0 In-Reply-To: <20210215132857.1855675-1-christian.ehrhardt@canonical.com> References: <20210204112954.2488123-1-christian.ehrhardt@canonical.com> <20210215132857.1855675-1-christian.ehrhardt@canonical.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Subject: [dpdk-stable] patch 'usertools: fix binding built-in kernel driver' has been queued to stable release 19.11.7 X-BeenThere: stable@dpdk.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: patches for DPDK stable branches List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: stable-bounces@dpdk.org Sender: "stable" Hi, FYI, your patch has been queued to stable release 19.11.7 Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet. It will be pushed if I get no objections before 02/17/21. So please shout if anyone has objections. Also note that after the patch there's a diff of the upstream commit vs the patch applied to the branch. This will indicate if there was any rebasing needed to apply to the stable branch. If there were code changes for rebasing (ie: not only metadata diffs), please double check that the rebase was correctly done. Queued patches are on a temporary branch at: https://github.com/cpaelzer/dpdk-stable-queue This queued commit can be viewed at: https://github.com/cpaelzer/dpdk-stable-queue/commit/42d652dafbc1e90c3d40096d077929edf346c8f5 Thanks. Christian Ehrhardt --- >From 42d652dafbc1e90c3d40096d077929edf346c8f5 Mon Sep 17 00:00:00 2001 From: Yongxin Liu Date: Mon, 23 Nov 2020 11:05:33 +0800 Subject: [PATCH] usertools: fix binding built-in kernel driver [ upstream commit 7a016af4aa6bd2f8425b4fb2d59e5dd19f12bceb ] 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"), the 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. Fixes: 681a67288655 ("usertools: check if module is loaded before binding") Signed-off-by: Yongxin Liu Reviewed-by: Anatoly Burakov --- usertools/dpdk-devbind.py | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/usertools/dpdk-devbind.py b/usertools/dpdk-devbind.py index b1d1498768..262a5ff3a9 100755 --- a/usertools/dpdk-devbind.py +++ b/usertools/dpdk-devbind.py @@ -7,6 +7,7 @@ from __future__ import print_function import sys import os import getopt +import platform import subprocess from os.path import exists, abspath, dirname, basename @@ -172,7 +173,17 @@ def module_is_loaded(module): loaded_modules = sysfs_mods - return module in sysfs_mods + # add built-in modules as loaded + release = platform.uname().release + filename = os.path.join("/lib/modules/", release, "modules.builtin") + if os.path.exists(filename): + try: + with open(filename) as f: + loaded_modules += [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 def check_modules(): -- 2.30.0 --- Diff of the applied patch vs upstream commit (please double-check if non-empty: --- --- - 2021-02-15 14:24:49.581013162 +0100 +++ 0005-usertools-fix-binding-built-in-kernel-driver.patch 2021-02-15 14:24:49.297482133 +0100 @@ -1 +1 @@ -From 7a016af4aa6bd2f8425b4fb2d59e5dd19f12bceb Mon Sep 17 00:00:00 2001 +From 42d652dafbc1e90c3d40096d077929edf346c8f5 Mon Sep 17 00:00:00 2001 @@ -5,0 +6,2 @@ +[ upstream commit 7a016af4aa6bd2f8425b4fb2d59e5dd19f12bceb ] + @@ -15 +16,0 @@ -Cc: stable@dpdk.org @@ -24 +25 @@ -index c2ede3d4df..98bd1b7e4d 100755 +index b1d1498768..262a5ff3a9 100755 @@ -27 +28,2 @@ -@@ -7,6 +7,7 @@ import sys +@@ -7,6 +7,7 @@ from __future__ import print_function + import sys @@ -29,2 +31 @@ - import subprocess - import argparse + import getopt @@ -31,0 +33,2 @@ + import subprocess + from os.path import exists, abspath, dirname, basename @@ -33,3 +36 @@ - from glob import glob - from os.path import exists, basename -@@ -107,7 +108,17 @@ def module_is_loaded(module): +@@ -172,7 +173,17 @@ def module_is_loaded(module):