xref: /dpdk/lib/port/rte_port_ethdev.h (revision 719834a6849e1daf4a70ff7742bbcc3ae7e25607)
1 /* SPDX-License-Identifier: BSD-3-Clause
2  * Copyright(c) 2010-2014 Intel Corporation
3  */
4 
5 #ifndef __INCLUDE_RTE_PORT_ETHDEV_H__
6 #define __INCLUDE_RTE_PORT_ETHDEV_H__
7 
8 /**
9  * @file
10  * RTE Port Ethernet Device
11  *
12  * ethdev_reader: input port built on top of pre-initialized NIC RX queue
13  * ethdev_writer: output port built on top of pre-initialized NIC TX queue
14  */
15 
16 #include <stdint.h>
17 
18 #include "rte_port.h"
19 
20 #ifdef __cplusplus
21 extern "C" {
22 #endif
23 
24 /** ethdev_reader port parameters */
25 struct rte_port_ethdev_reader_params {
26 	/** NIC RX port ID */
27 	uint16_t port_id;
28 
29 	/** NIC RX queue ID */
30 	uint16_t queue_id;
31 };
32 
33 /** ethdev_reader port operations */
34 extern struct rte_port_in_ops rte_port_ethdev_reader_ops;
35 
36 /** ethdev_writer port parameters */
37 struct rte_port_ethdev_writer_params {
38 	/** NIC RX port ID */
39 	uint16_t port_id;
40 
41 	/** NIC RX queue ID */
42 	uint16_t queue_id;
43 
44 	/** Recommended burst size to NIC TX queue. The actual burst size can be
45 	bigger or smaller than this value. */
46 	uint32_t tx_burst_sz;
47 };
48 
49 /** ethdev_writer port operations */
50 extern struct rte_port_out_ops rte_port_ethdev_writer_ops;
51 
52 /** ethdev_writer_nodrop port parameters */
53 struct rte_port_ethdev_writer_nodrop_params {
54 	/** NIC RX port ID */
55 	uint16_t port_id;
56 
57 	/** NIC RX queue ID */
58 	uint16_t queue_id;
59 
60 	/** Recommended burst size to NIC TX queue. The actual burst size can be
61 	bigger or smaller than this value. */
62 	uint32_t tx_burst_sz;
63 
64 	/** Maximum number of retries, 0 for no limit */
65 	uint32_t n_retries;
66 };
67 
68 /** ethdev_writer_nodrop port operations */
69 extern struct rte_port_out_ops rte_port_ethdev_writer_nodrop_ops;
70 
71 #ifdef __cplusplus
72 }
73 #endif
74 
75 #endif
76