summaryrefslogtreecommitdiffstats
path: root/VNFs/DPPD-PROX
diff options
context:
space:
mode:
Diffstat (limited to 'VNFs/DPPD-PROX')
-rw-r--r--VNFs/DPPD-PROX/defaults.c15
-rw-r--r--VNFs/DPPD-PROX/handle_qos.c4
-rw-r--r--VNFs/DPPD-PROX/prox_args.c35
3 files changed, 54 insertions, 0 deletions
diff --git a/VNFs/DPPD-PROX/defaults.c b/VNFs/DPPD-PROX/defaults.c
index a2becb07..2156a74f 100644
--- a/VNFs/DPPD-PROX/defaults.c
+++ b/VNFs/DPPD-PROX/defaults.c
@@ -76,6 +76,16 @@ static struct rte_eth_txconf default_tx_conf = {
.tx_rs_thresh = 32, /* Use PMD default values */
};
+#if RTE_VERSION >= RTE_VERSION_NUM(20,11,0,0)
+static struct rte_sched_subport_profile_params subport_profile_params_default = {
+ .tb_rate = TEN_GIGABIT / NB_PIPES,
+ .tb_size = 4000000,
+
+ .tc_rate = {TEN_GIGABIT / NB_PIPES, TEN_GIGABIT / NB_PIPES, TEN_GIGABIT / NB_PIPES, TEN_GIGABIT / NB_PIPES},
+ .tc_period = 40,
+};
+#endif
+
static struct rte_sched_port_params port_params_default = {
.name = "port_0",
.socket = 0,
@@ -83,6 +93,9 @@ static struct rte_sched_port_params port_params_default = {
.rate = 0,
.frame_overhead = RTE_SCHED_FRAME_OVERHEAD_DEFAULT,
.n_subports_per_port = 1,
+#if RTE_VERSION >= RTE_VERSION_NUM(20,11,0,0)
+ .subport_profiles = &subport_profile_params_default,
+#endif
.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},
@@ -106,10 +119,12 @@ static struct rte_sched_pipe_params pipe_params_default = {
};
static struct rte_sched_subport_params subport_params_default = {
+#if RTE_VERSION < RTE_VERSION_NUM(20,11,0,0)
.tb_rate = TEN_GIGABIT,
.tb_size = 4000000,
.tc_rate = {TEN_GIGABIT, TEN_GIGABIT, TEN_GIGABIT, TEN_GIGABIT},
.tc_period = 40, /* default was 10 */
+#endif
#if RTE_VERSION > RTE_VERSION_NUM(19,11,0,0)
.qsize = {QUEUE_SIZES, QUEUE_SIZES, QUEUE_SIZES, QUEUE_SIZES},
.pipe_profiles = NULL,
diff --git a/VNFs/DPPD-PROX/handle_qos.c b/VNFs/DPPD-PROX/handle_qos.c
index 5af7a310..de9548f6 100644
--- a/VNFs/DPPD-PROX/handle_qos.c
+++ b/VNFs/DPPD-PROX/handle_qos.c
@@ -135,7 +135,11 @@ static void init_task_qos(struct task_base *tbase, struct task_args *targ)
PROX_PANIC(task->sched_port == NULL, "failed to create sched_port");
plog_info("number of pipes: %d\n\n", targ->qos_conf.port_params.n_pipes_per_subport);
+#if RTE_VERSION >= RTE_VERSION_NUM(20,11,0,0)
+ int err = rte_sched_subport_config(task->sched_port, 0, targ->qos_conf.subport_params, 0);
+#else
int err = rte_sched_subport_config(task->sched_port, 0, targ->qos_conf.subport_params);
+#endif
PROX_PANIC(err != 0, "Failed setting up sched_port subport, error: %d", err);
/* only single subport and single pipe profile is supported */
diff --git a/VNFs/DPPD-PROX/prox_args.c b/VNFs/DPPD-PROX/prox_args.c
index d8c41021..d7c436d6 100644
--- a/VNFs/DPPD-PROX/prox_args.c
+++ b/VNFs/DPPD-PROX/prox_args.c
@@ -1632,46 +1632,70 @@ static int get_core_cfg(unsigned sindex, char *str, void *data)
return 0;
}
if (STR_EQ(str, "subport tb rate")) {
+#if RTE_VERSION >= RTE_VERSION_NUM(20,11,0,0)
+ return parse_u64(&targ->qos_conf.port_params.subport_profiles->tb_rate, pkey);
+#else
#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
+#endif
}
if (STR_EQ(str, "subport tb size")) {
+#if RTE_VERSION >= RTE_VERSION_NUM(20,11,0,0)
+ return parse_u64(&targ->qos_conf.port_params.subport_profiles->tb_size, pkey);
+#else
#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
+#endif
}
if (STR_EQ(str, "subport tc 0 rate")) {
+#if RTE_VERSION >= RTE_VERSION_NUM(20,11,0,0)
+ return parse_u64(&targ->qos_conf.port_params.subport_profiles->tc_rate[0], pkey);
+#else
#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
+#endif
}
if (STR_EQ(str, "subport tc 1 rate")) {
+#if RTE_VERSION >= RTE_VERSION_NUM(20,11,0,0)
+ return parse_u64(&targ->qos_conf.port_params.subport_profiles->tc_rate[1], pkey);
+#else
#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
+#endif
}
if (STR_EQ(str, "subport tc 2 rate")) {
+#if RTE_VERSION >= RTE_VERSION_NUM(20,11,0,0)
+ return parse_u64(&targ->qos_conf.port_params.subport_profiles->tc_rate[2], pkey);
+#else
#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
+#endif
}
if (STR_EQ(str, "subport tc 3 rate")) {
+#if RTE_VERSION >= RTE_VERSION_NUM(20,11,0,0)
+ return parse_u64(&targ->qos_conf.port_params.subport_profiles->tc_rate[3], pkey);
+#else
#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
+#endif
}
if (STR_EQ(str, "subport tc rate")) {
@@ -1681,19 +1705,30 @@ static int get_core_cfg(unsigned sindex, char *str, void *data)
return -1;
}
+#if RTE_VERSION >= RTE_VERSION_NUM(20,11,0,0)
+ targ->qos_conf.port_params.subport_profiles->tc_rate[0] = val;
+ targ->qos_conf.port_params.subport_profiles->tc_rate[1] = val;
+ targ->qos_conf.port_params.subport_profiles->tc_rate[2] = val;
+ targ->qos_conf.port_params.subport_profiles->tc_rate[3] = val;
+#else
targ->qos_conf.subport_params[0].tc_rate[0] = val;
targ->qos_conf.subport_params[0].tc_rate[1] = val;
targ->qos_conf.subport_params[0].tc_rate[2] = val;
targ->qos_conf.subport_params[0].tc_rate[3] = val;
+#endif
return 0;
}
if (STR_EQ(str, "subport tc period")) {
+#if RTE_VERSION >= RTE_VERSION_NUM(20,11,0,0)
+ return parse_u64(&targ->qos_conf.port_params.subport_profiles->tc_period, pkey);
+#else
#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
+#endif
}
if (STR_EQ(str, "pipe tb rate")) {
#if RTE_VERSION > RTE_VERSION_NUM(19,11,0,0)