diff options
author | Xavier Simonart <xavier.simonart@intel.com> | 2019-05-28 15:31:43 +0200 |
---|---|---|
committer | Xavier Simonart <xavier.simonart@intel.com> | 2019-10-09 15:50:26 +0200 |
commit | 4cc4dabe80eb7d19c20920b7ec20899d6a76a1dd (patch) | |
tree | ee67e444dbc9806f1d63ba3d821788b422cb8bbf /VNFs/DPPD-PROX/handle_acl.c | |
parent | 73b79d29bc926a87e317c3881c197fc2db64e9d0 (diff) |
Added support for DPDK 19.02 and 19.05
This includes supporting following API changes
- RTE_VER_... now in rte_config.h instead of rte_version.h
- <rte_ethdev.h> now seems required by <rte_eth_ctrl.h>
- rte_sched_port_pkt_write takes extra argument
- rte_sched_port_pkt_read_tree_path takes extra argument
- enum rte_meter_color replaced by rte_color
The extra argument, sched_port, is initialized based on qos_conf parameters.
Modes such as qinq_encap4 uses sched_port when doing classification, but does
not set qos_conf params. It inherits the sched_port from QoS
Change-Id: If8312918241e7d482161a7538f53faac6c303e86
Signed-off-by: Xavier Simonart <xavier.simonart@intel.com>
Diffstat (limited to 'VNFs/DPPD-PROX/handle_acl.c')
-rw-r--r-- | VNFs/DPPD-PROX/handle_acl.c | 22 |
1 files changed, 17 insertions, 5 deletions
diff --git a/VNFs/DPPD-PROX/handle_acl.c b/VNFs/DPPD-PROX/handle_acl.c index 5138eef9..57b476a7 100644 --- a/VNFs/DPPD-PROX/handle_acl.c +++ b/VNFs/DPPD-PROX/handle_acl.c @@ -34,6 +34,8 @@ #include "lconf.h" #include "prefetch.h" #include "etypes.h" +#include "prox_compat.h" +#include "handle_sched.h" struct task_acl { struct task_base base; @@ -46,18 +48,20 @@ struct task_acl { void *field_defs; size_t field_defs_size; uint32_t n_field_defs; + struct rte_sched_port *sched_port; }; -static void set_tc(struct rte_mbuf *mbuf, uint32_t tc) +static void set_tc(struct task_base *tbase, struct rte_mbuf *mbuf, uint32_t tc) { + struct task_acl *task = (struct task_acl *)tbase; #if RTE_VERSION >= RTE_VERSION_NUM(1,8,0,0) uint32_t subport, pipe, traffic_class, queue; - enum rte_meter_color color; + enum prox_rte_color color; - rte_sched_port_pkt_read_tree_path(mbuf, &subport, &pipe, &traffic_class, &queue); + prox_rte_sched_port_pkt_read_tree_path(task->sched_port, mbuf, &subport, &pipe, &traffic_class, &queue); color = rte_sched_port_pkt_read_color(mbuf); - rte_sched_port_pkt_write(mbuf, subport, pipe, tc, queue, color); + prox_rte_sched_port_pkt_write(task->sched_port, mbuf, subport, pipe, tc, queue, color); #else struct rte_sched_port_hierarchy *sched = (struct rte_sched_port_hierarchy *) &mbuf->pkt.hash.sched; @@ -110,7 +114,7 @@ static int handle_acl_bulk(struct task_base *tbase, struct rte_mbuf **mbufs, uin out[i] = 0; // __attribute__ ((fallthrough)); case ACL_RATE_LIMIT: - set_tc(mbufs[i], 3); + set_tc(tbase, mbufs[i], 3); break; }; } @@ -210,6 +214,14 @@ static void init_task_acl(struct task_base *tbase, struct task_args *targ) targ->lconf->ctrl_timeout = freq_to_tsc(targ->ctrl_freq); targ->lconf->ctrl_func_m[targ->task] = acl_msg; + + // If rate limiting is used tc will be set, sched_port must be initialized, and tc will be used by a following policing or qos task + int rc = init_port_sched(&task->sched_port, targ); + + // ACL can be used to accept/drop packets and/or to set rate limiting. If using rate limiting, then sched_port must be defined + // TODO: check whether rate limiting is configured, and, if yes, check that QoS or policing task configures the qos_conf.params. + if (rc) + plog_info("Did not find any QoS or Policing task to transmit to => setting tc will not work\n"); } int str_to_rule(struct acl4_rule *rule, char** fields, int n_rules, int use_qinq) |