DPDK
25.11.0
Toggle main menu visibility
Loading...
Searching...
No Matches
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
15
16
#include <stdint.h>
17
#include <
rte_mbuf.h
>
18
23
#define RTE_MBUF_METADATA_UINT8_PTR(mbuf, offset) \
24
(&((uint8_t *)(mbuf))[offset])
25
#define RTE_MBUF_METADATA_UINT16_PTR(mbuf, offset) \
26
((uint16_t *) RTE_MBUF_METADATA_UINT8_PTR(mbuf, offset))
27
#define RTE_MBUF_METADATA_UINT32_PTR(mbuf, offset) \
28
((uint32_t *) RTE_MBUF_METADATA_UINT8_PTR(mbuf, offset))
29
#define RTE_MBUF_METADATA_UINT64_PTR(mbuf, offset) \
30
((uint64_t *) RTE_MBUF_METADATA_UINT8_PTR(mbuf, offset))
31
32
#define RTE_MBUF_METADATA_UINT8(mbuf, offset) \
33
(*RTE_MBUF_METADATA_UINT8_PTR(mbuf, offset))
34
#define RTE_MBUF_METADATA_UINT16(mbuf, offset) \
35
(*RTE_MBUF_METADATA_UINT16_PTR(mbuf, offset))
36
#define RTE_MBUF_METADATA_UINT32(mbuf, offset) \
37
(*RTE_MBUF_METADATA_UINT32_PTR(mbuf, offset))
38
#define RTE_MBUF_METADATA_UINT64(mbuf, offset) \
39
(*RTE_MBUF_METADATA_UINT64_PTR(mbuf, offset))
40
41
42
/*
43
* Port IN
44
*/
47
#define RTE_PORT_IN_BURST_SIZE_MAX 64
48
50
struct
rte_port_in_stats
{
51
uint64_t n_pkts_in;
52
uint64_t n_pkts_drop;
53
};
54
65
typedef
void
* (*rte_port_in_op_create)(
void
*params,
int
socket_id);
66
75
typedef
int (*
rte_port_in_op_free
)(
void
*port);
76
89
typedef
int (*
rte_port_in_op_rx
)(
90
void
*port,
91
struct
rte_mbuf
**pkts,
92
uint32_t n_pkts);
93
107
typedef
int (*
rte_port_in_op_stats_read
)(
108
void
*
port
,
109
struct
rte_port_in_stats
*stats,
110
int
clear);
111
113
struct
rte_port_in_ops
{
114
rte_port_in_op_create
f_create
;
115
rte_port_in_op_free
f_free
;
116
rte_port_in_op_rx
f_rx
;
117
rte_port_in_op_stats_read
f_stats
;
118
};
119
120
/*
121
* Port OUT
122
*/
124
struct
rte_port_out_stats
{
125
uint64_t n_pkts_in;
126
uint64_t n_pkts_drop;
127
};
128
139
typedef
void
* (*rte_port_out_op_create)(
void
*params,
int
socket_id);
140
149
typedef
int (*
rte_port_out_op_free
)(
void
*port);
150
161
typedef
int (*
rte_port_out_op_tx
)(
162
void
*port,
163
struct
rte_mbuf
*pkt);
164
180
typedef
int (*
rte_port_out_op_tx_bulk
)(
181
void
*
port
,
182
struct
rte_mbuf
**pkts,
183
uint64_t pkts_mask);
184
193
typedef
int (*
rte_port_out_op_flush
)(
void
*
port
);
194
208
typedef
int (*
rte_port_out_op_stats_read
)(
209
void
*
port
,
210
struct
rte_port_out_stats
*stats,
211
int
clear);
212
214
struct
rte_port_out_ops
{
215
rte_port_out_op_create
f_create
;
216
rte_port_out_op_free
f_free
;
217
rte_port_out_op_tx
f_tx
;
218
rte_port_out_op_tx_bulk
f_tx_bulk
;
219
rte_port_out_op_flush
f_flush
;
220
rte_port_out_op_stats_read
f_stats
;
221
};
222
223
#endif
rte_mbuf.h
rte_port_out_op_tx
int(* rte_port_out_op_tx)(void *port, struct rte_mbuf *pkt)
Definition
rte_port.h:161
rte_port_in_op_free
int(* rte_port_in_op_free)(void *port)
Definition
rte_port.h:75
rte_port_out_op_free
int(* rte_port_out_op_free)(void *port)
Definition
rte_port.h:149
rte_port_in_op_stats_read
int(* rte_port_in_op_stats_read)(void *port, struct rte_port_in_stats *stats, int clear)
Definition
rte_port.h:107
rte_port_out_op_tx_bulk
int(* rte_port_out_op_tx_bulk)(void *port, struct rte_mbuf **pkts, uint64_t pkts_mask)
Definition
rte_port.h:180
rte_port_out_op_flush
int(* rte_port_out_op_flush)(void *port)
Definition
rte_port.h:193
rte_port_in_op_create
void *(* rte_port_in_op_create)(void *params, int socket_id)
Definition
rte_port.h:65
rte_port_out_op_stats_read
int(* rte_port_out_op_stats_read)(void *port, struct rte_port_out_stats *stats, int clear)
Definition
rte_port.h:208
rte_port_out_op_create
void *(* rte_port_out_op_create)(void *params, int socket_id)
Definition
rte_port.h:139
rte_port_in_op_rx
int(* rte_port_in_op_rx)(void *port, struct rte_mbuf **pkts, uint32_t n_pkts)
Definition
rte_port.h:89
rte_mbuf
Definition
rte_mbuf_core.h:475
rte_mbuf::port
uint16_t port
Definition
rte_mbuf_core.h:525
rte_port_in_ops
Definition
rte_port.h:113
rte_port_in_ops::f_free
rte_port_in_op_free f_free
Definition
rte_port.h:115
rte_port_in_ops::f_rx
rte_port_in_op_rx f_rx
Definition
rte_port.h:116
rte_port_in_ops::f_stats
rte_port_in_op_stats_read f_stats
Definition
rte_port.h:117
rte_port_in_ops::f_create
rte_port_in_op_create f_create
Definition
rte_port.h:114
rte_port_in_stats
Definition
rte_port.h:50
rte_port_out_ops
Definition
rte_port.h:214
rte_port_out_ops::f_stats
rte_port_out_op_stats_read f_stats
Definition
rte_port.h:220
rte_port_out_ops::f_tx
rte_port_out_op_tx f_tx
Definition
rte_port.h:217
rte_port_out_ops::f_create
rte_port_out_op_create f_create
Definition
rte_port.h:215
rte_port_out_ops::f_flush
rte_port_out_op_flush f_flush
Definition
rte_port.h:219
rte_port_out_ops::f_free
rte_port_out_op_free f_free
Definition
rte_port.h:216
rte_port_out_ops::f_tx_bulk
rte_port_out_op_tx_bulk f_tx_bulk
Definition
rte_port.h:218
rte_port_out_stats
Definition
rte_port.h:124
lib
port
rte_port.h
Generated by
1.17.0