DPDK patches and discussions
 help / color / mirror / Atom feed
* [PATCH dpdk-kmod] linux/igb_uio: fix build with kernel 5.18
@ 2022-12-16 11:57 Ferruh Yigit
  2022-12-16 17:33 ` Stephen Hemminger
                   ` (2 more replies)
  0 siblings, 3 replies; 5+ messages in thread
From: Ferruh Yigit @ 2022-12-16 11:57 UTC (permalink / raw)
  To: Thomas Monjalon; +Cc: dev, David Marchand, Daxue Gao, Christian Ehrhardt

In Linux kernel v5.18, "pci-dma-compat.h" wrapper file is removed [1].

Some APIs in that wrapper file were used by igb_uio kernel module and
kernel module build fails after mentioned commit.

Fixed build for v5.18 by replacing APIs in igb_uio.

Replaced APIs are available in Linux v4.4 (minimum Linux kernel version
supported by DPDK), so no Linux version check is needed.

[1]
Commit 7968778914e5 ("PCI: Remove the deprecated "pci-dma-compat.h" API")

Bugzilla ID: 1142

Signed-off-by: Ferruh Yigit <ferruh.yigit@amd.com>
---
Cc: Daxue Gao <daxuex.gao@intel.com>

Cc: Christian Ehrhardt <christian.ehrhardt@canonical.com>
This also needs to be backported to v19.11 LTS
---
 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 33e0e0286b69..0045e0fb737a 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";
-- 
2.25.1


^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2023-02-05 17:41 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-12-16 11:57 [PATCH dpdk-kmod] linux/igb_uio: fix build with kernel 5.18 Ferruh Yigit
2022-12-16 17:33 ` Stephen Hemminger
2022-12-18 14:26   ` Ferruh Yigit
2022-12-22 15:35 ` Luca Boccassi
2023-02-05 17:41 ` Thomas Monjalon

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).