Bug 1046 - igb_uio fails to build with kernel 5.19
Summary: igb_uio fails to build with kernel 5.19
Status: UNCONFIRMED
Alias: None
Product: DPDK
Classification: Unclassified
Component: other (show other bugs)
Version: 22.03
Hardware: All All
: Normal normal
Target Milestone: ---
Assignee: dev
URL:
Depends on:
Blocks:
 
Reported: 2022-06-30 20:05 CEST by Ferruh YIGIT
Modified: 2022-09-22 15:04 CEST (History)
1 user (show)



Attachments
Patch to use dma_ functions instead of removed pci_ functions (773 bytes, patch)
2022-09-22 15:04 CEST, Georg Müller
Details | Diff

Description Ferruh YIGIT 2022-06-30 20:05:41 CEST
$ make kernelversion
5.19.0-rc4


igb_uio:
repo: https://dpdk.org/git/dpdk-kmods
Commit e68a705cc5dc ("linux/igb_uio: fix build for switch fall through")


Build command:
make V=1 KSRC=<linux path>


Build error:
.../dpdk-kmods/linux/igb_uio/igb_uio.c: In function ‘igbuio_pci_probe’:
.../dpdk-kmods/linux/igb_uio/igb_uio.c:515:8:
    error: implicit declaration of function ‘pci_set_dma_mask’; did you mean ‘ipi_send_mask’? [-Werror=implicit-function-declaration]
  515 |  err = pci_set_dma_mask(dev,  DMA_BIT_MASK(64));
      |        ^~~~~~~~~~~~~~~~
.../dpdk-kmods/linux/igb_uio/igb_uio.c:521:8:
    error: implicit declaration of function ‘pci_set_consistent_dma_mask’ [-Werror=implicit-function-declaration]
  521 |  err = pci_set_consistent_dma_mask(dev, DMA_BIT_MASK(64));
      |        ^~~~~~~~~~~~~~~~~~~~~~~~~~~
cc1: some warnings being treated as errors
make[2]: *** [scripts/Makefile.build:249: .../dpdk-kmods/linux/igb_uio/igb_uio.o] Error 1
Comment 1 Georg Müller 2022-09-22 15:04:05 CEST
Created attachment 220 [details]
Patch to use dma_ functions instead of removed pci_ functions

pci_set_dma_mask() and pci_set_consistent_dma_mask() were removed with kernel 5.18 (commit 7968778914e5). They both were just wrappers for dma_set_mask() and dma_set_coherent_mask().

There is a function dma_set_mask_and_coherent() which calls both dma_set_mask() and dma_set_coherent_mask().

This patch uses this combining function dma_set_mask_and_coherent(). It was introduced with kernel 3.13 (commit 4aa806b771d1). 

If this is not backward-compatible enough, it would be possible to use the split functions dma_set_mask() and dma_set_coherent_mask() and keep it as two calls in igb_uio.c. These were introduced in kernel 2.6.34 (commit 6a1961f49ee8).

Note You need to log in before you can comment on or make changes to this bug.