MCPcopy Create free account
hub / github.com/F-Stack/f-stack / test_app_process_queue

Function test_app_process_queue

dpdk/app/test/test_dispatcher.c:341–404  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

339}
340
341static void
342test_app_process_queue(uint8_t p_event_dev_id, uint8_t p_event_port_id,
343 struct rte_event *in_events, uint16_t num,
344 void *cb_data)
345{
346 struct app_queue *app_queue = cb_data;
347 struct test_app *app = container_of(app_queue, struct test_app,
348 queues[app_queue->queue_id]);
349 unsigned int lcore_id = rte_lcore_id();
350 bool intermediate_queue = app_queue->queue_id != LAST_QUEUE_ID;
351 int event_port_id;
352 uint16_t i;
353 struct rte_event out_events[num];
354
355 event_port_id = test_app_get_worker_port(app, lcore_id);
356
357 if (event_port_id < 0 || p_event_dev_id != app->event_dev_id ||
358 p_event_port_id != event_port_id) {
359 test_app_queue_note_error(app);
360 return;
361 }
362
363 for (i = 0; i < num; i++) {
364 const struct rte_event *in_event = &in_events[i];
365 struct rte_event *out_event = &out_events[i];
366 uint64_t sn = in_event->u64;
367 uint64_t expected_sn;
368
369 if (in_event->queue_id != app_queue->queue_id) {
370 test_app_queue_note_error(app);
371 return;
372 }
373
374 expected_sn = app_queue->sn[in_event->flow_id]++;
375
376 if (expected_sn != sn) {
377 test_app_queue_note_error(app);
378 return;
379 }
380
381 if (intermediate_queue)
382 *out_event = (struct rte_event) {
383 .queue_id = in_event->queue_id + 1,
384 .flow_id = in_event->flow_id,
385 .sched_type = RTE_SCHED_TYPE_ATOMIC,
386 .op = RTE_EVENT_OP_FORWARD,
387 .priority = RTE_EVENT_DEV_PRIORITY_NORMAL,
388 .u64 = sn
389 };
390 }
391
392 if (intermediate_queue) {
393 uint16_t n = 0;
394
395 do {
396 n += rte_event_enqueue_forward_burst(p_event_dev_id,
397 p_event_port_id,
398 out_events + n,

Callers

nothing calls this directly

Calls 4

rte_lcore_idFunction · 0.85
test_app_get_worker_portFunction · 0.85

Tested by

no test coverage detected