Commit 8dc87848 authored by Jim Harris's avatar Jim Harris Committed by Tomasz Zawadzki
Browse files

env_dpdk: allow 2211.c file to build against older DPDK



The 2211 implementation only gets used when runtime
detects the DPDK version is DPDK 22.11. But we still
compile this file even if it gets built against an
older DPDK.

This is typically fine, except there are some interrupt
APIs that changed in DPDK 21.11, so older DPDKs don't
have some of the functions used in this file.  We need
to use ifdefs to allow this to compile.

We will need some more work to handle this case properly,
but this patch at least fixes the 2211.c case for now.
We will probably need a 2108.c file that exactly matches
the 2207.c file except for this interrupt API changes.

Signed-off-by: default avatarJim Harris <james.r.harris@intel.com>
Change-Id: I6055694ccbb79845798e750ebb7127ec6c160e2e
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/15236


Community-CI: Mellanox Build Bot
Tested-by: default avatarSPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: default avatarMichal Berger <michal.berger@intel.com>
Reviewed-by: default avatarTomasz Zawadzki <tomasz.zawadzki@intel.com>
Reviewed-by: default avatarKonrad Sztyber <konrad.sztyber@intel.com>
parent 74da5ee2
Loading
Loading
Loading
Loading
+15 −0
Original line number Diff line number Diff line
@@ -148,19 +148,34 @@ pci_driver_register_2211(struct spdk_pci_driver *driver,
static int
pci_device_enable_interrupt_2211(struct rte_pci_device *rte_dev)
{
#if RTE_VERSION < RTE_VERSION_NUM(21, 11, 0, 0)
	assert(false);
	return -1;
#else
	return rte_intr_enable(rte_dev->intr_handle);
#endif
}

static int
pci_device_disable_interrupt_2211(struct rte_pci_device *rte_dev)
{
#if RTE_VERSION < RTE_VERSION_NUM(21, 11, 0, 0)
	assert(false);
	return -1;
#else
	return rte_intr_disable(rte_dev->intr_handle);
#endif
}

static int
pci_device_get_interrupt_efd_2211(struct rte_pci_device *rte_dev)
{
#if RTE_VERSION < RTE_VERSION_NUM(21, 11, 0, 0)
	assert(false);
	return -1;
#else
	return rte_intr_fd_get(rte_dev->intr_handle);
#endif
}

static int