xref: /dpdk/lib/port/rte_swx_port_fd.h (revision 719834a6849e1daf4a70ff7742bbcc3ae7e25607)
1 /* SPDX-License-Identifier: BSD-3-Clause
2  * Copyright(c) 2021 Intel Corporation
3  */
4 
5 #ifndef __INCLUDE_RTE_SWX_PORT_FD_H__
6 #define __INCLUDE_RTE_SWX_PORT_FD_H__
7 
8 /**
9  * @file
10  * RTE SWX FD Input and Output Ports
11  */
12 
13 #include <stdint.h>
14 
15 #include "rte_swx_port.h"
16 
17 #ifdef __cplusplus
18 extern "C" {
19 #endif
20 
21 /** fd_reader port parameters */
22 struct rte_swx_port_fd_reader_params {
23 	/** File descriptor. Must be valid and opened in non-blocking mode. */
24 	int fd;
25 
26 	/** Maximum Transfer Unit (MTU) */
27 	uint32_t mtu;
28 
29 	/** Pre-initialized buffer pool */
30 	struct rte_mempool *mempool;
31 
32 	/** RX burst size */
33 	uint32_t burst_size;
34 };
35 
36 /** fd_reader port operations */
37 extern struct rte_swx_port_in_ops rte_swx_port_fd_reader_ops;
38 
39 /** fd_writer port parameters */
40 struct rte_swx_port_fd_writer_params {
41 	/** File descriptor. Must be valid and opened in non-blocking mode. */
42 	int fd;
43 
44 	/** TX burst size */
45 	uint32_t burst_size;
46 };
47 
48 /** fd_writer port operations */
49 extern struct rte_swx_port_out_ops rte_swx_port_fd_writer_ops;
50 
51 #ifdef __cplusplus
52 }
53 #endif
54 
55 #endif /* __INCLUDE_RTE_SWX_PORT_FD_H__ */
56