2 * SPDX-License-Identifier: BSD-3-Clause
3 * Copyright 2017 Cavium, Inc.
6 #ifndef _TEST_PIPELINE_COMMON_
7 #define _TEST_PIPELINE_COMMON_
13 #include <rte_cycles.h>
14 #include <rte_ethdev.h>
15 #include <rte_eventdev.h>
16 #include <rte_event_eth_rx_adapter.h>
17 #include <rte_lcore.h>
18 #include <rte_malloc.h>
19 #include <rte_mempool.h>
20 #include <rte_prefetch.h>
21 #include <rte_spinlock.h>
22 #include <rte_service.h>
23 #include <rte_service_component.h>
25 #include "evt_common.h"
26 #include "evt_options.h"
32 uint64_t processed_pkts;
35 struct test_pipeline *t;
36 } __rte_cache_aligned;
38 struct tx_service_data {
43 uint64_t processed_pkts;
45 struct rte_eth_dev_tx_buffer *tx_buf[RTE_MAX_ETHPORTS];
46 struct test_pipeline *t;
47 } __rte_cache_aligned;
49 struct test_pipeline {
50 /* Don't change the offset of "done". Signal handler use this memory
51 * to terminate all lcores work.
56 enum evt_test_result result;
58 uint64_t outstand_pkts;
59 struct rte_mempool *pool;
60 struct worker_data worker[EVT_MAX_PORTS];
61 struct tx_service_data tx_service;
62 struct evt_options *opt;
63 uint8_t sched_type_list[EVT_MAX_STAGES] __rte_cache_aligned;
64 } __rte_cache_aligned;
69 pipeline_nb_event_ports(struct evt_options *opt)
71 return evt_nr_active_lcores(opt->wlcores);
74 int pipeline_test_result(struct evt_test *test, struct evt_options *opt);
75 int pipeline_opt_check(struct evt_options *opt, uint64_t nb_queues);
76 int pipeline_test_setup(struct evt_test *test, struct evt_options *opt);
77 int pipeline_ethdev_setup(struct evt_test *test, struct evt_options *opt);
78 int pipeline_event_rx_adapter_setup(struct evt_options *opt, uint8_t stride,
79 struct rte_event_port_conf prod_conf);
80 int pipeline_event_tx_service_setup(struct evt_test *test,
81 struct evt_options *opt, uint8_t tx_queue_id,
82 uint8_t tx_port_id, const struct rte_event_port_conf p_conf);
83 int pipeline_mempool_setup(struct evt_test *test, struct evt_options *opt);
84 int pipeline_event_port_setup(struct evt_test *test, struct evt_options *opt,
85 uint8_t *queue_arr, uint8_t nb_queues,
86 const struct rte_event_port_conf p_conf);
87 int pipeline_launch_lcores(struct evt_test *test, struct evt_options *opt,
88 int (*worker)(void *));
89 void pipeline_opt_dump(struct evt_options *opt, uint8_t nb_queues);
90 void pipeline_test_destroy(struct evt_test *test, struct evt_options *opt);
91 void pipeline_eventdev_destroy(struct evt_test *test, struct evt_options *opt);
92 void pipeline_ethdev_destroy(struct evt_test *test, struct evt_options *opt);
93 void pipeline_mempool_destroy(struct evt_test *test, struct evt_options *opt);
95 #endif /* _TEST_PIPELINE_COMMON_ */