xref: /dpdk/examples/ethtool/lib/rte_ethtool.h (revision 719834a6849e1daf4a70ff7742bbcc3ae7e25607)
13998e2a0SBruce Richardson /* SPDX-License-Identifier: BSD-3-Clause
23998e2a0SBruce Richardson  * Copyright(c) 2010-2015 Intel Corporation
3bda68ab9SRemy Horton  */
4bda68ab9SRemy Horton 
5bda68ab9SRemy Horton #ifndef _RTE_ETHTOOL_H_
6bda68ab9SRemy Horton #define _RTE_ETHTOOL_H_
7bda68ab9SRemy Horton 
8bda68ab9SRemy Horton /*
9bda68ab9SRemy Horton  * This new interface is designed to provide a user-space shim layer for
10bda68ab9SRemy Horton  * Ethtool and Netdevice op API.
11bda68ab9SRemy Horton  *
12ea43e995SRami Rosen  * rte_ethtool_get_driver:          ethtool_ops::get_drvinfo
13bda68ab9SRemy Horton  * rte_ethtool_get_link:            ethtool_ops::get_link
14bda68ab9SRemy Horton  * rte_ethtool_get_regs_len:        ethtool_ops::get_regs_len
15bda68ab9SRemy Horton  * rte_ethtool_get_regs:            ethtool_ops::get_regs
16bda68ab9SRemy Horton  * rte_ethtool_get_eeprom_len:      ethtool_ops::get_eeprom_len
17bda68ab9SRemy Horton  * rte_ethtool_get_eeprom:          ethtool_ops::get_eeprom
18bda68ab9SRemy Horton  * rte_ethtool_set_eeprom:          ethtool_ops::set_eeprom
19bda68ab9SRemy Horton  * rte_ethtool_get_pauseparam:      ethtool_ops::get_pauseparam
20bda68ab9SRemy Horton  * rte_ethtool_set_pauseparam:      ethtool_ops::set_pauseparam
21bda68ab9SRemy Horton  *
22bda68ab9SRemy Horton  * rte_ethtool_net_open:            net_device_ops::ndo_open
23bda68ab9SRemy Horton  * rte_ethtool_net_stop:            net_device_ops::ndo_stop
24bda68ab9SRemy Horton  * rte_ethtool_net_set_mac_addr:    net_device_ops::ndo_set_mac_address
25bda68ab9SRemy Horton  * rte_ethtool_net_validate_addr:   net_device_ops::ndo_validate_addr
26ea43e995SRami Rosen  * rte_ethtool_net_change_mtu:      net_device_ops::ndo_change_mtu
27bda68ab9SRemy Horton  * rte_ethtool_net_get_stats64:     net_device_ops::ndo_get_stats64
28bda68ab9SRemy Horton  * rte_ethtool_net_vlan_rx_add_vid  net_device_ops::ndo_vlan_rx_add_vid
29bda68ab9SRemy Horton  * rte_ethtool_net_vlan_rx_kill_vid net_device_ops::ndo_vlan_rx_kill_vid
30bda68ab9SRemy Horton  * rte_ethtool_net_set_rx_mode      net_device_ops::ndo_set_rx_mode
31bda68ab9SRemy Horton  *
32bda68ab9SRemy Horton  */
33bda68ab9SRemy Horton #include <stdint.h>
34bda68ab9SRemy Horton #include <rte_ethdev.h>
35bda68ab9SRemy Horton #include <linux/ethtool.h>
36bda68ab9SRemy Horton 
37*719834a6SMattias Rönnblom #ifdef __cplusplus
38*719834a6SMattias Rönnblom extern "C" {
39*719834a6SMattias Rönnblom #endif
40*719834a6SMattias Rönnblom 
41bda68ab9SRemy Horton /**
42bda68ab9SRemy Horton  * Retrieve the Ethernet device driver information according to
43bda68ab9SRemy Horton  * attributes described by ethtool data structure, ethtool_drvinfo.
44bda68ab9SRemy Horton  *
45bda68ab9SRemy Horton  * @param port_id
46bda68ab9SRemy Horton  *   The port identifier of the Ethernet device.
47bda68ab9SRemy Horton  * @param drvinfo
48bda68ab9SRemy Horton  *   A pointer to get driver information
49bda68ab9SRemy Horton  * @return
50bda68ab9SRemy Horton  *   - (0) if successful.
51bda68ab9SRemy Horton  *   - (-ENODEV) if *port_id* invalid.
52bda68ab9SRemy Horton  */
5347523597SZhiyong Yang int rte_ethtool_get_drvinfo(uint16_t port_id, struct ethtool_drvinfo *drvinfo);
54bda68ab9SRemy Horton 
55bda68ab9SRemy Horton /**
56bda68ab9SRemy Horton  * Retrieve the Ethernet device register length in bytes.
57bda68ab9SRemy Horton  *
58bda68ab9SRemy Horton  * @param port_id
59bda68ab9SRemy Horton  *   The port identifier of the Ethernet device.
60bda68ab9SRemy Horton  * @return
61bda68ab9SRemy Horton  *   - (> 0) # of device registers (in bytes) available for dump
62bda68ab9SRemy Horton  *   - (0) no registers available for dump.
63bda68ab9SRemy Horton  *   - (-ENOTSUP) if hardware doesn't support.
64bda68ab9SRemy Horton  *   - (-ENODEV) if *port_id* invalid.
65bda68ab9SRemy Horton  *   - others depends on the specific operations implementation.
66bda68ab9SRemy Horton  */
6747523597SZhiyong Yang int rte_ethtool_get_regs_len(uint16_t port_id);
68bda68ab9SRemy Horton 
69bda68ab9SRemy Horton /**
70bda68ab9SRemy Horton  * Retrieve the Ethernet device register information according to
71bda68ab9SRemy Horton  * attributes described by ethtool data structure, ethtool_regs
72bda68ab9SRemy Horton  *
73bda68ab9SRemy Horton  * @param port_id
74bda68ab9SRemy Horton  *   The port identifier of the Ethernet device.
75bda68ab9SRemy Horton  * @param reg
76bda68ab9SRemy Horton  *   A pointer to ethtool_regs that has register information
77bda68ab9SRemy Horton  * @param data
78bda68ab9SRemy Horton  *   A pointer to a buffer that is used to retrieve device register content
79bda68ab9SRemy Horton  * @return
80bda68ab9SRemy Horton  *   - (0) if successful.
81bda68ab9SRemy Horton  *   - (-ENOTSUP) if hardware doesn't support.
82bda68ab9SRemy Horton  *   - (-ENODEV) if *port_id* invalid.
83bda68ab9SRemy Horton  *   - others depends on the specific operations implementation.
84bda68ab9SRemy Horton  */
8547523597SZhiyong Yang int rte_ethtool_get_regs(uint16_t port_id, struct ethtool_regs *regs,
86bda68ab9SRemy Horton 			    void *data);
87bda68ab9SRemy Horton 
88bda68ab9SRemy Horton /**
89bda68ab9SRemy Horton  * Retrieve the Ethernet device link status
90bda68ab9SRemy Horton  *
91bda68ab9SRemy Horton  * @param port_id
92bda68ab9SRemy Horton  *   The port identifier of the Ethernet device.
93bda68ab9SRemy Horton  * @return
94bda68ab9SRemy Horton  *   - (1) if link up.
95bda68ab9SRemy Horton  *   - (0) if link down.
96bda68ab9SRemy Horton  *   - (-ENOTSUP) if hardware doesn't support.
97bda68ab9SRemy Horton  *   - (-ENODEV) if *port_id* invalid.
98bda68ab9SRemy Horton  *   - (-EINVAL) if parameters invalid.
99bda68ab9SRemy Horton  *   - others depends on the specific operations implementation.
100bda68ab9SRemy Horton  */
10147523597SZhiyong Yang int rte_ethtool_get_link(uint16_t port_id);
102bda68ab9SRemy Horton 
103bda68ab9SRemy Horton /**
104bda68ab9SRemy Horton  * Retrieve the Ethernet device EEPROM size
105bda68ab9SRemy Horton  *
106bda68ab9SRemy Horton  * @param port_id
107bda68ab9SRemy Horton  *   The port identifier of the Ethernet device.
108bda68ab9SRemy Horton  * @return
109bda68ab9SRemy Horton  *	 - (> 0) device EEPROM size in bytes
110bda68ab9SRemy Horton  *   - (0) device has NO EEPROM
111bda68ab9SRemy Horton  *   - (-ENOTSUP) if hardware doesn't support.
112bda68ab9SRemy Horton  *   - (-ENODEV) if *port_id* invalid.
113bda68ab9SRemy Horton  *   - others depends on the specific operations implementation.
114bda68ab9SRemy Horton  */
11547523597SZhiyong Yang int rte_ethtool_get_eeprom_len(uint16_t port_id);
116bda68ab9SRemy Horton 
117bda68ab9SRemy Horton /**
118bda68ab9SRemy Horton  * Retrieve EEPROM content based upon eeprom range described in ethtool
119bda68ab9SRemy Horton  * data structure, ethtool_eeprom
120bda68ab9SRemy Horton  *
121bda68ab9SRemy Horton  * @param port_id
122bda68ab9SRemy Horton  *   The port identifier of the Ethernet device.
123bda68ab9SRemy Horton  * @param eeprom
124bda68ab9SRemy Horton  *	 The pointer of ethtool_eeprom that provides eeprom range
125bda68ab9SRemy Horton  * @param words
126bda68ab9SRemy Horton  *	 A buffer that holds data read from eeprom
127bda68ab9SRemy Horton  * @return
128bda68ab9SRemy Horton  *   - (0) if successful.
129bda68ab9SRemy Horton  *   - (-ENOTSUP) if hardware doesn't support.
130bda68ab9SRemy Horton  *   - (-ENODEV) if *port_id* invalid.
131bda68ab9SRemy Horton  *   - others depends on the specific operations implementation.
132bda68ab9SRemy Horton  */
13347523597SZhiyong Yang int rte_ethtool_get_eeprom(uint16_t port_id, struct ethtool_eeprom *eeprom,
134bda68ab9SRemy Horton 			      void *words);
135bda68ab9SRemy Horton 
136bda68ab9SRemy Horton /**
137bda68ab9SRemy Horton  * Setting EEPROM content based upon eeprom range described in ethtool
138bda68ab9SRemy Horton  * data structure, ethtool_eeprom
139bda68ab9SRemy Horton  *
140bda68ab9SRemy Horton  * @param port_id
141bda68ab9SRemy Horton  *   The port identifier of the Ethernet device.
142bda68ab9SRemy Horton  * @param eeprom
143bda68ab9SRemy Horton  *	 The pointer of ethtool_eeprom that provides eeprom range
144bda68ab9SRemy Horton  * @param words
145bda68ab9SRemy Horton  *	 A buffer that holds data to be written into eeprom
146bda68ab9SRemy Horton  * @return
147bda68ab9SRemy Horton  *   - (0) if successful.
148bda68ab9SRemy Horton  *   - (-ENOTSUP) if hardware doesn't support.
149bda68ab9SRemy Horton  *   - (-ENODEV) if *port_id* invalid.
150bda68ab9SRemy Horton  *   - (-EINVAL) if parameters invalid.
151bda68ab9SRemy Horton  *   - others depends on the specific operations implementation.
152bda68ab9SRemy Horton  */
15347523597SZhiyong Yang int rte_ethtool_set_eeprom(uint16_t port_id, struct ethtool_eeprom *eeprom,
154bda68ab9SRemy Horton 			      void *words);
155bda68ab9SRemy Horton 
156bda68ab9SRemy Horton /**
15799d8ebcfSZijie Pan  * Retrieve the type and size of plugin module EEPROM
15899d8ebcfSZijie Pan  *
15999d8ebcfSZijie Pan  * @param port_id
16099d8ebcfSZijie Pan  *   The port identifier of the Ethernet device.
16199d8ebcfSZijie Pan  * @param modinfo
16299d8ebcfSZijie Pan  *	 The pointer that provides the type and size of plugin module EEPROM.
16399d8ebcfSZijie Pan  * @return
16499d8ebcfSZijie Pan  *   - (0) if successful.
16599d8ebcfSZijie Pan  *   - (-ENOTSUP) if hardware doesn't support.
16699d8ebcfSZijie Pan  *   - (-ENODEV) if *port_id* invalid.
16799d8ebcfSZijie Pan  *   - others depends on the specific operations implementation.
16899d8ebcfSZijie Pan  */
16999d8ebcfSZijie Pan int rte_ethtool_get_module_info(uint16_t port_id, uint32_t *modinfo);
17099d8ebcfSZijie Pan 
17199d8ebcfSZijie Pan /**
17299d8ebcfSZijie Pan  * Retrieve the data of plugin module EEPROM
17399d8ebcfSZijie Pan  *
17499d8ebcfSZijie Pan  * @param port_id
17599d8ebcfSZijie Pan  *   The port identifier of the Ethernet device.
17699d8ebcfSZijie Pan  * @param eeprom
17799d8ebcfSZijie Pan  *	 The pointer of ethtool_eeprom that provides plugin module eeprom
17899d8ebcfSZijie Pan  *   offset and length
17999d8ebcfSZijie Pan  * @param words
18099d8ebcfSZijie Pan  *	 A buffer that holds data read from plugin module eeprom
18199d8ebcfSZijie Pan  * @return
18299d8ebcfSZijie Pan  *   - (0) if successful.
18399d8ebcfSZijie Pan  *   - (-ENOTSUP) if hardware doesn't support.
18499d8ebcfSZijie Pan  *   - (-ENODEV) if *port_id* invalid.
18599d8ebcfSZijie Pan  *   - others depends on the specific operations implementation.
18699d8ebcfSZijie Pan  */
18799d8ebcfSZijie Pan int rte_ethtool_get_module_eeprom(uint16_t port_id,
18899d8ebcfSZijie Pan 				  struct ethtool_eeprom *eeprom, void *words);
18999d8ebcfSZijie Pan 
19099d8ebcfSZijie Pan /**
191bda68ab9SRemy Horton  * Retrieve the Ethernet device pause frame configuration according to
1927be78d02SJosh Soref  * parameter attributes described by ethtool data structure,
193bda68ab9SRemy Horton  * ethtool_pauseparam.
194bda68ab9SRemy Horton  *
195bda68ab9SRemy Horton  * @param port_id
196bda68ab9SRemy Horton  *   The port identifier of the Ethernet device.
197bda68ab9SRemy Horton  * @param pause_param
198bda68ab9SRemy Horton  *	 The pointer of ethtool_coalesce that gets pause frame
199bda68ab9SRemy Horton  *	 configuration parameters
200bda68ab9SRemy Horton  * @return
201bda68ab9SRemy Horton  *   - (0) if successful.
202bda68ab9SRemy Horton  *   - (-ENOTSUP) if hardware doesn't support.
203bda68ab9SRemy Horton  *   - (-ENODEV) if *port_id* invalid.
204bda68ab9SRemy Horton  *   - (-EINVAL) if parameters invalid.
205bda68ab9SRemy Horton  *   - others depends on the specific operations implementation.
206bda68ab9SRemy Horton  */
20747523597SZhiyong Yang int rte_ethtool_get_pauseparam(uint16_t port_id,
208bda68ab9SRemy Horton 				   struct ethtool_pauseparam *pause_param);
209bda68ab9SRemy Horton 
210bda68ab9SRemy Horton /**
211bda68ab9SRemy Horton  * Setting the Ethernet device pause frame configuration according to
2127be78d02SJosh Soref  * parameter attributes described by ethtool data structure, ethtool_pauseparam.
213bda68ab9SRemy Horton  *
214bda68ab9SRemy Horton  * @param port_id
215bda68ab9SRemy Horton  *   The port identifier of the Ethernet device.
216bda68ab9SRemy Horton  * @param pause_param
217bda68ab9SRemy Horton  *	 The pointer of ethtool_coalesce that gets ring configuration parameters
218bda68ab9SRemy Horton  * @return
219bda68ab9SRemy Horton  *   - (0) if successful.
220bda68ab9SRemy Horton  *   - (-ENOTSUP) if hardware doesn't support.
221bda68ab9SRemy Horton  *   - (-ENODEV) if *port_id* invalid.
222bda68ab9SRemy Horton  *   - (-EINVAL) if parameters invalid.
223bda68ab9SRemy Horton  *   - others depends on the specific operations implementation.
224bda68ab9SRemy Horton  */
22547523597SZhiyong Yang int rte_ethtool_set_pauseparam(uint16_t port_id,
226bda68ab9SRemy Horton 				   struct ethtool_pauseparam *param);
227bda68ab9SRemy Horton 
228bda68ab9SRemy Horton /**
229bda68ab9SRemy Horton  * Start the Ethernet device.
230bda68ab9SRemy Horton  *
231bda68ab9SRemy Horton  * @param port_id
232bda68ab9SRemy Horton  *   The port identifier of the Ethernet device.
233bda68ab9SRemy Horton  * @return
234bda68ab9SRemy Horton  *   - (0) if successful.
235bda68ab9SRemy Horton  *   - (-ENOTSUP) if hardware doesn't support.
236bda68ab9SRemy Horton  *   - (-ENODEV) if *port_id* invalid.
237bda68ab9SRemy Horton  *   - others depends on the specific operations implementation.
238bda68ab9SRemy Horton  */
23947523597SZhiyong Yang int rte_ethtool_net_open(uint16_t port_id);
240bda68ab9SRemy Horton 
241bda68ab9SRemy Horton /**
242bda68ab9SRemy Horton  * Stop the Ethernet device.
243bda68ab9SRemy Horton  *
244bda68ab9SRemy Horton  * @param port_id
245bda68ab9SRemy Horton  *   The port identifier of the Ethernet device.
246bda68ab9SRemy Horton  * @return
247bda68ab9SRemy Horton  *   - (0) if successful.
248bda68ab9SRemy Horton  *   - (-ENODEV) if *port_id* invalid.
249bda68ab9SRemy Horton  */
25047523597SZhiyong Yang int rte_ethtool_net_stop(uint16_t port_id);
251bda68ab9SRemy Horton 
252bda68ab9SRemy Horton /**
253bda68ab9SRemy Horton  * Get the Ethernet device MAC address.
254bda68ab9SRemy Horton  *
255bda68ab9SRemy Horton  * @param port_id
256bda68ab9SRemy Horton  *   The port identifier of the Ethernet device.
257bda68ab9SRemy Horton  * @param addr
258bda68ab9SRemy Horton  *	 MAC address of the Ethernet device.
259bda68ab9SRemy Horton  * @return
260bda68ab9SRemy Horton  *   - (0) if successful.
261bda68ab9SRemy Horton  *   - (-ENODEV) if *port_id* invalid.
262bda68ab9SRemy Horton  */
2636d13ea8eSOlivier Matz int rte_ethtool_net_get_mac_addr(uint16_t port_id, struct rte_ether_addr *addr);
264bda68ab9SRemy Horton 
265bda68ab9SRemy Horton /**
266bda68ab9SRemy Horton  * Setting the Ethernet device MAC address.
267bda68ab9SRemy Horton  *
268bda68ab9SRemy Horton  * @param port_id
269bda68ab9SRemy Horton  *   The port identifier of the Ethernet device.
270bda68ab9SRemy Horton  * @param addr
271bda68ab9SRemy Horton  *	 The new MAC addr.
272bda68ab9SRemy Horton  * @return
273bda68ab9SRemy Horton  *   - (0) if successful.
274bda68ab9SRemy Horton  *   - (-ENOTSUP) if hardware doesn't support.
275bda68ab9SRemy Horton  *   - (-ENODEV) if *port_id* invalid.
276bda68ab9SRemy Horton  *   - (-EINVAL) if parameters invalid.
277bda68ab9SRemy Horton  *   - others depends on the specific operations implementation.
278bda68ab9SRemy Horton  */
2796d13ea8eSOlivier Matz int rte_ethtool_net_set_mac_addr(uint16_t port_id, struct rte_ether_addr *addr);
280bda68ab9SRemy Horton 
281bda68ab9SRemy Horton /**
282bda68ab9SRemy Horton  * Validate if the provided MAC address is valid unicast address
283bda68ab9SRemy Horton  *
284bda68ab9SRemy Horton  * @param port_id
285bda68ab9SRemy Horton  *   The port identifier of the Ethernet device.
286bda68ab9SRemy Horton  * @param addr
287bda68ab9SRemy Horton  *	 A pointer to a buffer (6-byte, 48bit) for the target MAC address
288bda68ab9SRemy Horton  * @return
289bda68ab9SRemy Horton  *   - (0) if successful.
290bda68ab9SRemy Horton  *   - (-ENOTSUP) if hardware doesn't support.
291bda68ab9SRemy Horton  *   - (-ENODEV) if *port_id* invalid.
292bda68ab9SRemy Horton  *   - (-EINVAL) if parameters invalid.
293bda68ab9SRemy Horton  *   - others depends on the specific operations implementation.
294bda68ab9SRemy Horton  */
2956d13ea8eSOlivier Matz int rte_ethtool_net_validate_addr(uint16_t port_id,
2966d13ea8eSOlivier Matz 				struct rte_ether_addr *addr);
297bda68ab9SRemy Horton 
298bda68ab9SRemy Horton /**
299bda68ab9SRemy Horton  * Setting the Ethernet device maximum Tx unit.
300bda68ab9SRemy Horton  *
301bda68ab9SRemy Horton  * @param port_id
302bda68ab9SRemy Horton  *   The port identifier of the Ethernet device.
303bda68ab9SRemy Horton  * @param mtu
304bda68ab9SRemy Horton  *	 New MTU
305bda68ab9SRemy Horton  * @return
306bda68ab9SRemy Horton  *   - (0) if successful.
307bda68ab9SRemy Horton  *   - (-ENOTSUP) if hardware doesn't support.
308bda68ab9SRemy Horton  *   - (-ENODEV) if *port_id* invalid.
309bda68ab9SRemy Horton  *   - (-EINVAL) if parameters invalid.
310bda68ab9SRemy Horton  *   - others depends on the specific operations implementation.
311bda68ab9SRemy Horton  */
31247523597SZhiyong Yang int rte_ethtool_net_change_mtu(uint16_t port_id, int mtu);
313bda68ab9SRemy Horton 
314bda68ab9SRemy Horton /**
315bda68ab9SRemy Horton  * Retrieve the Ethernet device traffic statistics
316bda68ab9SRemy Horton  *
317bda68ab9SRemy Horton  * @param port_id
318bda68ab9SRemy Horton  *   The port identifier of the Ethernet device.
319bda68ab9SRemy Horton  * @param stats
320bda68ab9SRemy Horton  *	 A pointer to struct rte_eth_stats for statistics parameters
321bda68ab9SRemy Horton  * @return
322bda68ab9SRemy Horton  *   - (0) if successful.
323bda68ab9SRemy Horton  *   - (-ENOTSUP) if hardware doesn't support.
324bda68ab9SRemy Horton  *   - (-ENODEV) if *port_id* invalid.
325bda68ab9SRemy Horton  *   - (-EINVAL) if parameters invalid.
326bda68ab9SRemy Horton  *   - others depends on the specific operations implementation.
327bda68ab9SRemy Horton  */
32847523597SZhiyong Yang int rte_ethtool_net_get_stats64(uint16_t port_id, struct rte_eth_stats *stats);
329bda68ab9SRemy Horton 
330bda68ab9SRemy Horton /**
331bda68ab9SRemy Horton  * Update the Ethernet device VLAN filter with new vid
332bda68ab9SRemy Horton  *
333bda68ab9SRemy Horton  * @param port_id
334bda68ab9SRemy Horton  *   The port identifier of the Ethernet device.
335bda68ab9SRemy Horton  * @param vid
336bda68ab9SRemy Horton  *	 A new VLAN id
337bda68ab9SRemy Horton  * @return
338bda68ab9SRemy Horton  *   - (0) if successful.
339bda68ab9SRemy Horton  *   - (-ENOTSUP) if hardware doesn't support.
340bda68ab9SRemy Horton  *   - (-ENODEV) if *port_id* invalid.
341bda68ab9SRemy Horton  *   - others depends on the specific operations implementation.
342bda68ab9SRemy Horton  */
34347523597SZhiyong Yang int rte_ethtool_net_vlan_rx_add_vid(uint16_t port_id, uint16_t vid);
344bda68ab9SRemy Horton 
345bda68ab9SRemy Horton /**
346bda68ab9SRemy Horton  * Remove VLAN id from Ethernet device.
347bda68ab9SRemy Horton  *
348bda68ab9SRemy Horton  * @param port_id
349bda68ab9SRemy Horton  *   The port identifier of the Ethernet device.
350bda68ab9SRemy Horton  * @param vid
351bda68ab9SRemy Horton  *	 A new VLAN id
352bda68ab9SRemy Horton  * @return
353bda68ab9SRemy Horton  *   - (0) if successful.
354bda68ab9SRemy Horton  *   - (-ENOTSUP) if hardware doesn't support.
355bda68ab9SRemy Horton  *   - (-ENODEV) if *port_id* invalid.
356bda68ab9SRemy Horton  *   - others depends on the specific operations implementation.
357bda68ab9SRemy Horton  */
35847523597SZhiyong Yang int rte_ethtool_net_vlan_rx_kill_vid(uint16_t port_id, uint16_t vid);
359bda68ab9SRemy Horton 
360bda68ab9SRemy Horton /**
361bda68ab9SRemy Horton  * Setting the Ethernet device rx mode.
362bda68ab9SRemy Horton  *
363bda68ab9SRemy Horton  * @param port_id
364bda68ab9SRemy Horton  *   The port identifier of the Ethernet device.
365bda68ab9SRemy Horton  * @return
366bda68ab9SRemy Horton  *   - (0) if successful.
367bda68ab9SRemy Horton  *   - (-ENOTSUP) if hardware doesn't support.
368bda68ab9SRemy Horton  *   - (-ENODEV) if *port_id* invalid.
369bda68ab9SRemy Horton  *   - others depends on the specific operations implementation.
370bda68ab9SRemy Horton  */
37147523597SZhiyong Yang int rte_ethtool_net_set_rx_mode(uint16_t port_id);
372bda68ab9SRemy Horton 
373bda68ab9SRemy Horton /**
37498a7ea33SJerin Jacob  * Getting ring parameters for Ethernet device.
375bda68ab9SRemy Horton  *
376bda68ab9SRemy Horton  * @param port_id
377bda68ab9SRemy Horton  *   The port identifier of the Ethernet device.
378bda68ab9SRemy Horton  * @param ring_param
379bda68ab9SRemy Horton  *   Pointer to struct ethrool_ringparam to receive parameters.
380bda68ab9SRemy Horton  * @return
381bda68ab9SRemy Horton  *   - (0) if successful.
382bda68ab9SRemy Horton  *   - (-ENOTSUP) if hardware doesn't support.
383bda68ab9SRemy Horton  *   - (-ENODEV) if *port_id* invalid.
384bda68ab9SRemy Horton  *   - others depends on the specific operations implementation.
385bda68ab9SRemy Horton  * @note
386bda68ab9SRemy Horton  *   Only the tx_pending and rx_pending fields of struct ethtool_ringparam
387bda68ab9SRemy Horton  *   are used, and the function only gets parameters for queue 0.
388bda68ab9SRemy Horton  */
38947523597SZhiyong Yang int rte_ethtool_get_ringparam(uint16_t port_id,
390bda68ab9SRemy Horton 	struct ethtool_ringparam *ring_param);
391bda68ab9SRemy Horton 
392bda68ab9SRemy Horton /**
39398a7ea33SJerin Jacob  * Setting ring parameters for Ethernet device.
394bda68ab9SRemy Horton  *
395bda68ab9SRemy Horton  * @param port_id
396bda68ab9SRemy Horton  *   The port identifier of the Ethernet device.
397bda68ab9SRemy Horton  * @param ring_param
398bda68ab9SRemy Horton  *   Pointer to struct ethrool_ringparam with parameters to set.
399bda68ab9SRemy Horton  * @return
400bda68ab9SRemy Horton  *   - (0) if successful.
401bda68ab9SRemy Horton  *   - (-ENOTSUP) if hardware doesn't support.
402bda68ab9SRemy Horton  *   - (-ENODEV) if *port_id* invalid.
403bda68ab9SRemy Horton  *   - others depends on the specific operations implementation.
404bda68ab9SRemy Horton  * @note
405bda68ab9SRemy Horton  *   Only the tx_pending and rx_pending fields of struct ethtool_ringparam
406bda68ab9SRemy Horton  *   are used, and the function only sets parameters for queue 0.
407bda68ab9SRemy Horton  */
40847523597SZhiyong Yang int rte_ethtool_set_ringparam(uint16_t port_id,
409bda68ab9SRemy Horton 	struct ethtool_ringparam *ring_param);
410bda68ab9SRemy Horton 
411bda68ab9SRemy Horton 
412bda68ab9SRemy Horton #ifdef __cplusplus
413bda68ab9SRemy Horton }
414bda68ab9SRemy Horton #endif
415bda68ab9SRemy Horton 
416bda68ab9SRemy Horton #endif /* _RTE_ETHTOOL_H_ */
417