Backport upstream patch to fix build failures:

14:30:02  | /git/linux/igb_uio/igb_uio.c: In function 'igbuio_pci_probe':
14:30:02  | /git/linux/igb_uio/igb_uio.c:515:15: error: implicit declaration of 
function 'pci_set_dma_mask'; did you mean 'ipi_send_mask'? 
[-Werror=implicit-function-declaration]
14:30:02  |   515 |         err = pci_set_dma_mask(dev,  DMA_BIT_MASK(64));
14:30:02  |       |               ^~~~~~~~~~~~~~~~
14:30:02  |       |               ipi_send_mask

Signed-off-by: Anuj Mittal <[email protected]>
---
 .../fix-build-with-5-18-kernel.patch          | 49 +++++++++++++++++++
 recipes-extended/dpdk/dpdk-kmods_git.bb       |  1 +
 2 files changed, 50 insertions(+)
 create mode 100644 
recipes-extended/dpdk/dpdk-kmods/fix-build-with-5-18-kernel.patch

diff --git a/recipes-extended/dpdk/dpdk-kmods/fix-build-with-5-18-kernel.patch 
b/recipes-extended/dpdk/dpdk-kmods/fix-build-with-5-18-kernel.patch
new file mode 100644
index 0000000..92e1d8f
--- /dev/null
+++ b/recipes-extended/dpdk/dpdk-kmods/fix-build-with-5-18-kernel.patch
@@ -0,0 +1,49 @@
+From 29b1c1e43014099548bb9424749cbc062e16a087 Mon Sep 17 00:00:00 2001
+From: =?UTF-8?q?Georg=20M=C3=BCller?= <[email protected]>
+Date: Thu, 6 Oct 2022 20:51:37 +0200
+Subject: linux/igb_uio: fix build with kernel 5.18+
+MIME-Version: 1.0
+Content-Type: text/plain; charset=UTF-8
+Content-Transfer-Encoding: 8bit
+
+pci_set_dma_mask() and pci_set_consistent_dma_mask() were removed with
+kernel 5.18. They both were just wrappers for dma_set_mask() and
+dma_set_coherent_mask().
+
+Instead, use dma_set_mask_and_coherent(), which is a combination of
+dma_set_mask() and dma_set_coherent_mask().
+
+dma_set_mask_and_coherent() exists since kernel 3.13.
+
+Signed-off-by: Georg Müller <[email protected]>
+---
+ linux/igb_uio/igb_uio.c | 8 +-------
+ 1 file changed, 1 insertion(+), 7 deletions(-)
+
+diff --git a/linux/igb_uio/igb_uio.c b/linux/igb_uio/igb_uio.c
+index 33e0e02..aea67da 100644
+--- a/linux/igb_uio/igb_uio.c
++++ b/linux/igb_uio/igb_uio.c
+@@ -512,18 +512,12 @@ igbuio_pci_probe(struct pci_dev *dev, const struct 
pci_device_id *id)
+               goto fail_release_iomem;
+ 
+       /* set 64-bit DMA mask */
+-      err = pci_set_dma_mask(dev,  DMA_BIT_MASK(64));
++      err = dma_set_mask_and_coherent(&dev->dev,  DMA_BIT_MASK(64));
+       if (err != 0) {
+               dev_err(&dev->dev, "Cannot set DMA mask\n");
+               goto fail_release_iomem;
+       }
+ 
+-      err = pci_set_consistent_dma_mask(dev, DMA_BIT_MASK(64));
+-      if (err != 0) {
+-              dev_err(&dev->dev, "Cannot set consistent DMA mask\n");
+-              goto fail_release_iomem;
+-      }
+-
+       /* fill uio infos */
+       udev->info.name = "igb_uio";
+       udev->info.version = "0.1";
+-- 
+cgit v1.2.1
+
diff --git a/recipes-extended/dpdk/dpdk-kmods_git.bb 
b/recipes-extended/dpdk/dpdk-kmods_git.bb
index b266655..3966bd6 100644
--- a/recipes-extended/dpdk/dpdk-kmods_git.bb
+++ b/recipes-extended/dpdk/dpdk-kmods_git.bb
@@ -6,6 +6,7 @@ LICENSE = "GPL-2.0-only"
 LIC_FILES_CHKSUM = 
"file://igb_uio.c;beginline=1;endline=4;md5=a05cd72f85021e22ff6b2632b437450b"
 
 SRC_URI = "git://dpdk.org/git/dpdk-kmods;protocol=https;branch=main \
+           file://fix-build-with-5-18-kernel.patch;patchdir=../.. \
            "
 SRCREV = "e13d7af77a1bf98757f85c3c4083f6ee6d0d2372"
 
-- 
2.43.0

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

Reply via email to