From 0a3a9f42854f8d39f1d217403ff2bcffd4295493 Mon Sep 17 00:00:00 2001 From: Changpeng Liu Date: Thu, 16 Dec 2021 17:16:28 +0800 Subject: [PATCH] nvmf/vfio-user: fix the compilation issue on kernel 4.9.x Macro PCI_CFG_SPACE_EXP_SIZE isn't defined in kernel 4.9.x, so we use a fixed value here instead. Fix issue #2282. Change-Id: Ife1444e919e4c1dc9328437002c15befe2f393e7 Signed-off-by: Changpeng Liu Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/10691 Community-CI: Mellanox Build Bot Reviewed-by: Jim Harris Reviewed-by: Tomasz Zawadzki Tested-by: SPDK CI Jenkins --- lib/nvmf/vfio_user.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/lib/nvmf/vfio_user.c b/lib/nvmf/vfio_user.c index 6567e19d9..3c7cc204f 100644 --- a/lib/nvmf/vfio_user.c +++ b/lib/nvmf/vfio_user.c @@ -59,7 +59,11 @@ #define NVME_DOORBELLS_OFFSET 0x1000 #define NVMF_VFIO_USER_DOORBELLS_SIZE 0x1000 -#define NVME_REG_CFG_SIZE PCI_CFG_SPACE_EXP_SIZE +/* + * NVMe driver reads 4096 bytes, which is the extended PCI configuration space + * available on PCI-X 2.0 and PCI Express buses + */ +#define NVME_REG_CFG_SIZE 0x1000 #define NVME_REG_BAR0_SIZE (NVME_DOORBELLS_OFFSET + NVMF_VFIO_USER_DOORBELLS_SIZE) #define NVMF_VFIO_USER_MAX_QPAIRS_PER_CTRLR ((NVMF_VFIO_USER_DOORBELLS_SIZE) / 8) #define NVME_IRQ_MSIX_NUM NVMF_VFIO_USER_MAX_QPAIRS_PER_CTRLR @@ -1779,10 +1783,6 @@ access_bar0_fn(vfu_ctx_t *vfu_ctx, char *buf, size_t count, loff_t pos, return count; } -/* - * NVMe driver reads 4096 bytes, which is the extended PCI configuration space - * available on PCI-X 2.0 and PCI Express buses - */ static ssize_t access_pci_config(vfu_ctx_t *vfu_ctx, char *buf, size_t count, loff_t offset, bool is_write)