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_sched.h | |
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_sched.h')
-rw-r--r-- | VNFs/DPPD-PROX/handle_sched.h | 45 |
1 files changed, 45 insertions, 0 deletions
diff --git a/VNFs/DPPD-PROX/handle_sched.h b/VNFs/DPPD-PROX/handle_sched.h new file mode 100644 index 00000000..966efbba --- /dev/null +++ b/VNFs/DPPD-PROX/handle_sched.h @@ -0,0 +1,45 @@ +/* +// Copyright (c) 2019 Intel Corporation +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +*/ + +#ifndef _PROX_SCHED_H +#define _PROX_SCHED_H + +#include "task_init.h" +#include "lconf.h" + +static int init_port_sched(struct rte_sched_port **sched_port, struct task_args *targ) +{ + *sched_port = NULL; +#if RTE_VERSION >= RTE_VERSION_NUM(19,2,0,0) + for (uint8_t idx = 0; idx < MAX_PROTOCOLS; ++idx) { + for (uint8_t ring_idx = 0; ring_idx < targ->core_task_set[idx].n_elems; ++ring_idx) { + struct core_task ct = targ->core_task_set[idx].core_task[ring_idx]; + struct task_args *dtarg = core_targ_get(ct.core, ct.task); + enum task_mode dmode = dtarg->mode; + if ((dmode == QOS) || (dmode == POLICE)) { + // Next task is QOS or POLICE + // We use the same configuration as the QoS we are transmitting to + *sched_port = rte_sched_port_config(&dtarg->qos_conf.port_params); + plog_info("\tInitializing sched_port based on QoS config of core %d task %d\n", ct.core, ct.task); + return 0; + } + } + } + return -1; +#endif + return 0; +} +#endif |