#include <rte_cycles.h>
#include <rte_eventdev.h>
#include <rte_pause.h>
+#include <rte_service.h>
+#include <rte_service_component.h>
#include "test.h"
uint8_t port[MAX_PORTS];
uint8_t qid[MAX_QIDS];
int nb_qids;
+ uint32_t service_id;
};
static struct rte_event release_ev;
}
}
- rte_event_schedule(evdev);
+ rte_service_run_iter_on_app_lcore(t->service_id);
struct test_event_dev_stats stats;
err = test_event_dev_stats_get(evdev, &stats);
}
/* Run schedule() as dir packets may need to be re-ordered */
- rte_event_schedule(evdev);
+ rte_service_run_iter_on_app_lcore(t->service_id);
struct test_event_dev_stats stats;
err = test_event_dev_stats_get(evdev, &stats);
printf("%d: error failed to enqueue\n", __LINE__);
return -1;
}
- rte_event_schedule(evdev);
+ rte_service_run_iter_on_app_lcore(t->service_id);
uint32_t deq_pkts;
deq_pkts = rte_event_dequeue_burst(evdev, 0, &ev, 1, 0);
return -1;
}
}
- rte_event_schedule(evdev);
+ rte_service_run_iter_on_app_lcore(t->service_id);
/* Check stats for all NUM_PKTS arrived to sched core */
struct test_event_dev_stats stats;
}
/* schedule */
- rte_event_schedule(evdev);
+ rte_service_run_iter_on_app_lcore(t->service_id);
struct test_event_dev_stats stats;
}
}
- rte_event_schedule(evdev);
+ rte_service_run_iter_on_app_lcore(t->service_id);
/* Device names / values */
int num_stats = rte_event_dev_xstats_names_get(evdev,
}
}
- rte_event_schedule(evdev);
+ rte_service_run_iter_on_app_lcore(t->service_id);
struct rte_event ev[NPKTS];
int deq = rte_event_dequeue_burst(evdev, t->port[0], ev,
}
}
- rte_event_schedule(evdev);
+ rte_service_run_iter_on_app_lcore(t->service_id);
static const char * const dev_names[] = {
"dev_rx", "dev_tx", "dev_drop", "dev_sched_calls",
}
}
- rte_event_schedule(evdev);
+ rte_service_run_iter_on_app_lcore(t->service_id);
/* dequeue packets, verify priority was upheld */
struct rte_event ev[32];
}
}
- rte_event_schedule(evdev);
+ rte_service_run_iter_on_app_lcore(t->service_id);
struct test_event_dev_stats stats;
err = test_event_dev_stats_get(evdev, &stats);
}
/* call the scheduler */
- rte_event_schedule(evdev);
+ rte_service_run_iter_on_app_lcore(t->service_id);
/* Dequeue the flow 0 packet from port 1, so that we can then drop */
struct rte_event ev;
rte_event_enqueue_burst(evdev, t->port[1], &release_ev, 1);
/* call the scheduler */
- rte_event_schedule(evdev);
+ rte_service_run_iter_on_app_lcore(t->service_id);
/*
* Set up the next set of flows, first a new flow to fill up
}
/* schedule */
- rte_event_schedule(evdev);
+ rte_service_run_iter_on_app_lcore(t->service_id);
err = test_event_dev_stats_get(evdev, &stats);
if (err) {
while (rte_event_dequeue_burst(evdev, i, &ev, 1, 0))
rte_event_enqueue_burst(evdev, i, &release_ev, 1);
}
- rte_event_schedule(evdev);
+ rte_service_run_iter_on_app_lcore(t->service_id);
cleanup(t);
return 0;
}
/* call the scheduler */
- rte_event_schedule(evdev);
+ rte_service_run_iter_on_app_lcore(t->service_id);
err = test_event_dev_stats_get(evdev, &stats);
if (err) {
return -1;
}
- rte_event_schedule(evdev);
+ rte_service_run_iter_on_app_lcore(t->service_id);
err = test_event_dev_stats_get(evdev, &stats);
if (err) {
printf("%d: Failed to enqueue\n", __LINE__);
return -1;
}
- rte_event_schedule(evdev);
+ rte_service_run_iter_on_app_lcore(t->service_id);
err = test_event_dev_stats_get(evdev, &stats);
if (stats.port_inflight[wrk_enq] != 0) {
}
/* schedule */
- rte_event_schedule(evdev);
+ rte_service_run_iter_on_app_lcore(t->service_id);
err = test_event_dev_stats_get(evdev, &stats);
if (err) {
* As the scheduler core decrements inflights, it needs to run to
* process packets to act on the drop messages
*/
- rte_event_schedule(evdev);
+ rte_service_run_iter_on_app_lcore(t->service_id);
err = test_event_dev_stats_get(evdev, &stats);
if (stats.port_inflight[p1] != 0) {
* As the scheduler core decrements inflights, it needs to run to
* process packets to act on the drop messages
*/
- rte_event_schedule(evdev);
+ rte_service_run_iter_on_app_lcore(t->service_id);
err = test_event_dev_stats_get(evdev, &stats);
if (stats.port_inflight[p2] != 0) {
}
}
- rte_event_schedule(evdev);
+ rte_service_run_iter_on_app_lcore(t->service_id);
/* use extra slot to make logic in loops easier */
struct rte_event deq_ev[w3_port + 1];
return -1;
}
}
- rte_event_schedule(evdev);
+ rte_service_run_iter_on_app_lcore(t->service_id);
/* dequeue from the tx ports, we should get 3 packets */
deq_pkts = rte_event_dequeue_burst(evdev, t->port[tx_port], deq_ev,
printf("%d: Error doing first enqueue\n", __LINE__);
goto err;
}
- rte_event_schedule(evdev);
+ rte_service_run_iter_on_app_lcore(t->service_id);
if (rte_event_dev_xstats_by_name_get(evdev, "port_0_cq_ring_used", NULL)
!= 1)
printf("%d: Error with enqueue\n", __LINE__);
goto err;
}
- rte_event_schedule(evdev);
+ rte_service_run_iter_on_app_lcore(t->service_id);
} while (rte_event_dev_xstats_by_name_get(evdev,
rx_port_free_stat, NULL) != 0);
printf("%d: Error with enqueue\n", __LINE__);
goto err;
}
- rte_event_schedule(evdev);
+ rte_service_run_iter_on_app_lcore(t->service_id);
/* check that the other port still has an empty CQ */
if (rte_event_dev_xstats_by_name_get(evdev, other_port_used_stat, NULL)
printf("%d: Error with enqueue\n", __LINE__);
goto err;
}
- rte_event_schedule(evdev);
+ rte_service_run_iter_on_app_lcore(t->service_id);
if (rte_event_dev_xstats_by_name_get(evdev, other_port_used_stat, NULL)
!= 1) {
while (rte_eal_get_lcore_state(p_lcore) != FINISHED ||
rte_eal_get_lcore_state(w_lcore) != FINISHED) {
- rte_event_schedule(evdev);
+ rte_service_run_iter_on_app_lcore(t->service_id);
uint64_t new_cycles = rte_get_timer_cycles();
cycles = new_cycles;
}
}
- rte_event_schedule(evdev); /* ensure all completions are flushed */
+ rte_service_run_iter_on_app_lcore(t->service_id);
+ /* ensure all completions are flushed */
rte_eal_mp_wait_lcore();
}
}
+ if (rte_event_dev_service_id_get(evdev, &t->service_id) < 0) {
+ printf("Failed to get service ID for software event dev\n");
+ return -1;
+ }
+
+ rte_service_runstate_set(t->service_id, 1);
+ rte_service_set_runstate_mapped_check(t->service_id, 0);
+
/* Only create mbuf pool once, reuse for each test run */
if (!eventdev_func_mempool) {
eventdev_func_mempool = rte_pktmbuf_pool_create(