From 2c65d55675e987b2c0311da828a91b5e40eb4c6a Mon Sep 17 00:00:00 2001 From: Michal Berger Date: Fri, 24 Jun 2022 00:12:33 +0200 Subject: [PATCH] pkgdep/git: [dpdk_kmods] Patch for changes in use of pci_ API Signed-off-by: Michal Berger Change-Id: I202d60bcd721c11d1729731f01e1a4133e0c1a24 Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/13450 Community-CI: Broadcom CI Reviewed-by: Tomasz Zawadzki Reviewed-by: Kamil Godzwon Reviewed-by: Jim Harris Tested-by: SPDK CI Jenkins --- test/common/config/pkgdep/git | 5 +++ .../patches/dpdk_kmods/0001-dma-mask.patch | 31 +++++++++++++++++++ 2 files changed, 36 insertions(+) create mode 100644 test/common/config/pkgdep/patches/dpdk_kmods/0001-dma-mask.patch diff --git a/test/common/config/pkgdep/git b/test/common/config/pkgdep/git index e5c1ccdf6..1e8297e5b 100644 --- a/test/common/config/pkgdep/git +++ b/test/common/config/pkgdep/git @@ -388,6 +388,11 @@ function install_vagrant() { function install_igb_uio() { git clone "${GIT_REPO_DPDK_KMODS}" "$GIT_REPOS/dpdk-kmods" + + if ge "$kernel_ver" 5.16.0; then + patch --dir="$GIT_REPOS/dpdk-kmods" -p1 + fi < "$rootdir/test/common/config/pkgdep/patches/dpdk_kmods/0001-dma-mask.patch" + (cd "$GIT_REPOS/dpdk-kmods/linux/igb_uio" && make -j ${jobs}) sudo mkdir -p "/lib/modules/$(uname -r)/extra/dpdk" sudo cp "$GIT_REPOS/dpdk-kmods/linux/igb_uio/igb_uio.ko" "/lib/modules/$(uname -r)/extra/dpdk" diff --git a/test/common/config/pkgdep/patches/dpdk_kmods/0001-dma-mask.patch b/test/common/config/pkgdep/patches/dpdk_kmods/0001-dma-mask.patch new file mode 100644 index 000000000..a01931a3b --- /dev/null +++ b/test/common/config/pkgdep/patches/dpdk_kmods/0001-dma-mask.patch @@ -0,0 +1,31 @@ +pci_set_dma_mask() and pci_set_consistent_dma_mask() got deprecated in +favor of dma_set_mask_and_coherent(). See: + +https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit?id=c726c62db857d375800af7e82eb1c6f639e87631 + +--- + linux/igb_uio/igb_uio.c | 4 ++-- + 1 file changed, 2 insertions(+), 2 deletions(-) + +diff --git a/linux/igb_uio/igb_uio.c b/linux/igb_uio/igb_uio.c +index 33e0e02..353b322 100644 +--- a/linux/igb_uio/igb_uio.c ++++ b/linux/igb_uio/igb_uio.c +@@ -512,13 +512,13 @@ 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)); ++ err = dma_set_mask_and_coherent(&dev->dev, DMA_BIT_MASK(64)); + if (err != 0) { + dev_err(&dev->dev, "Cannot set consistent DMA mask\n"); + goto fail_release_iomem; +-- +