xref: /dpdk/lib/port/rte_port_fd.h (revision 30a1de10)
1 /* SPDX-License-Identifier: BSD-3-Clause
2  * Copyright(c) 2016 Intel Corporation
3  */
4 
5 #ifndef __INCLUDE_RTE_PORT_FD_H__
6 #define __INCLUDE_RTE_PORT_FD_H__
7 
8 #ifdef __cplusplus
9 extern "C" {
10 #endif
11 
12 /**
13  * @file
14  * RTE Port FD Device
15  *
16  * fd_reader: input port built on top of valid non-blocking file descriptor
17  * fd_writer: output port built on top of valid non-blocking file descriptor
18  *
19  ***/
20 
21 #include <stdint.h>
22 
23 #include "rte_port.h"
24 
25 /** fd_reader port parameters */
26 struct rte_port_fd_reader_params {
27 	/** File descriptor */
28 	int fd;
29 
30 	/** Maximum Transfer Unit (MTU) */
31 	uint32_t mtu;
32 
33 	/** Pre-initialized buffer pool */
34 	struct rte_mempool *mempool;
35 };
36 
37 /** fd_reader port operations */
38 extern struct rte_port_in_ops rte_port_fd_reader_ops;
39 
40 /** fd_writer port parameters */
41 struct rte_port_fd_writer_params {
42 	/** File descriptor */
43 	int fd;
44 
45 	/**< Recommended write burst size. The actual burst size can be
46 	 * bigger or smaller than this value.
47 	 */
48 	uint32_t tx_burst_sz;
49 };
50 
51 /** fd_writer port operations */
52 extern struct rte_port_out_ops rte_port_fd_writer_ops;
53 
54 /** fd_writer_nodrop port parameters */
55 struct rte_port_fd_writer_nodrop_params {
56 	/** File descriptor */
57 	int fd;
58 
59 	/**< Recommended write burst size. The actual burst size can be
60 	 * bigger or smaller than this value.
61 	 */
62 	uint32_t tx_burst_sz;
63 
64 	/** Maximum number of retries, 0 for no limit */
65 	uint32_t n_retries;
66 };
67 
68 /** fd_writer_nodrop port operations */
69 extern struct rte_port_out_ops rte_port_fd_writer_nodrop_ops;
70 
71 #ifdef __cplusplus
72 }
73 #endif
74 
75 #endif
76