xref: /f-stack/dpdk/drivers/event/sw/sw_evdev.h (revision 2bfe3f2e)
1*2bfe3f2eSlogwang /*-
2*2bfe3f2eSlogwang  *   BSD LICENSE
3*2bfe3f2eSlogwang  *
4*2bfe3f2eSlogwang  *   Copyright(c) 2016-2017 Intel Corporation. All rights reserved.
5*2bfe3f2eSlogwang  *
6*2bfe3f2eSlogwang  *   Redistribution and use in source and binary forms, with or without
7*2bfe3f2eSlogwang  *   modification, are permitted provided that the following conditions
8*2bfe3f2eSlogwang  *   are met:
9*2bfe3f2eSlogwang  *
10*2bfe3f2eSlogwang  *     * Redistributions of source code must retain the above copyright
11*2bfe3f2eSlogwang  *       notice, this list of conditions and the following disclaimer.
12*2bfe3f2eSlogwang  *     * Redistributions in binary form must reproduce the above copyright
13*2bfe3f2eSlogwang  *       notice, this list of conditions and the following disclaimer in
14*2bfe3f2eSlogwang  *       the documentation and/or other materials provided with the
15*2bfe3f2eSlogwang  *       distribution.
16*2bfe3f2eSlogwang  *     * Neither the name of Intel Corporation nor the names of its
17*2bfe3f2eSlogwang  *       contributors may be used to endorse or promote products derived
18*2bfe3f2eSlogwang  *       from this software without specific prior written permission.
19*2bfe3f2eSlogwang  *
20*2bfe3f2eSlogwang  *   THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
21*2bfe3f2eSlogwang  *   "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
22*2bfe3f2eSlogwang  *   LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
23*2bfe3f2eSlogwang  *   A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
24*2bfe3f2eSlogwang  *   OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
25*2bfe3f2eSlogwang  *   SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
26*2bfe3f2eSlogwang  *   LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
27*2bfe3f2eSlogwang  *   DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
28*2bfe3f2eSlogwang  *   THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
29*2bfe3f2eSlogwang  *   (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
30*2bfe3f2eSlogwang  *   OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
31*2bfe3f2eSlogwang  */
32*2bfe3f2eSlogwang 
33*2bfe3f2eSlogwang #ifndef _SW_EVDEV_H_
34*2bfe3f2eSlogwang #define _SW_EVDEV_H_
35*2bfe3f2eSlogwang 
36*2bfe3f2eSlogwang #include <rte_eventdev.h>
37*2bfe3f2eSlogwang #include <rte_eventdev_pmd_vdev.h>
38*2bfe3f2eSlogwang #include <rte_atomic.h>
39*2bfe3f2eSlogwang 
40*2bfe3f2eSlogwang #define SW_DEFAULT_CREDIT_QUANTA 32
41*2bfe3f2eSlogwang #define SW_DEFAULT_SCHED_QUANTA 128
42*2bfe3f2eSlogwang #define SW_QID_NUM_FIDS 16384
43*2bfe3f2eSlogwang #define SW_IQS_MAX 4
44*2bfe3f2eSlogwang #define SW_Q_PRIORITY_MAX 255
45*2bfe3f2eSlogwang #define SW_PORTS_MAX 64
46*2bfe3f2eSlogwang #define MAX_SW_CONS_Q_DEPTH 128
47*2bfe3f2eSlogwang #define SW_INFLIGHT_EVENTS_TOTAL 4096
48*2bfe3f2eSlogwang /* allow for lots of over-provisioning */
49*2bfe3f2eSlogwang #define MAX_SW_PROD_Q_DEPTH 4096
50*2bfe3f2eSlogwang #define SW_FRAGMENTS_MAX 16
51*2bfe3f2eSlogwang 
52*2bfe3f2eSlogwang /* report dequeue burst sizes in buckets */
53*2bfe3f2eSlogwang #define SW_DEQ_STAT_BUCKET_SHIFT 2
54*2bfe3f2eSlogwang /* how many packets pulled from port by sched */
55*2bfe3f2eSlogwang #define SCHED_DEQUEUE_BURST_SIZE 32
56*2bfe3f2eSlogwang 
57*2bfe3f2eSlogwang #define SW_PORT_HIST_LIST (MAX_SW_PROD_Q_DEPTH) /* size of our history list */
58*2bfe3f2eSlogwang #define NUM_SAMPLES 64 /* how many data points use for average stats */
59*2bfe3f2eSlogwang 
60*2bfe3f2eSlogwang #define EVENTDEV_NAME_SW_PMD event_sw
61*2bfe3f2eSlogwang #define SW_PMD_NAME RTE_STR(event_sw)
62*2bfe3f2eSlogwang #define SW_PMD_NAME_MAX 64
63*2bfe3f2eSlogwang 
64*2bfe3f2eSlogwang #define SW_SCHED_TYPE_DIRECT (RTE_SCHED_TYPE_PARALLEL + 1)
65*2bfe3f2eSlogwang 
66*2bfe3f2eSlogwang #define SW_NUM_POLL_BUCKETS (MAX_SW_CONS_Q_DEPTH >> SW_DEQ_STAT_BUCKET_SHIFT)
67*2bfe3f2eSlogwang 
68*2bfe3f2eSlogwang enum {
69*2bfe3f2eSlogwang 	QE_FLAG_VALID_SHIFT = 0,
70*2bfe3f2eSlogwang 	QE_FLAG_COMPLETE_SHIFT,
71*2bfe3f2eSlogwang 	QE_FLAG_NOT_EOP_SHIFT,
72*2bfe3f2eSlogwang 	_QE_FLAG_COUNT
73*2bfe3f2eSlogwang };
74*2bfe3f2eSlogwang 
75*2bfe3f2eSlogwang #define QE_FLAG_VALID    (1 << QE_FLAG_VALID_SHIFT)    /* for NEW FWD, FRAG */
76*2bfe3f2eSlogwang #define QE_FLAG_COMPLETE (1 << QE_FLAG_COMPLETE_SHIFT) /* set for FWD, DROP  */
77*2bfe3f2eSlogwang #define QE_FLAG_NOT_EOP  (1 << QE_FLAG_NOT_EOP_SHIFT)  /* set for FRAG only  */
78*2bfe3f2eSlogwang 
79*2bfe3f2eSlogwang static const uint8_t sw_qe_flag_map[] = {
80*2bfe3f2eSlogwang 		QE_FLAG_VALID /* NEW Event */,
81*2bfe3f2eSlogwang 		QE_FLAG_VALID | QE_FLAG_COMPLETE /* FWD Event */,
82*2bfe3f2eSlogwang 		QE_FLAG_COMPLETE /* RELEASE Event */,
83*2bfe3f2eSlogwang 
84*2bfe3f2eSlogwang 		/* Values which can be used for future support for partial
85*2bfe3f2eSlogwang 		 * events, i.e. where one event comes back to the scheduler
86*2bfe3f2eSlogwang 		 * as multiple which need to be tracked together
87*2bfe3f2eSlogwang 		 */
88*2bfe3f2eSlogwang 		QE_FLAG_VALID | QE_FLAG_COMPLETE | QE_FLAG_NOT_EOP,
89*2bfe3f2eSlogwang };
90*2bfe3f2eSlogwang 
91*2bfe3f2eSlogwang #ifdef RTE_LIBRTE_PMD_SW_EVENTDEV_DEBUG
92*2bfe3f2eSlogwang #define SW_LOG_INFO(fmt, args...) \
93*2bfe3f2eSlogwang 	RTE_LOG(INFO, EVENTDEV, "[%s] %s() line %u: " fmt "\n", \
94*2bfe3f2eSlogwang 			SW_PMD_NAME, \
95*2bfe3f2eSlogwang 			__func__, __LINE__, ## args)
96*2bfe3f2eSlogwang 
97*2bfe3f2eSlogwang #define SW_LOG_DBG(fmt, args...) \
98*2bfe3f2eSlogwang 	RTE_LOG(DEBUG, EVENTDEV, "[%s] %s() line %u: " fmt "\n", \
99*2bfe3f2eSlogwang 			SW_PMD_NAME, \
100*2bfe3f2eSlogwang 			__func__, __LINE__, ## args)
101*2bfe3f2eSlogwang #else
102*2bfe3f2eSlogwang #define SW_LOG_INFO(fmt, args...)
103*2bfe3f2eSlogwang #define SW_LOG_DBG(fmt, args...)
104*2bfe3f2eSlogwang #endif
105*2bfe3f2eSlogwang 
106*2bfe3f2eSlogwang #define SW_LOG_ERR(fmt, args...) \
107*2bfe3f2eSlogwang 	RTE_LOG(ERR, EVENTDEV, "[%s] %s() line %u: " fmt "\n", \
108*2bfe3f2eSlogwang 			SW_PMD_NAME, \
109*2bfe3f2eSlogwang 			__func__, __LINE__, ## args)
110*2bfe3f2eSlogwang 
111*2bfe3f2eSlogwang /* Records basic event stats at a given point. Used in port and qid structs */
112*2bfe3f2eSlogwang struct sw_point_stats {
113*2bfe3f2eSlogwang 	uint64_t rx_pkts;
114*2bfe3f2eSlogwang 	uint64_t rx_dropped;
115*2bfe3f2eSlogwang 	uint64_t tx_pkts;
116*2bfe3f2eSlogwang };
117*2bfe3f2eSlogwang 
118*2bfe3f2eSlogwang /* structure used to track what port a flow (FID) is pinned to */
119*2bfe3f2eSlogwang struct sw_fid_t {
120*2bfe3f2eSlogwang 	/* which CQ this FID is currently pinned to */
121*2bfe3f2eSlogwang 	int32_t cq;
122*2bfe3f2eSlogwang 	/* number of packets gone to the CQ with this FID */
123*2bfe3f2eSlogwang 	uint32_t pcount;
124*2bfe3f2eSlogwang };
125*2bfe3f2eSlogwang 
126*2bfe3f2eSlogwang struct reorder_buffer_entry {
127*2bfe3f2eSlogwang 	uint16_t num_fragments;		/**< Number of packet fragments */
128*2bfe3f2eSlogwang 	uint16_t fragment_index;	/**< Points to the oldest valid frag */
129*2bfe3f2eSlogwang 	uint8_t ready;			/**< Entry is ready to be reordered */
130*2bfe3f2eSlogwang 	struct rte_event fragments[SW_FRAGMENTS_MAX];
131*2bfe3f2eSlogwang };
132*2bfe3f2eSlogwang 
133*2bfe3f2eSlogwang struct sw_qid {
134*2bfe3f2eSlogwang 	/* set when the QID has been initialized */
135*2bfe3f2eSlogwang 	uint8_t initialized;
136*2bfe3f2eSlogwang 	/* The type of this QID */
137*2bfe3f2eSlogwang 	int8_t type;
138*2bfe3f2eSlogwang 	/* Integer ID representing the queue. This is used in history lists,
139*2bfe3f2eSlogwang 	 * to identify the stage of processing.
140*2bfe3f2eSlogwang 	 */
141*2bfe3f2eSlogwang 	uint32_t id;
142*2bfe3f2eSlogwang 	struct sw_point_stats stats;
143*2bfe3f2eSlogwang 
144*2bfe3f2eSlogwang 	/* Internal priority rings for packets */
145*2bfe3f2eSlogwang 	struct iq_ring *iq[SW_IQS_MAX];
146*2bfe3f2eSlogwang 	uint32_t iq_pkt_mask; /* A mask to indicate packets in an IQ */
147*2bfe3f2eSlogwang 	uint64_t iq_pkt_count[SW_IQS_MAX];
148*2bfe3f2eSlogwang 
149*2bfe3f2eSlogwang 	/* Information on what CQs are polling this IQ */
150*2bfe3f2eSlogwang 	uint32_t cq_num_mapped_cqs;
151*2bfe3f2eSlogwang 	uint32_t cq_next_tx; /* cq to write next (non-atomic) packet */
152*2bfe3f2eSlogwang 	uint32_t cq_map[SW_PORTS_MAX];
153*2bfe3f2eSlogwang 	uint64_t to_port[SW_PORTS_MAX];
154*2bfe3f2eSlogwang 
155*2bfe3f2eSlogwang 	/* Track flow ids for atomic load balancing */
156*2bfe3f2eSlogwang 	struct sw_fid_t fids[SW_QID_NUM_FIDS];
157*2bfe3f2eSlogwang 
158*2bfe3f2eSlogwang 	/* Track packet order for reordering when needed */
159*2bfe3f2eSlogwang 	struct reorder_buffer_entry *reorder_buffer; /*< pkts await reorder */
160*2bfe3f2eSlogwang 	struct rte_ring *reorder_buffer_freelist; /* available reorder slots */
161*2bfe3f2eSlogwang 	uint32_t reorder_buffer_index; /* oldest valid reorder buffer entry */
162*2bfe3f2eSlogwang 	uint32_t window_size;          /* Used to wrap reorder_buffer_index */
163*2bfe3f2eSlogwang 
164*2bfe3f2eSlogwang 	uint8_t priority;
165*2bfe3f2eSlogwang };
166*2bfe3f2eSlogwang 
167*2bfe3f2eSlogwang struct sw_hist_list_entry {
168*2bfe3f2eSlogwang 	int32_t qid;
169*2bfe3f2eSlogwang 	int32_t fid;
170*2bfe3f2eSlogwang 	struct reorder_buffer_entry *rob_entry;
171*2bfe3f2eSlogwang };
172*2bfe3f2eSlogwang 
173*2bfe3f2eSlogwang struct sw_evdev;
174*2bfe3f2eSlogwang 
175*2bfe3f2eSlogwang struct sw_port {
176*2bfe3f2eSlogwang 	/* new enqueue / dequeue API doesn't have an instance pointer, only the
177*2bfe3f2eSlogwang 	 * pointer to the port being enqueue/dequeued from
178*2bfe3f2eSlogwang 	 */
179*2bfe3f2eSlogwang 	struct sw_evdev *sw;
180*2bfe3f2eSlogwang 
181*2bfe3f2eSlogwang 	/* set when the port is initialized */
182*2bfe3f2eSlogwang 	uint8_t initialized;
183*2bfe3f2eSlogwang 	/* A numeric ID for the port */
184*2bfe3f2eSlogwang 	uint8_t id;
185*2bfe3f2eSlogwang 
186*2bfe3f2eSlogwang 	int16_t is_directed; /** Takes from a single directed QID */
187*2bfe3f2eSlogwang 	/**
188*2bfe3f2eSlogwang 	 * For loadbalanced we can optimise pulling packets from
189*2bfe3f2eSlogwang 	 * producers if there is no reordering involved
190*2bfe3f2eSlogwang 	 */
191*2bfe3f2eSlogwang 	int16_t num_ordered_qids;
192*2bfe3f2eSlogwang 
193*2bfe3f2eSlogwang 	/** Ring and buffer for pulling events from workers for scheduling */
194*2bfe3f2eSlogwang 	struct rte_event_ring *rx_worker_ring __rte_cache_aligned;
195*2bfe3f2eSlogwang 	/** Ring and buffer for pushing packets to workers after scheduling */
196*2bfe3f2eSlogwang 	struct rte_event_ring *cq_worker_ring;
197*2bfe3f2eSlogwang 
198*2bfe3f2eSlogwang 	/* hole */
199*2bfe3f2eSlogwang 
200*2bfe3f2eSlogwang 	/* num releases yet to be completed on this port */
201*2bfe3f2eSlogwang 	uint16_t outstanding_releases __rte_cache_aligned;
202*2bfe3f2eSlogwang 	uint16_t inflight_max; /* app requested max inflights for this port */
203*2bfe3f2eSlogwang 	uint16_t inflight_credits; /* num credits this port has right now */
204*2bfe3f2eSlogwang 
205*2bfe3f2eSlogwang 	uint16_t last_dequeue_burst_sz; /* how big the burst was */
206*2bfe3f2eSlogwang 	uint64_t last_dequeue_ticks; /* used to track burst processing time */
207*2bfe3f2eSlogwang 	uint64_t avg_pkt_ticks;      /* tracks average over NUM_SAMPLES burst */
208*2bfe3f2eSlogwang 	uint64_t total_polls;        /* how many polls were counted in stats */
209*2bfe3f2eSlogwang 	uint64_t zero_polls;         /* tracks polls returning nothing */
210*2bfe3f2eSlogwang 	uint32_t poll_buckets[SW_NUM_POLL_BUCKETS];
211*2bfe3f2eSlogwang 		/* bucket values in 4s for shorter reporting */
212*2bfe3f2eSlogwang 
213*2bfe3f2eSlogwang 	/* History list structs, containing info on pkts egressed to worker */
214*2bfe3f2eSlogwang 	uint16_t hist_head __rte_cache_aligned;
215*2bfe3f2eSlogwang 	uint16_t hist_tail;
216*2bfe3f2eSlogwang 	uint16_t inflights;
217*2bfe3f2eSlogwang 	struct sw_hist_list_entry hist_list[SW_PORT_HIST_LIST];
218*2bfe3f2eSlogwang 
219*2bfe3f2eSlogwang 	/* track packets in and out of this port */
220*2bfe3f2eSlogwang 	struct sw_point_stats stats;
221*2bfe3f2eSlogwang 
222*2bfe3f2eSlogwang 
223*2bfe3f2eSlogwang 	uint32_t pp_buf_start;
224*2bfe3f2eSlogwang 	uint32_t pp_buf_count;
225*2bfe3f2eSlogwang 	uint16_t cq_buf_count;
226*2bfe3f2eSlogwang 	struct rte_event pp_buf[SCHED_DEQUEUE_BURST_SIZE];
227*2bfe3f2eSlogwang 	struct rte_event cq_buf[MAX_SW_CONS_Q_DEPTH];
228*2bfe3f2eSlogwang 
229*2bfe3f2eSlogwang 	uint8_t num_qids_mapped;
230*2bfe3f2eSlogwang };
231*2bfe3f2eSlogwang 
232*2bfe3f2eSlogwang struct sw_evdev {
233*2bfe3f2eSlogwang 	struct rte_eventdev_data *data;
234*2bfe3f2eSlogwang 
235*2bfe3f2eSlogwang 	uint32_t port_count;
236*2bfe3f2eSlogwang 	uint32_t qid_count;
237*2bfe3f2eSlogwang 	uint32_t xstats_count;
238*2bfe3f2eSlogwang 	struct sw_xstats_entry *xstats;
239*2bfe3f2eSlogwang 	uint32_t xstats_count_mode_dev;
240*2bfe3f2eSlogwang 	uint32_t xstats_count_mode_port;
241*2bfe3f2eSlogwang 	uint32_t xstats_count_mode_queue;
242*2bfe3f2eSlogwang 
243*2bfe3f2eSlogwang 	/* Contains all ports - load balanced and directed */
244*2bfe3f2eSlogwang 	struct sw_port ports[SW_PORTS_MAX] __rte_cache_aligned;
245*2bfe3f2eSlogwang 
246*2bfe3f2eSlogwang 	rte_atomic32_t inflights __rte_cache_aligned;
247*2bfe3f2eSlogwang 
248*2bfe3f2eSlogwang 	/*
249*2bfe3f2eSlogwang 	 * max events in this instance. Cached here for performance.
250*2bfe3f2eSlogwang 	 * (also available in data->conf.nb_events_limit)
251*2bfe3f2eSlogwang 	 */
252*2bfe3f2eSlogwang 	uint32_t nb_events_limit;
253*2bfe3f2eSlogwang 
254*2bfe3f2eSlogwang 	/* Internal queues - one per logical queue */
255*2bfe3f2eSlogwang 	struct sw_qid qids[RTE_EVENT_MAX_QUEUES_PER_DEV] __rte_cache_aligned;
256*2bfe3f2eSlogwang 
257*2bfe3f2eSlogwang 	/* Cache how many packets are in each cq */
258*2bfe3f2eSlogwang 	uint16_t cq_ring_space[SW_PORTS_MAX] __rte_cache_aligned;
259*2bfe3f2eSlogwang 
260*2bfe3f2eSlogwang 	/* Array of pointers to load-balanced QIDs sorted by priority level */
261*2bfe3f2eSlogwang 	struct sw_qid *qids_prioritized[RTE_EVENT_MAX_QUEUES_PER_DEV];
262*2bfe3f2eSlogwang 
263*2bfe3f2eSlogwang 	/* Stats */
264*2bfe3f2eSlogwang 	struct sw_point_stats stats __rte_cache_aligned;
265*2bfe3f2eSlogwang 	uint64_t sched_called;
266*2bfe3f2eSlogwang 	int32_t sched_quanta;
267*2bfe3f2eSlogwang 	uint64_t sched_no_iq_enqueues;
268*2bfe3f2eSlogwang 	uint64_t sched_no_cq_enqueues;
269*2bfe3f2eSlogwang 	uint64_t sched_cq_qid_called;
270*2bfe3f2eSlogwang 
271*2bfe3f2eSlogwang 	uint8_t started;
272*2bfe3f2eSlogwang 	uint32_t credit_update_quanta;
273*2bfe3f2eSlogwang 
274*2bfe3f2eSlogwang 	/* store num stats and offset of the stats for each port */
275*2bfe3f2eSlogwang 	uint16_t xstats_count_per_port[SW_PORTS_MAX];
276*2bfe3f2eSlogwang 	uint16_t xstats_offset_for_port[SW_PORTS_MAX];
277*2bfe3f2eSlogwang 	/* store num stats and offset of the stats for each queue */
278*2bfe3f2eSlogwang 	uint16_t xstats_count_per_qid[RTE_EVENT_MAX_QUEUES_PER_DEV];
279*2bfe3f2eSlogwang 	uint16_t xstats_offset_for_qid[RTE_EVENT_MAX_QUEUES_PER_DEV];
280*2bfe3f2eSlogwang 
281*2bfe3f2eSlogwang 	uint32_t service_id;
282*2bfe3f2eSlogwang 	char service_name[SW_PMD_NAME_MAX];
283*2bfe3f2eSlogwang };
284*2bfe3f2eSlogwang 
285*2bfe3f2eSlogwang static inline struct sw_evdev *
286*2bfe3f2eSlogwang sw_pmd_priv(const struct rte_eventdev *eventdev)
287*2bfe3f2eSlogwang {
288*2bfe3f2eSlogwang 	return eventdev->data->dev_private;
289*2bfe3f2eSlogwang }
290*2bfe3f2eSlogwang 
291*2bfe3f2eSlogwang static inline const struct sw_evdev *
292*2bfe3f2eSlogwang sw_pmd_priv_const(const struct rte_eventdev *eventdev)
293*2bfe3f2eSlogwang {
294*2bfe3f2eSlogwang 	return eventdev->data->dev_private;
295*2bfe3f2eSlogwang }
296*2bfe3f2eSlogwang 
297*2bfe3f2eSlogwang uint16_t sw_event_enqueue(void *port, const struct rte_event *ev);
298*2bfe3f2eSlogwang uint16_t sw_event_enqueue_burst(void *port, const struct rte_event ev[],
299*2bfe3f2eSlogwang 		uint16_t num);
300*2bfe3f2eSlogwang 
301*2bfe3f2eSlogwang uint16_t sw_event_dequeue(void *port, struct rte_event *ev, uint64_t wait);
302*2bfe3f2eSlogwang uint16_t sw_event_dequeue_burst(void *port, struct rte_event *ev, uint16_t num,
303*2bfe3f2eSlogwang 			uint64_t wait);
304*2bfe3f2eSlogwang void sw_event_schedule(struct rte_eventdev *dev);
305*2bfe3f2eSlogwang int sw_xstats_init(struct sw_evdev *dev);
306*2bfe3f2eSlogwang int sw_xstats_uninit(struct sw_evdev *dev);
307*2bfe3f2eSlogwang int sw_xstats_get_names(const struct rte_eventdev *dev,
308*2bfe3f2eSlogwang 	enum rte_event_dev_xstats_mode mode, uint8_t queue_port_id,
309*2bfe3f2eSlogwang 	struct rte_event_dev_xstats_name *xstats_names,
310*2bfe3f2eSlogwang 	unsigned int *ids, unsigned int size);
311*2bfe3f2eSlogwang int sw_xstats_get(const struct rte_eventdev *dev,
312*2bfe3f2eSlogwang 		enum rte_event_dev_xstats_mode mode, uint8_t queue_port_id,
313*2bfe3f2eSlogwang 		const unsigned int ids[], uint64_t values[], unsigned int n);
314*2bfe3f2eSlogwang uint64_t sw_xstats_get_by_name(const struct rte_eventdev *dev,
315*2bfe3f2eSlogwang 		const char *name, unsigned int *id);
316*2bfe3f2eSlogwang int sw_xstats_reset(struct rte_eventdev *dev,
317*2bfe3f2eSlogwang 		enum rte_event_dev_xstats_mode mode,
318*2bfe3f2eSlogwang 		int16_t queue_port_id,
319*2bfe3f2eSlogwang 		const uint32_t ids[],
320*2bfe3f2eSlogwang 		uint32_t nb_ids);
321*2bfe3f2eSlogwang 
322*2bfe3f2eSlogwang 
323*2bfe3f2eSlogwang #endif /* _SW_EVDEV_H_ */
324