From 3e532aca841cbd004515930496495bea50e9b52a Mon Sep 17 00:00:00 2001 From: Xavier Simonart Date: Wed, 4 Jul 2018 11:46:25 +0200 Subject: Initial support for DPDK 18.05 This patch makes PROX compile with DPDK 18.05. However some features are disabled or will not work as expected such as: "mem info" command "police" mode Those will need to be fixed later (see DPDK1805 within code). Change-Id: Ie7d72f6ab3db68bc093c42d60d125fe86f8fbda7 Signed-off-by: Xavier Simonart Signed-off-by: Patrice Buriez --- VNFs/DPPD-PROX/handle_police.c | 21 ++++++++++++++++++++- 1 file changed, 20 insertions(+), 1 deletion(-) (limited to 'VNFs/DPPD-PROX/handle_police.c') diff --git a/VNFs/DPPD-PROX/handle_police.c b/VNFs/DPPD-PROX/handle_police.c index 125e8c0a..564cf4b5 100644 --- a/VNFs/DPPD-PROX/handle_police.c +++ b/VNFs/DPPD-PROX/handle_police.c @@ -58,8 +58,11 @@ static uint8_t handle_police(struct task_police *task, struct rte_mbuf *mbuf, ui enum rte_meter_color in_color = e_RTE_METER_GREEN; enum rte_meter_color out_color; uint32_t pkt_len = rte_pktmbuf_pkt_len(mbuf) + task->overhead; +#if RTE_VERSION < RTE_VERSION_NUM(18,5,0,0) out_color = rte_meter_srtcm_color_aware_check(&task->sr_flows[user], tsc, pkt_len, in_color); - +#else + out_color = 0; // TODO DPDK1805 +#endif return task->police_act[in_color][out_color] == ACT_DROP? OUT_DISCARD : 0; } @@ -68,7 +71,11 @@ static uint8_t handle_police_tr(struct task_police *task, struct rte_mbuf *mbuf, enum rte_meter_color in_color = e_RTE_METER_GREEN; enum rte_meter_color out_color; uint32_t pkt_len = rte_pktmbuf_pkt_len(mbuf) + task->overhead; +#if RTE_VERSION < RTE_VERSION_NUM(18,5,0,0) out_color = rte_meter_trtcm_color_aware_check(&task->tr_flows[user], tsc, pkt_len, in_color); +#else + out_color = 0;// TODO DPDK1805 +#endif if (task->runtime_flags & TASK_MARK) { #if RTE_VERSION >= RTE_VERSION_NUM(1,8,0,0) @@ -191,6 +198,10 @@ static void init_task_police(struct task_base *tbase, struct task_args *targ) struct task_police *task = (struct task_police *)tbase; const int socket_id = rte_lcore_to_socket_id(targ->lconf->id); +#if RTE_VERSION >= RTE_VERSION_NUM(18,5,0,0) + plog_warn("mode police might not be supported in this prox/dpdk version\n"); // TODO DPDK1805 +#endif + task->overhead = targ->overhead; task->runtime_flags = targ->runtime_flags; @@ -216,7 +227,11 @@ static void init_task_police(struct task_base *tbase, struct task_args *targ) }; for (uint32_t i = 0; i < targ->n_flows; ++i) { +#if RTE_VERSION < RTE_VERSION_NUM(18,5,0,0) rte_meter_srtcm_config(&task->sr_flows[i], ¶ms); +#else + // TODO DPDK1805 +#endif } } else { @@ -235,7 +250,11 @@ static void init_task_police(struct task_base *tbase, struct task_args *targ) }; for (uint32_t i = 0; i < targ->n_flows; ++i) { +#if RTE_VERSION < RTE_VERSION_NUM(18,5,0,0) rte_meter_trtcm_config(&task->tr_flows[i], ¶ms); +#else + // TODO DPDK1805 +#endif } } -- cgit 1.2.3-korg