diff options
| author | Yongxin Liu <yongxin.liu@windriver.com> | 2020-12-07 09:03:17 +0800 |
|---|---|---|
| committer | Anuj Mittal <anuj.mittal@intel.com> | 2020-12-08 09:38:19 +0800 |
| commit | c1b8e5e910950e9ce02fdadbc92a42a24e95e115 (patch) | |
| tree | 6c65cde72f9fc5959e566a8252971bc1151f957c | |
| parent | dd993590cd75f354da5e3bc8edce4063a2e445d0 (diff) | |
| download | meta-dpdk-c1b8e5e910950e9ce02fdadbc92a42a24e95e115.tar.gz | |
dpdk/19.11: fix binding for built-in kernel drivers
Since commit 681a67288655 ("usertools: check if module is loaded
before binding") in dpdk, usertools/dpdk-devbind.py only checks
dynamic kernel drivers in /sys/module. So built-in kernel driver
cannot be bound.
Add "usertools-devbind-fix-binding-for-built-in-kernel-dr.patch" to
fix this issue.
Signed-off-by: Yongxin Liu <yongxin.liu@windriver.com>
Signed-off-by: Anuj Mittal <anuj.mittal@intel.com>
| -rw-r--r-- | recipes-extended/dpdk/dpdk/usertools-devbind-fix-binding-for-built-in-kernel-dr.patch | 54 | ||||
| -rw-r--r-- | recipes-extended/dpdk/dpdk_19.11.5.bb | 3 |
2 files changed, 56 insertions, 1 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 new file mode 100644 index 0000000..7eb28f8 --- /dev/null +++ b/recipes-extended/dpdk/dpdk/usertools-devbind-fix-binding-for-built-in-kernel-dr.patch | |||
| @@ -0,0 +1,54 @@ | |||
| 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 | |||
diff --git a/recipes-extended/dpdk/dpdk_19.11.5.bb b/recipes-extended/dpdk/dpdk_19.11.5.bb index aedaa8a..60d5786 100644 --- a/recipes-extended/dpdk/dpdk_19.11.5.bb +++ b/recipes-extended/dpdk/dpdk_19.11.5.bb | |||
| @@ -12,7 +12,8 @@ LIC_FILES_CHKSUM = "file://license/gpl-2.0.txt;md5=b234ee4d69f5fce4486a80fdaf4a4 | |||
| 12 | file://license/lgpl-2.1.txt;md5=4b54a1fd55a448865a0b32d41598759d \ | 12 | file://license/lgpl-2.1.txt;md5=4b54a1fd55a448865a0b32d41598759d \ |
| 13 | file://license/bsd-3-clause.txt;md5=0f00d99239d922ffd13cabef83b33444" | 13 | file://license/bsd-3-clause.txt;md5=0f00d99239d922ffd13cabef83b33444" |
| 14 | 14 | ||
| 15 | SRC_URI += "file://0001-Starting-from-Linux-5.9-get_user_pages_remote-API-do.patch" | 15 | SRC_URI += "file://0001-Starting-from-Linux-5.9-get_user_pages_remote-API-do.patch \ |
| 16 | file://usertools-devbind-fix-binding-for-built-in-kernel-dr.patch" | ||
| 16 | 17 | ||
| 17 | do_install_append () { | 18 | do_install_append () { |
| 18 | # Remove the unneeded dir | 19 | # Remove the unneeded dir |
