Skip to content

Commit

Permalink
app/eventdev: adjust event count order for pipeline test
Browse files Browse the repository at this point in the history
For the fwd mode (internal_port = false) in pipeline test,
processed-pkts increment should after enqueue. However, in
multi_stage_fwd and multi_stage_burst_fwd, "w->processed_pkts" is
increased before enqueue.

To fix this, move "w->processed_pkts" increment after enqueue, and then
the main core can load the correct number of processed packets.

Fixes: 314bcf5 ("app/eventdev: add pipeline queue worker functions")
Cc: stable@dpdk.org

Signed-off-by: Feifei Wang <feifei.wang2@arm.com>
Reviewed-by: Ruifeng Wang <ruifeng.wang@arm.com>
Acked-by: Jerin Jacob <jerinj@marvell.com>
  • Loading branch information
Feifeiarm authored and jerinjacobk committed Jan 26, 2021
1 parent fd7a6ad commit e0c0573
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions app/test-eventdev/test_pipeline_queue.c
Original file line number Diff line number Diff line change
Expand Up @@ -180,13 +180,13 @@ pipeline_queue_worker_multi_stage_fwd(void *arg)
ev.queue_id = tx_queue[ev.mbuf->port];
rte_event_eth_tx_adapter_txq_set(ev.mbuf, 0);
pipeline_fwd_event(&ev, RTE_SCHED_TYPE_ATOMIC);
pipeline_event_enqueue(dev, port, &ev);
w->processed_pkts++;
} else {
ev.queue_id++;
pipeline_fwd_event(&ev, sched_type_list[cq_id]);
pipeline_event_enqueue(dev, port, &ev);
}

pipeline_event_enqueue(dev, port, &ev);
}

return 0;
Expand Down Expand Up @@ -237,6 +237,7 @@ pipeline_queue_worker_multi_stage_burst_fwd(void *arg)
const uint8_t *tx_queue = t->tx_evqueue_id;

while (t->done == false) {
uint16_t processed_pkts = 0;
uint16_t nb_rx = rte_event_dequeue_burst(dev, port, ev,
BURST_SIZE, 0);

Expand All @@ -254,7 +255,7 @@ pipeline_queue_worker_multi_stage_burst_fwd(void *arg)
rte_event_eth_tx_adapter_txq_set(ev[i].mbuf, 0);
pipeline_fwd_event(&ev[i],
RTE_SCHED_TYPE_ATOMIC);
w->processed_pkts++;
processed_pkts++;
} else {
ev[i].queue_id++;
pipeline_fwd_event(&ev[i],
Expand All @@ -263,6 +264,7 @@ pipeline_queue_worker_multi_stage_burst_fwd(void *arg)
}

pipeline_event_enqueue_burst(dev, port, ev, nb_rx);
w->processed_pkts += processed_pkts;
}

return 0;
Expand Down

0 comments on commit e0c0573

Please sign in to comment.