!305 fix build with kernel 5.18+

From: @jiangheng12 
Reviewed-by: @kircher 
Signed-off-by: @kircher
This commit is contained in:
openeuler-ci-bot 2023-02-28 13:39:33 +00:00 committed by Gitee
commit 674339751f
No known key found for this signature in database
GPG Key ID: 173E9B9CA92EEF8F
3 changed files with 54 additions and 41 deletions

View File

@ -0,0 +1,49 @@
From 29b1c1e43014099548bb9424749cbc062e16a087 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Georg=20M=C3=BCller?= <georgmueller@gmx.net>
Date: Thu, 6 Oct 2022 20:51:37 +0200
Subject: [PATCH] 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 <georgmueller@gmx.net>
---
kernel/linux/igb_uio/igb_uio.c | 8 +-------
1 file changed, 1 insertion(+), 7 deletions(-)
diff --git a/kernel/linux/igb_uio/igb_uio.c b/kernel/linux/igb_uio/igb_uio.c
index 33e0e02..aea67da 100644
--- a/kernel/linux/igb_uio/igb_uio.c
+++ b/kernel/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";
--
2.23.0

View File

@ -1,38 +0,0 @@
From ca5ef06359c9deb513d6817610e5d8ba18f86279 Mon Sep 17 00:00:00 2001
From: jiangheng <jiangheng14@huawei.com>
Date: Mon, 30 Jan 2023 10:37:47 +0800
Subject: [PATCH] linux/igb_uio: fix build with linux 5.18
---
kernel/linux/igb_uio/igb_uio.c | 8 ++++++++
1 file changed, 8 insertions(+)
diff --git a/kernel/linux/igb_uio/igb_uio.c b/kernel/linux/igb_uio/igb_uio.c
index ea439d1..194a5ff 100644
--- a/kernel/linux/igb_uio/igb_uio.c
+++ b/kernel/linux/igb_uio/igb_uio.c
@@ -512,13 +512,21 @@ igbuio_pci_probe(struct pci_dev *dev, const struct pci_device_id *id)
goto fail_release_iomem;
/* set 64-bit DMA mask */
+#if LINUX_VERSION_CODE < KERNEL_VERSION(5, 18, 0)
err = pci_set_dma_mask(dev, DMA_BIT_MASK(64));
+#else
+ err = dma_set_mask_and_coherent(&dev->dev, DMA_BIT_MASK(64));
+#endif
if (err != 0) {
dev_err(&dev->dev, "Cannot set DMA mask\n");
goto fail_release_iomem;
}
+#if LINUX_VERSION_CODE < KERNEL_VERSION(5, 18, 0)
err = pci_set_consistent_dma_mask(dev, DMA_BIT_MASK(64));
+#else
+ err = dma_set_mask_and_coherent(&dev->dev, DMA_BIT_MASK(64));
+#endif
if (err != 0) {
dev_err(&dev->dev, "Cannot set consistent DMA mask\n");
goto fail_release_iomem;
--
2.23.0

View File

@ -1,6 +1,6 @@
Name: dpdk
Version: 21.11
Release: 31
Release: 32
Packager: packaging@6wind.com
URL: http://dpdk.org
%global source_version 21.11
@ -237,8 +237,7 @@ Patch9215: 0215-kni-fix-build-with-Linux-5.18.patch
Patch9216: 0216-kni-use-dedicated-function-to-set-random-MAC-address.patch
Patch9217: 0217-kni-use-dedicated-function-to-set-MAC-address.patch
Patch9218: 0218-linux-igb_uio-fix-build-for-switch-fall-through.patch
Patch9219: 0219-linux-igb_uio-fix-build-with-liux-5.18.patch
Patch9219: 0219-linux-igb_uio-fix-build-with-kernel-5.18.patch
Patch9220: 0220-net-hns3-fix-inaccurate-RTC-time-to-read.patch
Patch9221: 0221-net-hns3-fix-log-about-indirection-table-size.patch
Patch9222: 0222-net-hns3-extract-common-function-to-query-device.patch
@ -392,6 +391,9 @@ strip -g $RPM_BUILD_ROOT/lib/modules/%{kern_devel_ver}/extra/dpdk/igb_uio.ko
/usr/sbin/depmod
%changelog
* Tue Feb 28 2023 jiangheng <jiangheng14@huawei.com> - 21.11-32
- linux/igb_uio: fix build with kernel 5.18+
* Tue Feb 28 2023 jiangheng <jiangheng14@huawei.com> - 21.11-31
- remove unused patch