From c34f15e09c494be38a445a0f3aeb6706ad691c37 Mon Sep 17 00:00:00 2001 From: Tomasz Zawadzki Date: Fri, 30 Sep 2022 11:29:56 +0200 Subject: [PATCH] env_dpdk: keep DPDK 20.11 compatiblity Patch below added copies of pci realted headers to keep compatiblity with <= DPDK 22.07. (1eb35ac) env_dpdk: add copies of 22.07 pci-related header files Unfortunetly the rte_bus/bus_pci/dev headers from DPDK 22.07 are not compatibile going back to DPDK 20.11. The issues are: - lack of RTE_TAILQ_ENTRY defined in rte_os.h - rte_intr_handle being part of rte_pci_device rather than pointer pci_dpdk_2207.c even before this patch is not binary compatible with DPDK 20.11 - see pci_device_*_interrupt_2207() functions. There would need to be another copy of headers matching that version of DPDK to resolve this issue. SPDK supports up to two latest LTS releases. Which right now includes DPDK 20.11, but soon will be dropped due to DPDK 22.11 release. Having compile time defines here, keeps the older DPDK working. Meanwhile backwards compatiblity in SPDK is no worse than before. The recent changes to env_dpdk, are aiming to improve support with newer versions of DPDK. Change-Id: If4dc601cb03e18c2cad61f3a93080e8265ca5fcc Signed-off-by: Tomasz Zawadzki Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/14795 Community-CI: Mellanox Build Bot Tested-by: SPDK CI Jenkins Reviewed-by: Ben Walker Reviewed-by: Aleksey Marchuk Reviewed-by: Jim Harris --- lib/env_dpdk/22.07/rte_bus_pci.h | 4 ++++ lib/env_dpdk/pci_dpdk.h | 6 ++++++ 2 files changed, 10 insertions(+) diff --git a/lib/env_dpdk/22.07/rte_bus_pci.h b/lib/env_dpdk/22.07/rte_bus_pci.h index 1c6a8fdd7..9a0b03617 100644 --- a/lib/env_dpdk/22.07/rte_bus_pci.h +++ b/lib/env_dpdk/22.07/rte_bus_pci.h @@ -69,7 +69,11 @@ struct rte_pci_device { struct rte_pci_id id; /**< PCI ID. */ struct rte_mem_resource mem_resource[PCI_MAX_RESOURCE]; /**< PCI Memory Resource */ +#if RTE_VERSION < RTE_VERSION_NUM(21, 11, 0, 0) + struct rte_intr_handle intr_handle; /**< Interrupt handle */ +#else struct rte_intr_handle *intr_handle; /**< Interrupt handle */ +#endif struct rte_pci_driver *driver; /**< PCI driver used in probing */ uint16_t max_vfs; /**< sriov enable if not zero */ enum rte_pci_kernel_driver kdrv; /**< Kernel driver passthrough */ diff --git a/lib/env_dpdk/pci_dpdk.h b/lib/env_dpdk/pci_dpdk.h index ea52b8194..6f8564427 100644 --- a/lib/env_dpdk/pci_dpdk.h +++ b/lib/env_dpdk/pci_dpdk.h @@ -8,6 +8,12 @@ #include "spdk/env.h" +#if RTE_VERSION < RTE_VERSION_NUM(21, 11, 0, 0) +#define RTE_TAILQ_HEAD(name, type) TAILQ_HEAD(name, type) +#define RTE_TAILQ_ENTRY(type) TAILQ_ENTRY(type) +#define RTE_TAILQ_FOREACH(var, head, field) TAILQ_FOREACH(var, head, field) +#endif + struct spdk_pci_driver { uint8_t driver_buf[256]; struct rte_pci_driver *driver;