From 972dac6999c939a3b1f70d69f81082d8cabd04c7 Mon Sep 17 00:00:00 2001 From: Xavier Simonart Date: Thu, 4 Jan 2018 14:35:57 +0100 Subject: Add support for DPDK 17.11 Change-Id: I5611ead4b61b23d6c1c983852e8c75619e08ecf9 Signed-off-by: Xavier Simonart --- VNFs/DPPD-PROX/prox_port_cfg.c | 21 +++++++++++++++++++-- 1 file changed, 19 insertions(+), 2 deletions(-) (limited to 'VNFs/DPPD-PROX/prox_port_cfg.c') 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 #include #include -#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 +#else +#if (RTE_VERSION > RTE_VERSION_NUM(17,5,0,2)) +#include +#else +#if (RTE_VERSION >= RTE_VERSION_NUM(2,1,0,0)) #include #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 -- cgit 1.2.3-korg