DPDK
19.05.0
Main Page
Related Pages
Data Structures
Files
Examples
File List
Globals
lib
librte_port
rte_port.h
Go to the documentation of this file.
1
/* SPDX-License-Identifier: BSD-3-Clause
2
* Copyright(c) 2010-2014 Intel Corporation
3
*/
4
5
#ifndef __INCLUDE_RTE_PORT_H__
6
#define __INCLUDE_RTE_PORT_H__
7
8
#ifdef __cplusplus
9
extern
"C"
{
10
#endif
11
21
#include <stdint.h>
22
#include <
rte_mbuf.h
>
23
28
#define RTE_MBUF_METADATA_UINT8_PTR(mbuf, offset) \
29
(&((uint8_t *)(mbuf))[offset])
30
#define RTE_MBUF_METADATA_UINT16_PTR(mbuf, offset) \
31
((uint16_t *) RTE_MBUF_METADATA_UINT8_PTR(mbuf, offset))
32
#define RTE_MBUF_METADATA_UINT32_PTR(mbuf, offset) \
33
((uint32_t *) RTE_MBUF_METADATA_UINT8_PTR(mbuf, offset))
34
#define RTE_MBUF_METADATA_UINT64_PTR(mbuf, offset) \
35
((uint64_t *) RTE_MBUF_METADATA_UINT8_PTR(mbuf, offset))
36
37
#define RTE_MBUF_METADATA_UINT8(mbuf, offset) \
38
(*RTE_MBUF_METADATA_UINT8_PTR(mbuf, offset))
39
#define RTE_MBUF_METADATA_UINT16(mbuf, offset) \
40
(*RTE_MBUF_METADATA_UINT16_PTR(mbuf, offset))
41
#define RTE_MBUF_METADATA_UINT32(mbuf, offset) \
42
(*RTE_MBUF_METADATA_UINT32_PTR(mbuf, offset))
43
#define RTE_MBUF_METADATA_UINT64(mbuf, offset) \
44
(*RTE_MBUF_METADATA_UINT64_PTR(mbuf, offset))
45
47
/*
48
* Port IN
49
*
50
*/
53
#define RTE_PORT_IN_BURST_SIZE_MAX 64
54
56
struct
rte_port_in_stats
{
57
uint64_t n_pkts_in;
58
uint64_t n_pkts_drop;
59
};
60
71
typedef
void
* (*rte_port_in_op_create)(
void
*params,
int
socket_id);
72
81
typedef
int (*
rte_port_in_op_free
)(
void
*
port
);
82
95
typedef
int (*
rte_port_in_op_rx
)(
96
void
*
port
,
97
struct
rte_mbuf
**pkts,
98
uint32_t n_pkts);
99
113
typedef
int (*
rte_port_in_op_stats_read
)(
114
void
*
port
,
115
struct
rte_port_in_stats
*stats,
116
int
clear);
117
119
struct
rte_port_in_ops
{
120
rte_port_in_op_create
f_create
;
121
rte_port_in_op_free
f_free
;
122
rte_port_in_op_rx
f_rx
;
123
rte_port_in_op_stats_read
f_stats
;
124
};
125
126
/*
127
* Port OUT
128
*
129
*/
131
struct
rte_port_out_stats
{
132
uint64_t n_pkts_in;
133
uint64_t n_pkts_drop;
134
};
135
146
typedef
void
* (*rte_port_out_op_create)(
void
*params,
int
socket_id);
147
156
typedef
int (*
rte_port_out_op_free
)(
void
*port);
157
168
typedef
int (*
rte_port_out_op_tx
)(
169
void
*port,
170
struct
rte_mbuf
*pkt);
171
187
typedef
int (*
rte_port_out_op_tx_bulk
)(
188
void
*
port
,
189
struct
rte_mbuf
**pkt,
190
uint64_t pkts_mask);
191
200
typedef
int (*
rte_port_out_op_flush
)(
void
*
port
);
201
215
typedef
int (*
rte_port_out_op_stats_read
)(
216
void
*
port
,
217
struct
rte_port_out_stats
*stats,
218
int
clear);
219
221
struct
rte_port_out_ops
{
222
rte_port_out_op_create
f_create
;
223
rte_port_out_op_free
f_free
;
224
rte_port_out_op_tx
f_tx
;
225
rte_port_out_op_tx_bulk
f_tx_bulk
;
226
rte_port_out_op_flush
f_flush
;
227
rte_port_out_op_stats_read
f_stats
;
228
};
229
230
#ifdef __cplusplus
231
}
232
#endif
233
234
#endif
Generated by
1.8.1.2