From 87a23c168f85287d94cda3808684d2e8fb50f98a Mon Sep 17 00:00:00 2001 From: jiangheng Date: Mon, 6 Feb 2023 10:00:55 +0800 Subject: [PATCH] fix build with kernel 5.18+ --- ...x-igb_uio-fix-build-with-kernel-5.18.patch | 49 +++++++++++++++++++ ...nux-igb_uio-fix-build-with-liux-5.18.patch | 38 -------------- dpdk.spec | 7 ++- 3 files changed, 54 insertions(+), 40 deletions(-) create mode 100644 0219-linux-igb_uio-fix-build-with-kernel-5.18.patch delete mode 100644 0219-linux-igb_uio-fix-build-with-liux-5.18.patch diff --git a/0219-linux-igb_uio-fix-build-with-kernel-5.18.patch b/0219-linux-igb_uio-fix-build-with-kernel-5.18.patch new file mode 100644 index 0000000..f19c6e5 --- /dev/null +++ b/0219-linux-igb_uio-fix-build-with-kernel-5.18.patch @@ -0,0 +1,49 @@ +From 29b1c1e43014099548bb9424749cbc062e16a087 Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Georg=20M=C3=BCller?= +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 +--- + 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 + diff --git a/0219-linux-igb_uio-fix-build-with-liux-5.18.patch b/0219-linux-igb_uio-fix-build-with-liux-5.18.patch deleted file mode 100644 index d0a7f2e..0000000 --- a/0219-linux-igb_uio-fix-build-with-liux-5.18.patch +++ /dev/null @@ -1,38 +0,0 @@ -From ca5ef06359c9deb513d6817610e5d8ba18f86279 Mon Sep 17 00:00:00 2001 -From: jiangheng -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 - diff --git a/dpdk.spec b/dpdk.spec index 9a8cc2f..1c673eb 100644 --- a/dpdk.spec +++ b/dpdk.spec @@ -1,6 +1,6 @@ Name: dpdk Version: 21.11 -Release: 30 +Release: 31 Packager: packaging@6wind.com URL: http://dpdk.org %global source_version 21.11 @@ -236,7 +236,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 Summary: Data Plane Development Kit core @@ -380,6 +380,9 @@ strip -g $RPM_BUILD_ROOT/lib/modules/%{kern_devel_ver}/extra/dpdk/igb_uio.ko /usr/sbin/depmod %changelog +* Mon Feb 06 2023 jiangheng - 21.11-31 +- linux/igb_uio: fix build with kernel 5.18+ + * Fri Feb 03 2023 chenjiji - 21.11-30 - net/hns3: fix inaccurate RTC time to read -- Gitee