aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorYongxin Liu <yongxin.liu@windriver.com>2020-12-07 09:03:17 +0800
committerAnuj Mittal <anuj.mittal@intel.com>2020-12-08 09:38:19 +0800
commitc1b8e5e910950e9ce02fdadbc92a42a24e95e115 (patch)
tree6c65cde72f9fc5959e566a8252971bc1151f957c
parentdd993590cd75f354da5e3bc8edce4063a2e445d0 (diff)
downloadmeta-dpdk-master.tar.gz
meta-dpdk-master.tar.bz2
meta-dpdk-master.zip
dpdk/19.11: fix binding for built-in kernel driversHEADmaster
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.patch54
-rw-r--r--recipes-extended/dpdk/dpdk_19.11.5.bb3
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 @@
+From b2a1d7a4661dc78a4c070de5542bf2c201762cb2 Mon Sep 17 00:00:00 2001
+From: Yongxin Liu <yongxin.liu@windriver.com>
+Date: Mon, 23 Nov 2020 11:02:52 +0800
+Subject: [PATCH] usertools/devbind: fix binding for built-in kernel drivers
+
+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.
+
+Upstream-Status: Submitted [https://patches.dpdk.org/patch/84454]
+
+Signed-off-by: Yongxin Liu <yongxin.liu@windriver.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 b1d149876..89a0ab1c9 100755
+--- a/usertools/dpdk-devbind.py
++++ b/usertools/dpdk-devbind.py
+@@ -8,6 +8,7 @@
+ import os
+ import getopt
+ import subprocess
++import platform
+ from os.path import exists, abspath, dirname, basename
+
+ # The PCI base class for all devices
+@@ -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.14.4
+
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
file://license/lgpl-2.1.txt;md5=4b54a1fd55a448865a0b32d41598759d \
file://license/bsd-3-clause.txt;md5=0f00d99239d922ffd13cabef83b33444"
-SRC_URI += "file://0001-Starting-from-Linux-5.9-get_user_pages_remote-API-do.patch"
+SRC_URI += "file://0001-Starting-from-Linux-5.9-get_user_pages_remote-API-do.patch \
+ file://usertools-devbind-fix-binding-for-built-in-kernel-dr.patch"
do_install_append () {
# Remove the unneeded dir