1dbc01f1663e230a0ef86c764a92e060eac4b224
[dpdk.git] / examples / eventdev_pipeline_sw_pmd / pipeline_common.h
1 /*
2  * SPDX-License-Identifier: BSD-3-Clause
3  * Copyright 2016 Intel Corporation.
4  * Copyright 2017 Cavium, Inc.
5  */
6
7 #include <stdbool.h>
8
9 #include <rte_eal.h>
10 #include <rte_mempool.h>
11 #include <rte_mbuf.h>
12 #include <rte_launch.h>
13 #include <rte_malloc.h>
14 #include <rte_random.h>
15 #include <rte_cycles.h>
16 #include <rte_ethdev.h>
17 #include <rte_eventdev.h>
18 #include <rte_event_eth_rx_adapter.h>
19 #include <rte_service.h>
20 #include <rte_service_component.h>
21
22 #define MAX_NUM_STAGES 8
23 #define BATCH_SIZE 16
24 #define MAX_NUM_CORE 64
25
26 struct cons_data {
27         uint8_t dev_id;
28         uint8_t port_id;
29         uint8_t release;
30 } __rte_cache_aligned;
31
32 struct worker_data {
33         uint8_t dev_id;
34         uint8_t port_id;
35 } __rte_cache_aligned;
36
37 struct fastpath_data {
38         volatile int done;
39         uint32_t tx_lock;
40         uint32_t evdev_service_id;
41         uint32_t rxadptr_service_id;
42         bool rx_single;
43         bool tx_single;
44         bool sched_single;
45         unsigned int rx_core[MAX_NUM_CORE];
46         unsigned int tx_core[MAX_NUM_CORE];
47         unsigned int sched_core[MAX_NUM_CORE];
48         unsigned int worker_core[MAX_NUM_CORE];
49         struct rte_eth_dev_tx_buffer *tx_buf[RTE_MAX_ETHPORTS];
50 } __rte_cache_aligned;
51
52 struct config_data {
53         unsigned int active_cores;
54         unsigned int num_workers;
55         int64_t num_packets;
56         unsigned int num_fids;
57         int queue_type;
58         int worker_cycles;
59         int enable_queue_priorities;
60         int quiet;
61         int dump_dev;
62         int dump_dev_signal;
63         unsigned int num_stages;
64         unsigned int worker_cq_depth;
65         int16_t next_qid[MAX_NUM_STAGES+2];
66         int16_t qid[MAX_NUM_STAGES];
67         uint8_t rx_adapter_id;
68 };
69
70 struct cons_data cons_data;
71
72 struct fastpath_data *fdata;
73 struct config_data cdata;