diff options
author | Xavier Simonart <xavier.simonart@intel.com> | 2020-01-31 18:20:15 +0100 |
---|---|---|
committer | Patrice Buriez <patrice.buriez@intel.com> | 2020-04-20 18:34:21 +0000 |
commit | b4274493514c4467dbc6812afff30bcfe43407a5 (patch) | |
tree | bbedc60034da8aa7f920809158200881fbd9aa3b | |
parent | a9f2cbbc2d12d6c767341e675adc5921c39c21a9 (diff) |
Added support for DPDK 19.11
Change-Id: I58fa7a0ab7aaa27e9f9383f7995bb71bf0952618
Signed-off-by: Xavier Simonart <xavier.simonart@intel.com>
-rw-r--r-- | VNFs/DPPD-PROX/README | 2 | ||||
-rw-r--r-- | VNFs/DPPD-PROX/defaults.c | 11 | ||||
-rw-r--r-- | VNFs/DPPD-PROX/handle_nsh.c | 4 | ||||
-rw-r--r-- | VNFs/DPPD-PROX/prox_args.c | 64 | ||||
-rw-r--r-- | VNFs/DPPD-PROX/prox_compat.h | 6 | ||||
-rw-r--r-- | VNFs/DPPD-PROX/prox_port_cfg.c | 2 | ||||
-rw-r--r-- | VNFs/DPPD-PROX/version.h | 2 |
7 files changed, 87 insertions, 4 deletions
diff --git a/VNFs/DPPD-PROX/README b/VNFs/DPPD-PROX/README index 1e4b3585..545e2ff0 100644 --- a/VNFs/DPPD-PROX/README +++ b/VNFs/DPPD-PROX/README @@ -25,7 +25,7 @@ finer grained network functions like QoS, Routing, load-balancing... Compiling and running this application -------------------------------------- This application supports DPDK 16.04, 16.11, 16.11.1, 17.02, 17.05, 17.08, -17.11, 18.02, 18.05, 18.08, 18.11, 19.02, 19.05 and 19.08. +17.11, 18.02, 18.05, 18.08, 18.11, 19.02, 19.05, 19.08 and 19.11. The following commands assume that the following variables have been set: diff --git a/VNFs/DPPD-PROX/defaults.c b/VNFs/DPPD-PROX/defaults.c index 27240484..b839453d 100644 --- a/VNFs/DPPD-PROX/defaults.c +++ b/VNFs/DPPD-PROX/defaults.c @@ -82,9 +82,11 @@ static struct rte_sched_port_params port_params_default = { .frame_overhead = RTE_SCHED_FRAME_OVERHEAD_DEFAULT, .n_subports_per_port = 1, .n_pipes_per_subport = NB_PIPES, +#if RTE_VERSION < RTE_VERSION_NUM(19,11,0,0) .qsize = {QUEUE_SIZES, QUEUE_SIZES, QUEUE_SIZES, QUEUE_SIZES}, .pipe_profiles = NULL, .n_pipe_profiles = 1 /* only one profile */ +#endif }; static struct rte_sched_pipe_params pipe_params_default = { @@ -106,6 +108,11 @@ static struct rte_sched_subport_params subport_params_default = { .tb_size = 4000000, .tc_rate = {TEN_GIGABIT, TEN_GIGABIT, TEN_GIGABIT, TEN_GIGABIT}, .tc_period = 40, /* default was 10 */ +#if RTE_VERSION >= RTE_VERSION_NUM(19,11,0,0) + .qsize = {QUEUE_SIZES, QUEUE_SIZES, QUEUE_SIZES, QUEUE_SIZES}, + .pipe_profiles = NULL, + .n_pipe_profiles = 1 /* only one profile */ +#endif }; void set_global_defaults(__attribute__((unused)) struct prox_cfg *prox_cfg) @@ -137,7 +144,11 @@ void set_task_defaults(struct prox_cfg* prox_cfg, struct lcore_cfg* lcore_cfg_in targ->qos_conf.port_params = port_params_default; targ->qos_conf.pipe_params[0] = pipe_params_default; targ->qos_conf.subport_params[0] = subport_params_default; +#if RTE_VERSION >= RTE_VERSION_NUM(19,11,0,0) + targ->qos_conf.subport_params[0].pipe_profiles = targ->qos_conf.pipe_params; +#else targ->qos_conf.port_params.pipe_profiles = targ->qos_conf.pipe_params; +#endif targ->qos_conf.port_params.rate = TEN_GIGABIT; targ->qinq_tag = ETYPE_8021ad; targ->n_concur_conn = 8192*2; diff --git a/VNFs/DPPD-PROX/handle_nsh.c b/VNFs/DPPD-PROX/handle_nsh.c index c9474255..6d67f99d 100644 --- a/VNFs/DPPD-PROX/handle_nsh.c +++ b/VNFs/DPPD-PROX/handle_nsh.c @@ -18,6 +18,10 @@ #include <rte_ether.h> #include <rte_ip.h> #include <rte_udp.h> +#include <rte_version.h> +#if RTE_VERSION >= RTE_VERSION_NUM(19,11,0,0) +#include <rte_vxlan.h> +#endif #include "vxlangpe_nsh.h" #include "task_base.h" diff --git a/VNFs/DPPD-PROX/prox_args.c b/VNFs/DPPD-PROX/prox_args.c index d31fac29..5d33957c 100644 --- a/VNFs/DPPD-PROX/prox_args.c +++ b/VNFs/DPPD-PROX/prox_args.c @@ -1416,30 +1416,60 @@ static int get_core_cfg(unsigned sindex, char *str, void *data) if (err) { return -1; } - +#if RTE_VERSION >= RTE_VERSION_NUM(19,11,0,0) + targ->qos_conf.subport_params[0].qsize[0] = val; + targ->qos_conf.subport_params[0].qsize[1] = val; + targ->qos_conf.subport_params[0].qsize[2] = val; + targ->qos_conf.subport_params[0].qsize[3] = val; +#else targ->qos_conf.port_params.qsize[0] = val; targ->qos_conf.port_params.qsize[1] = val; targ->qos_conf.port_params.qsize[2] = val; targ->qos_conf.port_params.qsize[3] = val; +#endif return 0; } if (STR_EQ(str, "subport tb rate")) { +#if RTE_VERSION >= RTE_VERSION_NUM(19,11,0,0) + return parse_u64(&targ->qos_conf.subport_params[0].tb_rate, pkey); +#else return parse_int(&targ->qos_conf.subport_params[0].tb_rate, pkey); +#endif } if (STR_EQ(str, "subport tb size")) { +#if RTE_VERSION >= RTE_VERSION_NUM(19,11,0,0) + return parse_u64(&targ->qos_conf.subport_params[0].tb_size, pkey); +#else return parse_int(&targ->qos_conf.subport_params[0].tb_size, pkey); +#endif } if (STR_EQ(str, "subport tc 0 rate")) { +#if RTE_VERSION >= RTE_VERSION_NUM(19,11,0,0) + return parse_u64(&targ->qos_conf.subport_params[0].tc_rate[0], pkey); +#else return parse_int(&targ->qos_conf.subport_params[0].tc_rate[0], pkey); +#endif } if (STR_EQ(str, "subport tc 1 rate")) { +#if RTE_VERSION >= RTE_VERSION_NUM(19,11,0,0) + return parse_u64(&targ->qos_conf.subport_params[0].tc_rate[1], pkey); +#else return parse_int(&targ->qos_conf.subport_params[0].tc_rate[1], pkey); +#endif } if (STR_EQ(str, "subport tc 2 rate")) { +#if RTE_VERSION >= RTE_VERSION_NUM(19,11,0,0) + return parse_u64(&targ->qos_conf.subport_params[0].tc_rate[2], pkey); +#else return parse_int(&targ->qos_conf.subport_params[0].tc_rate[2], pkey); +#endif } if (STR_EQ(str, "subport tc 3 rate")) { +#if RTE_VERSION >= RTE_VERSION_NUM(19,11,0,0) + return parse_u64(&targ->qos_conf.subport_params[0].tc_rate[3], pkey); +#else return parse_int(&targ->qos_conf.subport_params[0].tc_rate[3], pkey); +#endif } if (STR_EQ(str, "subport tc rate")) { @@ -1457,13 +1487,25 @@ static int get_core_cfg(unsigned sindex, char *str, void *data) return 0; } if (STR_EQ(str, "subport tc period")) { +#if RTE_VERSION >= RTE_VERSION_NUM(19,11,0,0) + return parse_u64(&targ->qos_conf.subport_params[0].tc_period, pkey); +#else return parse_int(&targ->qos_conf.subport_params[0].tc_period, pkey); +#endif } if (STR_EQ(str, "pipe tb rate")) { +#if RTE_VERSION >= RTE_VERSION_NUM(19,11,0,0) + return parse_u64(&targ->qos_conf.pipe_params[0].tb_rate, pkey); +#else return parse_int(&targ->qos_conf.pipe_params[0].tb_rate, pkey); +#endif } if (STR_EQ(str, "pipe tb size")) { +#if RTE_VERSION >= RTE_VERSION_NUM(19,11,0,0) + return parse_u64(&targ->qos_conf.pipe_params[0].tb_size, pkey); +#else return parse_int(&targ->qos_conf.pipe_params[0].tb_size, pkey); +#endif } if (STR_EQ(str, "pipe tc rate")) { uint32_t val; @@ -1479,19 +1521,39 @@ static int get_core_cfg(unsigned sindex, char *str, void *data) return 0; } if (STR_EQ(str, "pipe tc 0 rate")) { +#if RTE_VERSION >= RTE_VERSION_NUM(19,11,0,0) + return parse_u64(&targ->qos_conf.pipe_params[0].tc_rate[0], pkey); +#else return parse_int(&targ->qos_conf.pipe_params[0].tc_rate[0], pkey); +#endif } if (STR_EQ(str, "pipe tc 1 rate")) { +#if RTE_VERSION >= RTE_VERSION_NUM(19,11,0,0) + return parse_u64(&targ->qos_conf.pipe_params[0].tc_rate[1], pkey); +#else return parse_int(&targ->qos_conf.pipe_params[0].tc_rate[1], pkey); +#endif } if (STR_EQ(str, "pipe tc 2 rate")) { +#if RTE_VERSION >= RTE_VERSION_NUM(19,11,0,0) + return parse_u64(&targ->qos_conf.pipe_params[0].tc_rate[2], pkey); +#else return parse_int(&targ->qos_conf.pipe_params[0].tc_rate[2], pkey); +#endif } if (STR_EQ(str, "pipe tc 3 rate")) { +#if RTE_VERSION >= RTE_VERSION_NUM(19,11,0,0) + return parse_u64(&targ->qos_conf.pipe_params[0].tc_rate[3], pkey); +#else return parse_int(&targ->qos_conf.pipe_params[0].tc_rate[3], pkey); +#endif } if (STR_EQ(str, "pipe tc period")) { +#if RTE_VERSION >= RTE_VERSION_NUM(19,11,0,0) + return parse_u64(&targ->qos_conf.pipe_params[0].tc_period, pkey); +#else return parse_int(&targ->qos_conf.pipe_params[0].tc_period, pkey); +#endif } if (STR_EQ(str, "police action")) { char *in = strstr(pkey, " io="); diff --git a/VNFs/DPPD-PROX/prox_compat.h b/VNFs/DPPD-PROX/prox_compat.h index 9c18e36f..7cf0add9 100644 --- a/VNFs/DPPD-PROX/prox_compat.h +++ b/VNFs/DPPD-PROX/prox_compat.h @@ -253,4 +253,10 @@ static int prox_rte_cryptodev_queue_pair_setup(uint8_t dev_id, uint16_t queue_pa #endif #endif // CONFIG_RTE_LIBRTE_PMD_AESNI_MB +#if RTE_VERSION < RTE_VERSION_NUM(19,11,0,0) +#define prox_rte_eth_dev_count_avail() rte_eth_dev_count() +#else +#define prox_rte_eth_dev_count_avail() rte_eth_dev_count_avail() +#endif + #endif // _PROX_COMPAT_H diff --git a/VNFs/DPPD-PROX/prox_port_cfg.c b/VNFs/DPPD-PROX/prox_port_cfg.c index 9af141f2..74514062 100644 --- a/VNFs/DPPD-PROX/prox_port_cfg.c +++ b/VNFs/DPPD-PROX/prox_port_cfg.c @@ -169,7 +169,7 @@ void init_rte_dev(int use_dummy_devices) struct rte_eth_dev_info dev_info; const struct rte_pci_device *pci_dev; - nb_ports = rte_eth_dev_count(); + nb_ports = prox_rte_eth_dev_count_avail(); /* get available ports configuration */ PROX_PANIC(use_dummy_devices && nb_ports, "Can't use dummy devices while there are also real ports\n"); diff --git a/VNFs/DPPD-PROX/version.h b/VNFs/DPPD-PROX/version.h index 727b2b80..fd52ba4b 100644 --- a/VNFs/DPPD-PROX/version.h +++ b/VNFs/DPPD-PROX/version.h @@ -19,7 +19,7 @@ /* PROGRAM_NAME defined through Makefile */ #define VERSION_MAJOR 0 // Pre-production -#define VERSION_MINOR 1908 // 19.08 i.e. August 2019 +#define VERSION_MINOR 1911 // 19.11 i.e. Nov 2019 #define VERSION_REV 0 static inline char *VERSION_STR(void) |