summaryrefslogtreecommitdiffstats
path: root/VNFs/DPPD-PROX/handle_police.c
diff options
context:
space:
mode:
authorXavier Simonart <xavier.simonart@intel.com>2018-07-04 11:46:25 +0200
committerPatrice Buriez <patrice.buriez@intel.com>2018-07-26 14:53:10 +0000
commit3e532aca841cbd004515930496495bea50e9b52a (patch)
tree605be5411383030f74d7c3760a60179c085d2f91 /VNFs/DPPD-PROX/handle_police.c
parent247bf8232dacf0108eb46efe8cf2151bbf855b8a (diff)
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 <xavier.simonart@intel.com> Signed-off-by: Patrice Buriez <patrice.buriez@intel.com>
Diffstat (limited to 'VNFs/DPPD-PROX/handle_police.c')
-rw-r--r--VNFs/DPPD-PROX/handle_police.c21
1 files changed, 20 insertions, 1 deletions
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], &params);
+#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], &params);
+#else
+ // TODO DPDK1805
+#endif
}
}