Commit ab12e36b authored by Darek Stojaczyk's avatar Darek Stojaczyk Committed by Jim Harris
Browse files

env: drop DPDK 16.07 support



Now that even DPDK 16.11 (LTS) reaches its end of life in
November 2018, we can surely drop support for DPDK
versions older than that.

The PCI code will go through a major refactor soon, so this
patch cleans it up first.

Since this is the very first SPDK patch that drops support
for older DPDK versions, it also introduces an #error
directive that'll directly fail the build if the used DPDK
lib is too old.

Change-Id: I9bae30c98826c75cc91cda498e47e46979a08ed1
Signed-off-by: default avatarDarek Stojaczyk <dariusz.stojaczyk@intel.com>
Reviewed-on: https://review.gerrithub.io/433865


Tested-by: default avatarSPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: default avatarShuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Reviewed-by: default avatarBen Walker <benjamin.walker@intel.com>
Reviewed-by: default avatarJim Harris <james.r.harris@intel.com>
parent 942e02aa
Loading
Loading
Loading
Loading
+1 −7
Original line number Diff line number Diff line
@@ -33,7 +33,7 @@

#include "spdk/stdinc.h"

#include "spdk/env.h"
#include "env_internal.h"

#include <rte_config.h>
#include <rte_cycles.h>
@@ -246,9 +246,7 @@ spdk_mempool_get_name(struct spdk_mempool *mp)
void
spdk_mempool_free(struct spdk_mempool *mp)
{
#if RTE_VERSION >= RTE_VERSION_NUM(16, 7, 0, 1)
	rte_mempool_free((struct rte_mempool *)mp);
#endif
}

void *
@@ -285,11 +283,7 @@ spdk_mempool_put_bulk(struct spdk_mempool *mp, void **ele_arr, size_t count)
size_t
spdk_mempool_count(const struct spdk_mempool *pool)
{
#if RTE_VERSION < RTE_VERSION_NUM(16, 7, 0, 1)
	return rte_mempool_count((struct rte_mempool *)pool);
#else
	return rte_mempool_avail_count((struct rte_mempool *)pool);
#endif
}

bool
+4 −0
Original line number Diff line number Diff line
@@ -53,6 +53,10 @@ extern struct rte_pci_bus rte_pci_bus;
#endif
#include <rte_dev.h>

#if RTE_VERSION < RTE_VERSION_NUM(16, 11, 0, 0)
#error RTE_VERSION is too old! Minimum 16.11 is required.
#endif

/* x86-64 and ARM userspace virtual addresses use only the low 48 bits [0..47],
 * which is enough to cover 256 TB.
 */
+2 −12
Original line number Diff line number Diff line
@@ -50,10 +50,9 @@ spdk_pci_device_init(struct rte_pci_driver *driver,
	int rc;

	if (!ctx->cb_fn) {
#if RTE_VERSION >= RTE_VERSION_NUM(16, 11, 0, 0) && RTE_VERSION < RTE_VERSION_NUM(17, 02, 0, 1)
#if RTE_VERSION < RTE_VERSION_NUM(17, 02, 0, 1)
		rte_eal_pci_unmap_device(device);
#endif

		/* Return a positive value to indicate that this device does not belong to this driver, but
		 * this isn't an error. */
		return 1;
@@ -78,12 +77,6 @@ spdk_pci_device_fini(struct rte_pci_device *device)
void
spdk_pci_device_detach(struct spdk_pci_device *device)
{
#if RTE_VERSION >= RTE_VERSION_NUM(16, 11, 0, 0)
#if RTE_VERSION < RTE_VERSION_NUM(17, 05, 0, 0)
	rte_eal_device_remove(&device->device);
#endif
#endif

#if RTE_VERSION >= RTE_VERSION_NUM(18, 11, 0, 0)
	rte_eal_hotplug_remove("pci", device->device.name);
#elif RTE_VERSION >= RTE_VERSION_NUM(17, 11, 0, 3)
@@ -102,6 +95,7 @@ spdk_pci_device_detach(struct spdk_pci_device *device)
#elif RTE_VERSION >= RTE_VERSION_NUM(17, 05, 0, 4)
	rte_pci_detach(&device->addr);
#else
	rte_eal_device_remove(&device->device);
	rte_eal_pci_detach(&device->addr);
#endif
}
@@ -286,11 +280,7 @@ spdk_pci_device_get_id(struct spdk_pci_device *pci_dev)
int
spdk_pci_device_get_socket_id(struct spdk_pci_device *pci_dev)
{
#if RTE_VERSION >= RTE_VERSION_NUM(16, 11, 0, 0)
	return pci_dev->device.numa_node;
#else
	return pci_dev->numa_node;
#endif
}

int
+0 −6
Original line number Diff line number Diff line
@@ -92,15 +92,9 @@ static struct spdk_pci_enum_ctx g_ioat_pci_drv = {
	.driver = {
		.drv_flags	= RTE_PCI_DRV_NEED_MAPPING,
		.id_table	= ioat_driver_id,
#if RTE_VERSION >= RTE_VERSION_NUM(16, 11, 0, 0)
		.probe		= spdk_pci_device_init,
		.remove		= spdk_pci_device_fini,
		.driver.name	= "spdk_ioat",
#else
		.devinit	= spdk_pci_device_init,
		.devuninit	= spdk_pci_device_fini,
		.name		= "spdk_ioat",
#endif
	},

	.cb_fn = NULL,
+0 −10
Original line number Diff line number Diff line
@@ -36,7 +36,6 @@
#include "spdk/pci_ids.h"

static struct rte_pci_id nvme_pci_driver_id[] = {
#if RTE_VERSION >= RTE_VERSION_NUM(16, 7, 0, 1)
	{
		.class_id = SPDK_PCI_CLASS_NVME,
		.vendor_id = PCI_ANY_ID,
@@ -44,9 +43,6 @@ static struct rte_pci_id nvme_pci_driver_id[] = {
		.subsystem_vendor_id = PCI_ANY_ID,
		.subsystem_device_id = PCI_ANY_ID,
	},
#else
	{RTE_PCI_DEVICE(0x8086, 0x0953)},
#endif
	{ .vendor_id = 0, /* sentinel */ },
};

@@ -58,15 +54,9 @@ static struct spdk_pci_enum_ctx g_nvme_pci_drv = {
#endif
		,
		.id_table	= nvme_pci_driver_id,
#if RTE_VERSION >= RTE_VERSION_NUM(16, 11, 0, 0)
		.probe		= spdk_pci_device_init,
		.remove		= spdk_pci_device_fini,
		.driver.name	= "spdk_nvme",
#else
		.devinit	= spdk_pci_device_init,
		.devuninit	= spdk_pci_device_fini,
		.name		= "spdk_nvme",
#endif
	},

	.cb_fn = NULL,
Loading