diff options
author | Xavier Simonart <xavier.simonart@intel.com> | 2018-01-04 14:35:57 +0100 |
---|---|---|
committer | Xavier Simonart <xavier.simonart@intel.com> | 2018-01-04 14:37:56 +0100 |
commit | 972dac6999c939a3b1f70d69f81082d8cabd04c7 (patch) | |
tree | 1cf056c902771ebbb8ddbbc0f021b3662b72708b /VNFs/DPPD-PROX/prox_port_cfg.c | |
parent | 25ffc7091ffe7069e6b4aeed9a5a69aa034c58f9 (diff) |
Add support for DPDK 17.11
Change-Id: I5611ead4b61b23d6c1c983852e8c75619e08ecf9
Signed-off-by: Xavier Simonart <xavier.simonart@intel.com>
Diffstat (limited to 'VNFs/DPPD-PROX/prox_port_cfg.c')
-rw-r--r-- | VNFs/DPPD-PROX/prox_port_cfg.c | 21 |
1 files changed, 19 insertions, 2 deletions
diff --git a/VNFs/DPPD-PROX/prox_port_cfg.c b/VNFs/DPPD-PROX/prox_port_cfg.c index d9ce82d2..bf8dbda2 100644 --- a/VNFs/DPPD-PROX/prox_port_cfg.c +++ b/VNFs/DPPD-PROX/prox_port_cfg.c @@ -19,9 +19,17 @@ #include <rte_version.h> #include <rte_eth_ring.h> #include <rte_mbuf.h> -#if (RTE_VERSION >= RTE_VERSION_NUM(2,1,0,0)) && (RTE_VERSION <= RTE_VERSION_NUM(17,5,0,1)) +#if (RTE_VERSION >= RTE_VERSION_NUM(17,11,0,0)) +#include <rte_bus_vdev.h> +#else +#if (RTE_VERSION > RTE_VERSION_NUM(17,5,0,2)) +#include <rte_dev.h> +#else +#if (RTE_VERSION >= RTE_VERSION_NUM(2,1,0,0)) #include <rte_eth_null.h> #endif +#endif +#endif #include "prox_port_cfg.h" #include "prox_globals.h" @@ -55,12 +63,17 @@ int prox_last_port_active(void) return ret; } +#if RTE_VERSION >= RTE_VERSION_NUM(17,11,0,0) +static int lsc_cb(__attribute__((unused)) uint16_t port_id, enum rte_eth_event_type type, __attribute__((unused)) void *param, + __attribute__((unused)) void *ret_param) +#else #if RTE_VERSION >= RTE_VERSION_NUM(17,8,0,1) static int lsc_cb(__attribute__((unused)) uint8_t port_id, enum rte_eth_event_type type, __attribute__((unused)) void *param, __attribute__((unused)) void *ret_param) #else static void lsc_cb(__attribute__((unused)) uint8_t port_id, enum rte_eth_event_type type, __attribute__((unused)) void *param) #endif +#endif { if (RTE_ETH_EVENT_INTR_LSC != type) { #if RTE_VERSION >= RTE_VERSION_NUM(17,8,0,1) @@ -120,13 +133,17 @@ void init_rte_dev(int use_dummy_devices) PROX_PANIC(use_dummy_devices && nb_ports, "Can't use dummy devices while there are also real ports\n"); if (use_dummy_devices) { -#if (RTE_VERSION >= RTE_VERSION_NUM(2,1,0,0)) && (RTE_VERSION <= RTE_VERSION_NUM(17,5,0,1)) +#if (RTE_VERSION >= RTE_VERSION_NUM(2,1,0,0)) nb_ports = prox_last_port_active() + 1; plog_info("Creating %u dummy devices\n", nb_ports); char port_name[32] = "0dummy_dev"; for (uint32_t i = 0; i < nb_ports; ++i) { +#if (RTE_VERSION > RTE_VERSION_NUM(17,5,0,1)) + rte_vdev_init(port_name, "size=ETHER_MIN_LEN,copy=0"); +#else eth_dev_null_create(port_name, 0, ETHER_MIN_LEN, 0); +#endif port_name[0]++; } #else |