From: KJ LAU <[email protected]>

Commit d26270061ae6 removed strlcpy() from kernel source,
Backport upstream fixes to fix  dpdk-module build error
in latest kernel.

Signed-off-by: KJ LAU <[email protected]>
---
 recipes-extended/dpdk/dpdk-module_22.11.5.bb  |  6 ++--
 .../0001-kni-fix-build-with-Linux-6.12.patch  | 31 +++++++++++++++++++
 2 files changed, 34 insertions(+), 3 deletions(-)
 create mode 100644 
recipes-extended/dpdk/dpdk/0001-kni-fix-build-with-Linux-6.12.patch

diff --git a/recipes-extended/dpdk/dpdk-module_22.11.5.bb 
b/recipes-extended/dpdk/dpdk-module_22.11.5.bb
index 6b45e21..e91c979 100644
--- a/recipes-extended/dpdk/dpdk-module_22.11.5.bb
+++ b/recipes-extended/dpdk/dpdk-module_22.11.5.bb
@@ -2,9 +2,9 @@ include dpdk.inc
 
 FILESEXTRAPATHS:prepend := "${THISDIR}/dpdk:"
 
-SRC_URI += " \
-            file://0001-Makefile-add-makefile.patch \
-"
+SRC_URI += "file://0001-Makefile-add-makefile.patch \
+           file://0001-kni-fix-build-with-Linux-6.12.patch \
+           "
 STABLE = "-stable"
 BRANCH = "22.11"
 SRCREV = "dbd8f39c7c0fc66dfb49d2c6459bba20545c45d8"
diff --git 
a/recipes-extended/dpdk/dpdk/0001-kni-fix-build-with-Linux-6.12.patch 
b/recipes-extended/dpdk/dpdk/0001-kni-fix-build-with-Linux-6.12.patch
new file mode 100644
index 0000000..4bd97ff
--- /dev/null
+++ b/recipes-extended/dpdk/dpdk/0001-kni-fix-build-with-Linux-6.12.patch
@@ -0,0 +1,31 @@
+From 0d9f9928a392ad388e9425ce9da860d291e94c19 Mon Sep 17 00:00:00 2001
+From: KARN JYE LAU <[email protected]>
+Date: Wed, 20 Nov 2024 18:00:16 +0530
+Subject: [PATCH] kni: fix build with Linux 6.12
+
+strlcpy() was removed in commit d26270061ae6 (string: Remove strlcpy()), use
+strscpy() instead.
+
+Upstream-Status: Backport
+https://inbox.dpdk.org/dev/[email protected]/
+
+Signed-off-by: KARN JYE LAU <[email protected]>
+---
+ kernel/linux/kni/kni_net.c | 4 ++--
+ 1 file changed, 2 insertions(+), 2 deletions(-)
+
+diff --git a/kernel/linux/kni/kni_net.c b/kernel/linux/kni/kni_net.c
+index 779ee3451a..c115a728f0 100644
+--- a/kernel/linux/kni/kni_net.c
++++ b/kernel/linux/kni/kni_net.c
+@@ -832,8 +832,8 @@ static const struct net_device_ops kni_net_netdev_ops = {
+ static void kni_get_drvinfo(struct net_device *dev,
+                           struct ethtool_drvinfo *info)
+ {
+-      strlcpy(info->version, KNI_VERSION, sizeof(info->version));
+-      strlcpy(info->driver, "kni", sizeof(info->driver));
++      strscpy(info->version, KNI_VERSION, sizeof(info->version));
++      strscpy(info->driver, "kni", sizeof(info->driver));
+ }
+ 
+ static const struct ethtool_ops kni_net_ethtool_ops = {
-- 
2.34.1

-=-=-=-=-=-=-=-=-=-=-=-
Links: You receive all messages sent to this group.
View/Reply Online (#8448): 
https://lists.yoctoproject.org/g/meta-intel/message/8448
Mute This Topic: https://lists.yoctoproject.org/mt/109684201/21656
Group Owner: [email protected]
Unsubscribe: https://lists.yoctoproject.org/g/meta-intel/unsub 
[[email protected]]
-=-=-=-=-=-=-=-=-=-=-=-

Reply via email to