path: root/examples/qos_sched
diff options
authorReshma Pattan <>2018-12-20 12:16:09 +0000
committerCristian Dumitrescu <>2018-12-22 00:22:44 +0100
commit5d3f72100904b5a2fc6b240e1cc10f1c2dd02267 (patch)
tree642152627a4c4e4f99fc6bc208f4accf49bd6848 /examples/qos_sched
parentc712b0132645eff71bbc11fb18659c5775c1d3d7 (diff)
mbuf: implement generic format for sched field
This patch implements the changes proposed in the deprecation notes [1][2]. librte_mbuf changes: The mbuf->hash.sched field is updated to support generic definition in line with the ethdev traffic manager and meter APIs. The new generic format contains: queue ID, traffic class, color. Added public APIs to set and get these new fields to and from mbuf. librte_sched changes: In addtion, following API functions of the sched library have been modified with an additional parameter of type struct rte_sched_port to accommodate the changes made to mbuf sched field. (i)rte_sched_port_pkt_write() (ii) rte_sched_port_pkt_read_tree_path() librte_pipeline, qos_sched UT, qos_sched app are updated to make use of new changes. Also mbuf->hash.txadapter has been added for eventdev txq, rte_event_eth_tx_adapter_txq_set and rte_event_eth_tx_adapter_txq_get() are updated to use mbuf->hash.txadapter.txq. doc: Release notes updated. Removed deprecation notice for mbuf->hash.sched and sched API. [1] [2] Signed-off-by: Jasvinder Singh <> Signed-off-by: Reshma Pattan <> Acked-by: Cristian Dumitrescu <> Acked-by: Konstantin Ananyev <> Acked-by: Olivier Matz <> Tested-by: Nikhil Rao <> Reviewed-by: Nikhil Rao <>
Diffstat (limited to 'examples/qos_sched')
2 files changed, 6 insertions, 2 deletions
diff --git a/examples/qos_sched/app_thread.c b/examples/qos_sched/app_thread.c
index a592742..bec4dee 100644
--- a/examples/qos_sched/app_thread.c
+++ b/examples/qos_sched/app_thread.c
@@ -73,8 +73,11 @@ app_rx_thread(struct thread_conf **confs)
for(i = 0; i < nb_rx; i++) {
&subport, &pipe, &traffic_class, &queue, &color);
- rte_sched_port_pkt_write(rx_mbufs[i], subport, pipe,
- traffic_class, queue, (enum rte_meter_color) color);
+ rte_sched_port_pkt_write(conf->sched_port,
+ rx_mbufs[i],
+ subport, pipe,
+ traffic_class, queue,
+ (enum rte_meter_color) color);
if (unlikely(rte_ring_sp_enqueue_bulk(conf->rx_ring,
diff --git a/examples/qos_sched/main.c b/examples/qos_sched/main.c
index e7c97bd..c0ed16b 100644
--- a/examples/qos_sched/main.c
+++ b/examples/qos_sched/main.c
@@ -55,6 +55,7 @@ app_main_loop(__attribute__((unused))void *dummy)
flow->rx_thread.rx_port = flow->rx_port;
flow->rx_thread.rx_ring = flow->rx_ring;
flow->rx_thread.rx_queue = flow->rx_queue;
+ flow->rx_thread.sched_port = flow->sched_port;
rx_confs[rx_idx++] = &flow->rx_thread;