test/mem: disable ASan when accessing unallocated memory
[dpdk.git] / lib / port / rte_port_ring.h
1 /* SPDX-License-Identifier: BSD-3-Clause
2  * Copyright(c) 2010-2014 Intel Corporation
3  */
4
5 #ifndef __INCLUDE_RTE_PORT_RING_H__
6 #define __INCLUDE_RTE_PORT_RING_H__
7
8 #ifdef __cplusplus
9 extern "C" {
10 #endif
11
12 /**
13  * @file
14  * RTE Port Ring
15  *
16  * ring_reader:
17  *      input port built on top of pre-initialized single consumer ring
18  * ring_writer:
19  *      output port built on top of pre-initialized single producer ring
20  * ring_multi_reader:
21  *      input port built on top of pre-initialized multi consumers ring
22  * ring_multi_writer:
23  *      output port built on top of pre-initialized multi producers ring
24  *
25  ***/
26
27 #include <stdint.h>
28
29
30 #include "rte_port.h"
31
32 /** ring_reader port parameters */
33 struct rte_port_ring_reader_params {
34         /** Underlying consumer ring that has to be pre-initialized */
35         struct rte_ring *ring;
36 };
37
38 /** ring_reader port operations */
39 extern struct rte_port_in_ops rte_port_ring_reader_ops;
40
41 /** ring_writer port parameters */
42 struct rte_port_ring_writer_params {
43         /** Underlying producer ring that has to be pre-initialized */
44         struct rte_ring *ring;
45
46         /** Recommended burst size to ring. The actual burst size can be
47                 bigger or smaller than this value. */
48         uint32_t tx_burst_sz;
49 };
50
51 /** ring_writer port operations */
52 extern struct rte_port_out_ops rte_port_ring_writer_ops;
53
54 /** ring_writer_nodrop port parameters */
55 struct rte_port_ring_writer_nodrop_params {
56         /** Underlying producer ring that has to be pre-initialized */
57         struct rte_ring *ring;
58
59         /** Recommended burst size to ring. The actual burst size can be
60                 bigger or smaller than this value. */
61         uint32_t tx_burst_sz;
62
63         /** Maximum number of retries, 0 for no limit */
64         uint32_t n_retries;
65 };
66
67 /** ring_writer_nodrop port operations */
68 extern struct rte_port_out_ops rte_port_ring_writer_nodrop_ops;
69
70 /** ring_multi_reader port parameters */
71 #define rte_port_ring_multi_reader_params rte_port_ring_reader_params
72
73 /** ring_multi_reader port operations */
74 extern struct rte_port_in_ops rte_port_ring_multi_reader_ops;
75
76 /** ring_multi_writer port parameters */
77 #define rte_port_ring_multi_writer_params rte_port_ring_writer_params
78
79 /** ring_multi_writer port operations */
80 extern struct rte_port_out_ops rte_port_ring_multi_writer_ops;
81
82 /** ring_multi_writer_nodrop port parameters */
83 #define rte_port_ring_multi_writer_nodrop_params \
84         rte_port_ring_writer_nodrop_params
85
86 /** ring_multi_writer_nodrop port operations */
87 extern struct rte_port_out_ops rte_port_ring_multi_writer_nodrop_ops;
88
89 #ifdef __cplusplus
90 }
91 #endif
92
93 #endif