xref: /dpdk/lib/ethdev/rte_tm_driver.h (revision 99a2dd95)
1*99a2dd95SBruce Richardson /* SPDX-License-Identifier: BSD-3-Clause
2*99a2dd95SBruce Richardson  * Copyright(c) 2017 Intel Corporation
3*99a2dd95SBruce Richardson  */
4*99a2dd95SBruce Richardson 
5*99a2dd95SBruce Richardson #ifndef __INCLUDE_RTE_TM_DRIVER_H__
6*99a2dd95SBruce Richardson #define __INCLUDE_RTE_TM_DRIVER_H__
7*99a2dd95SBruce Richardson 
8*99a2dd95SBruce Richardson /**
9*99a2dd95SBruce Richardson  * @file
10*99a2dd95SBruce Richardson  * RTE Generic Traffic Manager API (Driver Side)
11*99a2dd95SBruce Richardson  *
12*99a2dd95SBruce Richardson  * This file provides implementation helpers for internal use by PMDs, they
13*99a2dd95SBruce Richardson  * are not intended to be exposed to applications and are not subject to ABI
14*99a2dd95SBruce Richardson  * versioning.
15*99a2dd95SBruce Richardson  */
16*99a2dd95SBruce Richardson 
17*99a2dd95SBruce Richardson #include <stdint.h>
18*99a2dd95SBruce Richardson 
19*99a2dd95SBruce Richardson #include <rte_errno.h>
20*99a2dd95SBruce Richardson #include "rte_ethdev.h"
21*99a2dd95SBruce Richardson #include "ethdev_driver.h"
22*99a2dd95SBruce Richardson #include "rte_tm.h"
23*99a2dd95SBruce Richardson 
24*99a2dd95SBruce Richardson #ifdef __cplusplus
25*99a2dd95SBruce Richardson extern "C" {
26*99a2dd95SBruce Richardson #endif
27*99a2dd95SBruce Richardson 
28*99a2dd95SBruce Richardson /** @internal Traffic manager node ID validate and type get */
29*99a2dd95SBruce Richardson typedef int (*rte_tm_node_type_get_t)(struct rte_eth_dev *dev,
30*99a2dd95SBruce Richardson 	uint32_t node_id,
31*99a2dd95SBruce Richardson 	int *is_leaf,
32*99a2dd95SBruce Richardson 	struct rte_tm_error *error);
33*99a2dd95SBruce Richardson 
34*99a2dd95SBruce Richardson /** @internal Traffic manager capabilities get */
35*99a2dd95SBruce Richardson typedef int (*rte_tm_capabilities_get_t)(struct rte_eth_dev *dev,
36*99a2dd95SBruce Richardson 	struct rte_tm_capabilities *cap,
37*99a2dd95SBruce Richardson 	struct rte_tm_error *error);
38*99a2dd95SBruce Richardson 
39*99a2dd95SBruce Richardson /** @internal Traffic manager level capabilities get */
40*99a2dd95SBruce Richardson typedef int (*rte_tm_level_capabilities_get_t)(struct rte_eth_dev *dev,
41*99a2dd95SBruce Richardson 	uint32_t level_id,
42*99a2dd95SBruce Richardson 	struct rte_tm_level_capabilities *cap,
43*99a2dd95SBruce Richardson 	struct rte_tm_error *error);
44*99a2dd95SBruce Richardson 
45*99a2dd95SBruce Richardson /** @internal Traffic manager node capabilities get */
46*99a2dd95SBruce Richardson typedef int (*rte_tm_node_capabilities_get_t)(struct rte_eth_dev *dev,
47*99a2dd95SBruce Richardson 	uint32_t node_id,
48*99a2dd95SBruce Richardson 	struct rte_tm_node_capabilities *cap,
49*99a2dd95SBruce Richardson 	struct rte_tm_error *error);
50*99a2dd95SBruce Richardson 
51*99a2dd95SBruce Richardson /** @internal Traffic manager WRED profile add */
52*99a2dd95SBruce Richardson typedef int (*rte_tm_wred_profile_add_t)(struct rte_eth_dev *dev,
53*99a2dd95SBruce Richardson 	uint32_t wred_profile_id,
54*99a2dd95SBruce Richardson 	struct rte_tm_wred_params *profile,
55*99a2dd95SBruce Richardson 	struct rte_tm_error *error);
56*99a2dd95SBruce Richardson 
57*99a2dd95SBruce Richardson /** @internal Traffic manager WRED profile delete */
58*99a2dd95SBruce Richardson typedef int (*rte_tm_wred_profile_delete_t)(struct rte_eth_dev *dev,
59*99a2dd95SBruce Richardson 	uint32_t wred_profile_id,
60*99a2dd95SBruce Richardson 	struct rte_tm_error *error);
61*99a2dd95SBruce Richardson 
62*99a2dd95SBruce Richardson /** @internal Traffic manager shared WRED context add */
63*99a2dd95SBruce Richardson typedef int (*rte_tm_shared_wred_context_add_update_t)(
64*99a2dd95SBruce Richardson 	struct rte_eth_dev *dev,
65*99a2dd95SBruce Richardson 	uint32_t shared_wred_context_id,
66*99a2dd95SBruce Richardson 	uint32_t wred_profile_id,
67*99a2dd95SBruce Richardson 	struct rte_tm_error *error);
68*99a2dd95SBruce Richardson 
69*99a2dd95SBruce Richardson /** @internal Traffic manager shared WRED context delete */
70*99a2dd95SBruce Richardson typedef int (*rte_tm_shared_wred_context_delete_t)(
71*99a2dd95SBruce Richardson 	struct rte_eth_dev *dev,
72*99a2dd95SBruce Richardson 	uint32_t shared_wred_context_id,
73*99a2dd95SBruce Richardson 	struct rte_tm_error *error);
74*99a2dd95SBruce Richardson 
75*99a2dd95SBruce Richardson /** @internal Traffic manager shaper profile add */
76*99a2dd95SBruce Richardson typedef int (*rte_tm_shaper_profile_add_t)(struct rte_eth_dev *dev,
77*99a2dd95SBruce Richardson 	uint32_t shaper_profile_id,
78*99a2dd95SBruce Richardson 	struct rte_tm_shaper_params *profile,
79*99a2dd95SBruce Richardson 	struct rte_tm_error *error);
80*99a2dd95SBruce Richardson 
81*99a2dd95SBruce Richardson /** @internal Traffic manager shaper profile delete */
82*99a2dd95SBruce Richardson typedef int (*rte_tm_shaper_profile_delete_t)(struct rte_eth_dev *dev,
83*99a2dd95SBruce Richardson 	uint32_t shaper_profile_id,
84*99a2dd95SBruce Richardson 	struct rte_tm_error *error);
85*99a2dd95SBruce Richardson 
86*99a2dd95SBruce Richardson /** @internal Traffic manager shared shaper add/update */
87*99a2dd95SBruce Richardson typedef int (*rte_tm_shared_shaper_add_update_t)(struct rte_eth_dev *dev,
88*99a2dd95SBruce Richardson 	uint32_t shared_shaper_id,
89*99a2dd95SBruce Richardson 	uint32_t shaper_profile_id,
90*99a2dd95SBruce Richardson 	struct rte_tm_error *error);
91*99a2dd95SBruce Richardson 
92*99a2dd95SBruce Richardson /** @internal Traffic manager shared shaper delete */
93*99a2dd95SBruce Richardson typedef int (*rte_tm_shared_shaper_delete_t)(struct rte_eth_dev *dev,
94*99a2dd95SBruce Richardson 	uint32_t shared_shaper_id,
95*99a2dd95SBruce Richardson 	struct rte_tm_error *error);
96*99a2dd95SBruce Richardson 
97*99a2dd95SBruce Richardson /** @internal Traffic manager node add */
98*99a2dd95SBruce Richardson typedef int (*rte_tm_node_add_t)(struct rte_eth_dev *dev,
99*99a2dd95SBruce Richardson 	uint32_t node_id,
100*99a2dd95SBruce Richardson 	uint32_t parent_node_id,
101*99a2dd95SBruce Richardson 	uint32_t priority,
102*99a2dd95SBruce Richardson 	uint32_t weight,
103*99a2dd95SBruce Richardson 	uint32_t level_id,
104*99a2dd95SBruce Richardson 	struct rte_tm_node_params *params,
105*99a2dd95SBruce Richardson 	struct rte_tm_error *error);
106*99a2dd95SBruce Richardson 
107*99a2dd95SBruce Richardson /** @internal Traffic manager node delete */
108*99a2dd95SBruce Richardson typedef int (*rte_tm_node_delete_t)(struct rte_eth_dev *dev,
109*99a2dd95SBruce Richardson 	uint32_t node_id,
110*99a2dd95SBruce Richardson 	struct rte_tm_error *error);
111*99a2dd95SBruce Richardson 
112*99a2dd95SBruce Richardson /** @internal Traffic manager node suspend */
113*99a2dd95SBruce Richardson typedef int (*rte_tm_node_suspend_t)(struct rte_eth_dev *dev,
114*99a2dd95SBruce Richardson 	uint32_t node_id,
115*99a2dd95SBruce Richardson 	struct rte_tm_error *error);
116*99a2dd95SBruce Richardson 
117*99a2dd95SBruce Richardson /** @internal Traffic manager node resume */
118*99a2dd95SBruce Richardson typedef int (*rte_tm_node_resume_t)(struct rte_eth_dev *dev,
119*99a2dd95SBruce Richardson 	uint32_t node_id,
120*99a2dd95SBruce Richardson 	struct rte_tm_error *error);
121*99a2dd95SBruce Richardson 
122*99a2dd95SBruce Richardson /** @internal Traffic manager hierarchy commit */
123*99a2dd95SBruce Richardson typedef int (*rte_tm_hierarchy_commit_t)(struct rte_eth_dev *dev,
124*99a2dd95SBruce Richardson 	int clear_on_fail,
125*99a2dd95SBruce Richardson 	struct rte_tm_error *error);
126*99a2dd95SBruce Richardson 
127*99a2dd95SBruce Richardson /** @internal Traffic manager node parent update */
128*99a2dd95SBruce Richardson typedef int (*rte_tm_node_parent_update_t)(struct rte_eth_dev *dev,
129*99a2dd95SBruce Richardson 	uint32_t node_id,
130*99a2dd95SBruce Richardson 	uint32_t parent_node_id,
131*99a2dd95SBruce Richardson 	uint32_t priority,
132*99a2dd95SBruce Richardson 	uint32_t weight,
133*99a2dd95SBruce Richardson 	struct rte_tm_error *error);
134*99a2dd95SBruce Richardson 
135*99a2dd95SBruce Richardson /** @internal Traffic manager node shaper update */
136*99a2dd95SBruce Richardson typedef int (*rte_tm_node_shaper_update_t)(struct rte_eth_dev *dev,
137*99a2dd95SBruce Richardson 	uint32_t node_id,
138*99a2dd95SBruce Richardson 	uint32_t shaper_profile_id,
139*99a2dd95SBruce Richardson 	struct rte_tm_error *error);
140*99a2dd95SBruce Richardson 
141*99a2dd95SBruce Richardson /** @internal Traffic manager node shaper update */
142*99a2dd95SBruce Richardson typedef int (*rte_tm_node_shared_shaper_update_t)(struct rte_eth_dev *dev,
143*99a2dd95SBruce Richardson 	uint32_t node_id,
144*99a2dd95SBruce Richardson 	uint32_t shared_shaper_id,
145*99a2dd95SBruce Richardson 	int32_t add,
146*99a2dd95SBruce Richardson 	struct rte_tm_error *error);
147*99a2dd95SBruce Richardson 
148*99a2dd95SBruce Richardson /** @internal Traffic manager node stats update */
149*99a2dd95SBruce Richardson typedef int (*rte_tm_node_stats_update_t)(struct rte_eth_dev *dev,
150*99a2dd95SBruce Richardson 	uint32_t node_id,
151*99a2dd95SBruce Richardson 	uint64_t stats_mask,
152*99a2dd95SBruce Richardson 	struct rte_tm_error *error);
153*99a2dd95SBruce Richardson 
154*99a2dd95SBruce Richardson /** @internal Traffic manager node WFQ weight mode update */
155*99a2dd95SBruce Richardson typedef int (*rte_tm_node_wfq_weight_mode_update_t)(
156*99a2dd95SBruce Richardson 	struct rte_eth_dev *dev,
157*99a2dd95SBruce Richardson 	uint32_t node_id,
158*99a2dd95SBruce Richardson 	int *wfq_weight_mode,
159*99a2dd95SBruce Richardson 	uint32_t n_sp_priorities,
160*99a2dd95SBruce Richardson 	struct rte_tm_error *error);
161*99a2dd95SBruce Richardson 
162*99a2dd95SBruce Richardson /** @internal Traffic manager node congestion management mode update */
163*99a2dd95SBruce Richardson typedef int (*rte_tm_node_cman_update_t)(struct rte_eth_dev *dev,
164*99a2dd95SBruce Richardson 	uint32_t node_id,
165*99a2dd95SBruce Richardson 	enum rte_tm_cman_mode cman,
166*99a2dd95SBruce Richardson 	struct rte_tm_error *error);
167*99a2dd95SBruce Richardson 
168*99a2dd95SBruce Richardson /** @internal Traffic manager node WRED context update */
169*99a2dd95SBruce Richardson typedef int (*rte_tm_node_wred_context_update_t)(
170*99a2dd95SBruce Richardson 	struct rte_eth_dev *dev,
171*99a2dd95SBruce Richardson 	uint32_t node_id,
172*99a2dd95SBruce Richardson 	uint32_t wred_profile_id,
173*99a2dd95SBruce Richardson 	struct rte_tm_error *error);
174*99a2dd95SBruce Richardson 
175*99a2dd95SBruce Richardson /** @internal Traffic manager node WRED context update */
176*99a2dd95SBruce Richardson typedef int (*rte_tm_node_shared_wred_context_update_t)(
177*99a2dd95SBruce Richardson 	struct rte_eth_dev *dev,
178*99a2dd95SBruce Richardson 	uint32_t node_id,
179*99a2dd95SBruce Richardson 	uint32_t shared_wred_context_id,
180*99a2dd95SBruce Richardson 	int add,
181*99a2dd95SBruce Richardson 	struct rte_tm_error *error);
182*99a2dd95SBruce Richardson 
183*99a2dd95SBruce Richardson /** @internal Traffic manager read stats counters for specific node */
184*99a2dd95SBruce Richardson typedef int (*rte_tm_node_stats_read_t)(struct rte_eth_dev *dev,
185*99a2dd95SBruce Richardson 	uint32_t node_id,
186*99a2dd95SBruce Richardson 	struct rte_tm_node_stats *stats,
187*99a2dd95SBruce Richardson 	uint64_t *stats_mask,
188*99a2dd95SBruce Richardson 	int clear,
189*99a2dd95SBruce Richardson 	struct rte_tm_error *error);
190*99a2dd95SBruce Richardson 
191*99a2dd95SBruce Richardson /** @internal Traffic manager packet marking - VLAN DEI */
192*99a2dd95SBruce Richardson typedef int (*rte_tm_mark_vlan_dei_t)(struct rte_eth_dev *dev,
193*99a2dd95SBruce Richardson 	int mark_green,
194*99a2dd95SBruce Richardson 	int mark_yellow,
195*99a2dd95SBruce Richardson 	int mark_red,
196*99a2dd95SBruce Richardson 	struct rte_tm_error *error);
197*99a2dd95SBruce Richardson 
198*99a2dd95SBruce Richardson /** @internal Traffic manager packet marking - IPv4/IPv6 ECN */
199*99a2dd95SBruce Richardson typedef int (*rte_tm_mark_ip_ecn_t)(struct rte_eth_dev *dev,
200*99a2dd95SBruce Richardson 	int mark_green,
201*99a2dd95SBruce Richardson 	int mark_yellow,
202*99a2dd95SBruce Richardson 	int mark_red,
203*99a2dd95SBruce Richardson 	struct rte_tm_error *error);
204*99a2dd95SBruce Richardson 
205*99a2dd95SBruce Richardson /** @internal Traffic manager packet marking - IPv4/IPv6 DSCP */
206*99a2dd95SBruce Richardson typedef int (*rte_tm_mark_ip_dscp_t)(struct rte_eth_dev *dev,
207*99a2dd95SBruce Richardson 	int mark_green,
208*99a2dd95SBruce Richardson 	int mark_yellow,
209*99a2dd95SBruce Richardson 	int mark_red,
210*99a2dd95SBruce Richardson 	struct rte_tm_error *error);
211*99a2dd95SBruce Richardson 
212*99a2dd95SBruce Richardson struct rte_tm_ops {
213*99a2dd95SBruce Richardson 	/** Traffic manager node type get */
214*99a2dd95SBruce Richardson 	rte_tm_node_type_get_t node_type_get;
215*99a2dd95SBruce Richardson 
216*99a2dd95SBruce Richardson 	/** Traffic manager capabilities_get */
217*99a2dd95SBruce Richardson 	rte_tm_capabilities_get_t capabilities_get;
218*99a2dd95SBruce Richardson 	/** Traffic manager level capabilities_get */
219*99a2dd95SBruce Richardson 	rte_tm_level_capabilities_get_t level_capabilities_get;
220*99a2dd95SBruce Richardson 	/** Traffic manager node capabilities get */
221*99a2dd95SBruce Richardson 	rte_tm_node_capabilities_get_t node_capabilities_get;
222*99a2dd95SBruce Richardson 
223*99a2dd95SBruce Richardson 	/** Traffic manager WRED profile add */
224*99a2dd95SBruce Richardson 	rte_tm_wred_profile_add_t wred_profile_add;
225*99a2dd95SBruce Richardson 	/** Traffic manager WRED profile delete */
226*99a2dd95SBruce Richardson 	rte_tm_wred_profile_delete_t wred_profile_delete;
227*99a2dd95SBruce Richardson 	/** Traffic manager shared WRED context add/update */
228*99a2dd95SBruce Richardson 	rte_tm_shared_wred_context_add_update_t
229*99a2dd95SBruce Richardson 		shared_wred_context_add_update;
230*99a2dd95SBruce Richardson 	/** Traffic manager shared WRED context delete */
231*99a2dd95SBruce Richardson 	rte_tm_shared_wred_context_delete_t
232*99a2dd95SBruce Richardson 		shared_wred_context_delete;
233*99a2dd95SBruce Richardson 
234*99a2dd95SBruce Richardson 	/** Traffic manager shaper profile add */
235*99a2dd95SBruce Richardson 	rte_tm_shaper_profile_add_t shaper_profile_add;
236*99a2dd95SBruce Richardson 	/** Traffic manager shaper profile delete */
237*99a2dd95SBruce Richardson 	rte_tm_shaper_profile_delete_t shaper_profile_delete;
238*99a2dd95SBruce Richardson 	/** Traffic manager shared shaper add/update */
239*99a2dd95SBruce Richardson 	rte_tm_shared_shaper_add_update_t shared_shaper_add_update;
240*99a2dd95SBruce Richardson 	/** Traffic manager shared shaper delete */
241*99a2dd95SBruce Richardson 	rte_tm_shared_shaper_delete_t shared_shaper_delete;
242*99a2dd95SBruce Richardson 
243*99a2dd95SBruce Richardson 	/** Traffic manager node add */
244*99a2dd95SBruce Richardson 	rte_tm_node_add_t node_add;
245*99a2dd95SBruce Richardson 	/** Traffic manager node delete */
246*99a2dd95SBruce Richardson 	rte_tm_node_delete_t node_delete;
247*99a2dd95SBruce Richardson 	/** Traffic manager node suspend */
248*99a2dd95SBruce Richardson 	rte_tm_node_suspend_t node_suspend;
249*99a2dd95SBruce Richardson 	/** Traffic manager node resume */
250*99a2dd95SBruce Richardson 	rte_tm_node_resume_t node_resume;
251*99a2dd95SBruce Richardson 	/** Traffic manager hierarchy commit */
252*99a2dd95SBruce Richardson 	rte_tm_hierarchy_commit_t hierarchy_commit;
253*99a2dd95SBruce Richardson 
254*99a2dd95SBruce Richardson 	/** Traffic manager node parent update */
255*99a2dd95SBruce Richardson 	rte_tm_node_parent_update_t node_parent_update;
256*99a2dd95SBruce Richardson 	/** Traffic manager node shaper update */
257*99a2dd95SBruce Richardson 	rte_tm_node_shaper_update_t node_shaper_update;
258*99a2dd95SBruce Richardson 	/** Traffic manager node shared shaper update */
259*99a2dd95SBruce Richardson 	rte_tm_node_shared_shaper_update_t node_shared_shaper_update;
260*99a2dd95SBruce Richardson 	/** Traffic manager node stats update */
261*99a2dd95SBruce Richardson 	rte_tm_node_stats_update_t node_stats_update;
262*99a2dd95SBruce Richardson 	/** Traffic manager node WFQ weight mode update */
263*99a2dd95SBruce Richardson 	rte_tm_node_wfq_weight_mode_update_t node_wfq_weight_mode_update;
264*99a2dd95SBruce Richardson 	/** Traffic manager node congestion management mode update */
265*99a2dd95SBruce Richardson 	rte_tm_node_cman_update_t node_cman_update;
266*99a2dd95SBruce Richardson 	/** Traffic manager node WRED context update */
267*99a2dd95SBruce Richardson 	rte_tm_node_wred_context_update_t node_wred_context_update;
268*99a2dd95SBruce Richardson 	/** Traffic manager node shared WRED context update */
269*99a2dd95SBruce Richardson 	rte_tm_node_shared_wred_context_update_t
270*99a2dd95SBruce Richardson 		node_shared_wred_context_update;
271*99a2dd95SBruce Richardson 	/** Traffic manager read statistics counters for current node */
272*99a2dd95SBruce Richardson 	rte_tm_node_stats_read_t node_stats_read;
273*99a2dd95SBruce Richardson 
274*99a2dd95SBruce Richardson 	/** Traffic manager packet marking - VLAN DEI */
275*99a2dd95SBruce Richardson 	rte_tm_mark_vlan_dei_t mark_vlan_dei;
276*99a2dd95SBruce Richardson 	/** Traffic manager packet marking - IPv4/IPv6 ECN */
277*99a2dd95SBruce Richardson 	rte_tm_mark_ip_ecn_t mark_ip_ecn;
278*99a2dd95SBruce Richardson 	/** Traffic manager packet marking - IPv4/IPv6 DSCP */
279*99a2dd95SBruce Richardson 	rte_tm_mark_ip_dscp_t mark_ip_dscp;
280*99a2dd95SBruce Richardson };
281*99a2dd95SBruce Richardson 
282*99a2dd95SBruce Richardson /**
283*99a2dd95SBruce Richardson  * Initialize generic error structure.
284*99a2dd95SBruce Richardson  *
285*99a2dd95SBruce Richardson  * This function also sets rte_errno to a given value.
286*99a2dd95SBruce Richardson  *
287*99a2dd95SBruce Richardson  * @param[out] error
288*99a2dd95SBruce Richardson  *   Pointer to error structure (may be NULL).
289*99a2dd95SBruce Richardson  * @param[in] code
290*99a2dd95SBruce Richardson  *   Related error code (rte_errno).
291*99a2dd95SBruce Richardson  * @param[in] type
292*99a2dd95SBruce Richardson  *   Cause field and error type.
293*99a2dd95SBruce Richardson  * @param[in] cause
294*99a2dd95SBruce Richardson  *   Object responsible for the error.
295*99a2dd95SBruce Richardson  * @param[in] message
296*99a2dd95SBruce Richardson  *   Human-readable error message.
297*99a2dd95SBruce Richardson  *
298*99a2dd95SBruce Richardson  * @return
299*99a2dd95SBruce Richardson  *   Error code.
300*99a2dd95SBruce Richardson  */
301*99a2dd95SBruce Richardson static inline int
rte_tm_error_set(struct rte_tm_error * error,int code,enum rte_tm_error_type type,const void * cause,const char * message)302*99a2dd95SBruce Richardson rte_tm_error_set(struct rte_tm_error *error,
303*99a2dd95SBruce Richardson 		   int code,
304*99a2dd95SBruce Richardson 		   enum rte_tm_error_type type,
305*99a2dd95SBruce Richardson 		   const void *cause,
306*99a2dd95SBruce Richardson 		   const char *message)
307*99a2dd95SBruce Richardson {
308*99a2dd95SBruce Richardson 	if (error) {
309*99a2dd95SBruce Richardson 		*error = (struct rte_tm_error){
310*99a2dd95SBruce Richardson 			.type = type,
311*99a2dd95SBruce Richardson 			.cause = cause,
312*99a2dd95SBruce Richardson 			.message = message,
313*99a2dd95SBruce Richardson 		};
314*99a2dd95SBruce Richardson 	}
315*99a2dd95SBruce Richardson 	rte_errno = code;
316*99a2dd95SBruce Richardson 	return code;
317*99a2dd95SBruce Richardson }
318*99a2dd95SBruce Richardson 
319*99a2dd95SBruce Richardson /**
320*99a2dd95SBruce Richardson  * Get generic traffic manager operations structure from a port
321*99a2dd95SBruce Richardson  *
322*99a2dd95SBruce Richardson  * @param[in] port_id
323*99a2dd95SBruce Richardson  *   The port identifier of the Ethernet device.
324*99a2dd95SBruce Richardson  * @param[out] error
325*99a2dd95SBruce Richardson  *   Error details
326*99a2dd95SBruce Richardson  *
327*99a2dd95SBruce Richardson  * @return
328*99a2dd95SBruce Richardson  *   The traffic manager operations structure associated with port_id on
329*99a2dd95SBruce Richardson  *   success, NULL otherwise.
330*99a2dd95SBruce Richardson  */
331*99a2dd95SBruce Richardson const struct rte_tm_ops *
332*99a2dd95SBruce Richardson rte_tm_ops_get(uint16_t port_id, struct rte_tm_error *error);
333*99a2dd95SBruce Richardson 
334*99a2dd95SBruce Richardson #ifdef __cplusplus
335*99a2dd95SBruce Richardson }
336*99a2dd95SBruce Richardson #endif
337*99a2dd95SBruce Richardson 
338*99a2dd95SBruce Richardson #endif /* __INCLUDE_RTE_TM_DRIVER_H__ */
339