diff options
Diffstat (limited to 'recipes-extended/dpdk/dpdk/usertools-devbind-fix-binding-for-built-in-kernel-dr.patch')
-rw-r--r-- | recipes-extended/dpdk/dpdk/usertools-devbind-fix-binding-for-built-in-kernel-dr.patch | 54 |
1 files changed, 0 insertions, 54 deletions
diff --git a/recipes-extended/dpdk/dpdk/usertools-devbind-fix-binding-for-built-in-kernel-dr.patch b/recipes-extended/dpdk/dpdk/usertools-devbind-fix-binding-for-built-in-kernel-dr.patch deleted file mode 100644 index 7eb28f8..0000000 --- a/recipes-extended/dpdk/dpdk/usertools-devbind-fix-binding-for-built-in-kernel-dr.patch +++ /dev/null | |||
@@ -1,54 +0,0 @@ | |||
1 | From b2a1d7a4661dc78a4c070de5542bf2c201762cb2 Mon Sep 17 00:00:00 2001 | ||
2 | From: Yongxin Liu <yongxin.liu@windriver.com> | ||
3 | Date: Mon, 23 Nov 2020 11:02:52 +0800 | ||
4 | Subject: [PATCH] usertools/devbind: fix binding for built-in kernel drivers | ||
5 | |||
6 | A driver can be loaded as a dynamic module or a built-in module. | ||
7 | In commit 681a67288655 ("usertools: check if module is loaded | ||
8 | before binding"), script only checks modules in /sys/module/. | ||
9 | |||
10 | However, for built-in kernel driver, it only shows up in /sys/module/, | ||
11 | if it has a version or at least one parameter. So add check for | ||
12 | modules in /lib/modules/$(uname -r)/modules.builtin. | ||
13 | |||
14 | Upstream-Status: Submitted [https://patches.dpdk.org/patch/84454] | ||
15 | |||
16 | Signed-off-by: Yongxin Liu <yongxin.liu@windriver.com> | ||
17 | --- | ||
18 | usertools/dpdk-devbind.py | 13 ++++++++++++- | ||
19 | 1 file changed, 12 insertions(+), 1 deletion(-) | ||
20 | |||
21 | diff --git a/usertools/dpdk-devbind.py b/usertools/dpdk-devbind.py | ||
22 | index b1d149876..89a0ab1c9 100755 | ||
23 | --- a/usertools/dpdk-devbind.py | ||
24 | +++ b/usertools/dpdk-devbind.py | ||
25 | @@ -8,6 +8,7 @@ | ||
26 | import os | ||
27 | import getopt | ||
28 | import subprocess | ||
29 | +import platform | ||
30 | from os.path import exists, abspath, dirname, basename | ||
31 | |||
32 | # The PCI base class for all devices | ||
33 | @@ -172,7 +173,17 @@ def module_is_loaded(module): | ||
34 | |||
35 | loaded_modules = sysfs_mods | ||
36 | |||
37 | - return module in sysfs_mods | ||
38 | + # add built-in modules as loaded | ||
39 | + release = platform.uname().release | ||
40 | + filename = os.path.join("/lib/modules/", release, "modules.builtin") | ||
41 | + if os.path.exists(filename): | ||
42 | + try: | ||
43 | + with open(filename) as f: | ||
44 | + loaded_modules += [os.path.splitext(os.path.basename(mod))[0] for mod in f] | ||
45 | + except IOError: | ||
46 | + print("Warning: cannot read list of built-in kernel modules") | ||
47 | + | ||
48 | + return module in loaded_modules | ||
49 | |||
50 | |||
51 | def check_modules(): | ||
52 | -- | ||
53 | 2.14.4 | ||
54 | |||