[dpdk-stable] patch 'usertools: fix binding built-in kernel driver' has been queued to stable release 19.11.7

Christian Ehrhardt christian.ehrhardt at canonical.com
Mon Feb 15 14:28:57 CET 2021


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 <christian.ehrhardt at canonical.com>

---
>From 42d652dafbc1e90c3d40096d077929edf346c8f5 Mon Sep 17 00:00:00 2001
From: Yongxin Liu <yongxin.liu at windriver.com>
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 <yongxin.liu at windriver.com>
Reviewed-by: Anatoly Burakov <anatoly.burakov at intel.com>
---
 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 at 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):


More information about the stable mailing list