From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id 4EEF0424BD; Mon, 30 Jan 2023 08:27:08 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 3098C40EDE; Mon, 30 Jan 2023 08:27:08 +0100 (CET) Received: from szxga03-in.huawei.com (szxga03-in.huawei.com [45.249.212.189]) by mails.dpdk.org (Postfix) with ESMTP id 1D65D40C35 for ; Mon, 30 Jan 2023 08:27:06 +0100 (CET) Received: from kwepemm000003.china.huawei.com (unknown [172.30.72.53]) by szxga03-in.huawei.com (SkyGuard) with ESMTP id 4P504p74DxzJqMp for ; Mon, 30 Jan 2023 15:22:34 +0800 (CST) Received: from dggpeml500020.china.huawei.com (7.185.36.88) by kwepemm000003.china.huawei.com (7.193.23.66) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2375.34; Mon, 30 Jan 2023 15:27:01 +0800 Received: from dggpeml500020.china.huawei.com ([7.185.36.88]) by dggpeml500020.china.huawei.com ([7.185.36.88]) with mapi id 15.01.2375.034; Mon, 30 Jan 2023 15:27:01 +0800 From: "jiangheng (G)" To: "dev@dpdk.org" Subject: [[PATCH] ] linux/igb_uio: fix build with Linux 5.18 Thread-Topic: [[PATCH] ] linux/igb_uio: fix build with Linux 5.18 Thread-Index: Adk0e4xQBZJZYNDuSbaRnh7sbZH0aQ== Date: Mon, 30 Jan 2023 07:27:01 +0000 Message-ID: <8b4953ef939d433f8fe19353e9ed3aa7@huawei.com> Accept-Language: zh-CN, en-US Content-Language: zh-CN X-MS-Has-Attach: X-MS-TNEF-Correlator: x-originating-ip: [10.136.117.195] Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-CFilter-Loop: Reflected X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Since commit 7968778914 (PCI: Remove the deprecated "pci-dma-compat.h" API) in 5.18, pci_set_dma_mask() and pci_set_consistent_dma_mask() no longer exi= st switch those api to dma_set_mask_and_coherent. --- linux/igb_uio/igb_uio.c | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/linux/igb_uio/igb_uio.c b/linux/igb_uio/igb_uio.c index 33e0e02..3672314 100644 --- a/linux/igb_uio/igb_uio.c +++ b/linux/igb_uio/igb_uio.c @@ -512,13 +512,21 @@ igbuio_pci_probe(struct pci_dev *dev, const struct pc= i_device_id *id) goto fail_release_iomem; =20 /* set 64-bit DMA mask */ +#if LINUX_VERSION_CODE < KERNEL_VERSION(5, 18, 0) err =3D pci_set_dma_mask(dev, DMA_BIT_MASK(64)); +#else + err =3D dma_set_mask_and_coherent(&dev->dev, DMA_BIT_MASK(64)); +#endif if (err !=3D 0) { dev_err(&dev->dev, "Cannot set DMA mask\n"); goto fail_release_iomem; } =20 +#if LINUX_VERSION_CODE < KERNEL_VERSION(5, 18, 0) err =3D pci_set_consistent_dma_mask(dev, DMA_BIT_MASK(64)); +#else + err =3D dma_set_mask_and_coherent(&dev->dev, DMA_BIT_MASK(64)); +#endif if (err !=3D 0) { dev_err(&dev->dev, "Cannot set consistent DMA mask\n"); goto fail_release_iomem; --=20 2.27.0