From: KARN JYE LAU <[email protected]>

Kernel source have removed strlcpy() in 6.8 kernels and above,
update dpdk-module to fix kni compilation in scargapth.

Upstream-Status: Backport
[https://git.dpdk.org/dpdk-stable/commit/?h=22.11&id=15658afda05f50e69805b891ebb4d2d5c1966d44]

Signed-off-by: KARN JYE LAU <[email protected]>
---
 recipes-extended/dpdk/dpdk-module_22.11.5.bb  |  2 +
 .../0001-kni-fix-build-with-Linux-6.8.patch   | 42 +++++++++++++++++++
 2 files changed, 44 insertions(+)
 create mode 100644 
recipes-extended/dpdk/dpdk/0001-kni-fix-build-with-Linux-6.8.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..359fbf6 100644
--- a/recipes-extended/dpdk/dpdk-module_22.11.5.bb
+++ b/recipes-extended/dpdk/dpdk-module_22.11.5.bb
@@ -4,7 +4,9 @@ FILESEXTRAPATHS:prepend := "${THISDIR}/dpdk:"
 
 SRC_URI += " \
             file://0001-Makefile-add-makefile.patch \
+            file://0001-kni-fix-build-with-Linux-6.8.patch \
 "
+
 STABLE = "-stable"
 BRANCH = "22.11"
 SRCREV = "dbd8f39c7c0fc66dfb49d2c6459bba20545c45d8"
diff --git a/recipes-extended/dpdk/dpdk/0001-kni-fix-build-with-Linux-6.8.patch 
b/recipes-extended/dpdk/dpdk/0001-kni-fix-build-with-Linux-6.8.patch
new file mode 100644
index 0000000..4c2577f
--- /dev/null
+++ b/recipes-extended/dpdk/dpdk/0001-kni-fix-build-with-Linux-6.8.patch
@@ -0,0 +1,42 @@
+From 15658afda05f50e69805b891ebb4d2d5c1966d44 Mon Sep 17 00:00:00 2001
+From: Jiri Slaby <[email protected]>
+Date: Tue, 12 Mar 2024 09:49:14 +0100
+Subject: kni: fix build with Linux 6.8
+MIME-Version: 1.0
+Content-Type: text/plain; charset=UTF-8
+Content-Transfer-Encoding: 8bit
+
+strlcpy() was removed in commit d26270061ae6 (string: Remove strlcpy()), use
+strscpy() instead.
+
+The patches fixes this:
+kernel/linux/kni/kni_net.c: In function ‘kni_get_drvinfo’:
+kernel/linux/kni/kni_net.c:835:9: error: implicit declaration of function 
‘strlcpy’; did you mean ‘strscpy’?
+
+Intended esp. for stable/22.11. It should go wherever kni is still in
+the tree.
+
+Signed-off-by: Jiri Slaby <[email protected]>
+Acked-by: Luca Boccassi <[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 = {
+-- 
+cgit v1.2.1
+
-- 
2.34.1

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

Reply via email to