FD.io VPP
v18.07-rc0-415-g6c78436
Vector Packet Processing
Main Page
Related Pages
Modules
Namespaces
Data Structures
Source
Files
Symbols
pp2.h
Go to the documentation of this file.
1
/*
2
*------------------------------------------------------------------
3
* Copyright (c) 2018 Cisco and/or its affiliates.
4
* Licensed under the Apache License, Version 2.0 (the "License");
5
* you may not use this file except in compliance with the License.
6
* You may obtain a copy of the License at:
7
*
8
* http://www.apache.org/licenses/LICENSE-2.0
9
*
10
* Unless required by applicable law or agreed to in writing, software
11
* distributed under the License is distributed on an "AS IS" BASIS,
12
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13
* See the License for the specific language governing permissions and
14
* limitations under the License.
15
*------------------------------------------------------------------
16
*/
17
18
#define MVCONF_DBG_LEVEL 0
19
#define MVCONF_PP2_BPOOL_COOKIE_SIZE 32
20
#define MVCONF_PP2_BPOOL_DMA_ADDR_SIZE 64
21
#define MVCONF_DMA_PHYS_ADDR_T_SIZE 64
22
#define MVCONF_SYS_DMA_UIO
23
#define MVCONF_TYPES_PUBLIC
24
#define MVCONF_DMA_PHYS_ADDR_T_PUBLIC
25
26
#include "mv_std.h"
27
#include "env/mv_sys_dma.h"
28
#include "drivers/mv_pp2.h"
29
#include <drivers/mv_pp2_bpool.h>
30
#include <drivers/mv_pp2_ppio.h>
31
32
typedef
struct
33
{
34
CLIB_CACHE_LINE_ALIGN_MARK
(cacheline0);
35
u16
size
;
36
struct
pp2_bpool *
bpool
;
37
}
mrvl_pp2_inq_t
;
38
39
typedef
struct
40
{
41
CLIB_CACHE_LINE_ALIGN_MARK
(cacheline0);
42
u16
size
;
43
u32
*
buffers
;
44
u16
head
;
45
u16
tail
;
46
}
mrvl_pp2_outq_t
;
47
48
typedef
struct
49
{
50
CLIB_CACHE_LINE_ALIGN_MARK
(cacheline0);
51
u32
flags
;
52
#define MRVL_PP2_IF_F_ADMIN_UP (1 << 0)
53
struct
pp2_ppio *
ppio
;
54
u32
per_interface_next_index
;
55
56
mrvl_pp2_inq_t
*
inqs
;
57
mrvl_pp2_outq_t
*
outqs
;
58
59
u32
dev_instance
;
60
u32
sw_if_index
;
61
u32
hw_if_index
;
62
}
mrvl_pp2_if_t
;
63
64
#define MRVL_PP2_BUFF_BATCH_SZ 64
65
66
typedef
struct
67
{
68
CLIB_CACHE_LINE_ALIGN_MARK
(cacheline0);
69
struct
pp2_hif *
hif
;
70
struct
pp2_ppio_desc *
descs
;
71
struct
buff_release_entry bre[
MRVL_PP2_BUFF_BATCH_SZ
];
72
u32
buffers[
VLIB_FRAME_SIZE
];
73
}
mrvl_pp2_per_thread_data_t
;
74
75
typedef
struct
76
{
77
mrvl_pp2_if_t
*
interfaces
;
78
mrvl_pp2_per_thread_data_t
*
per_thread_data
;
79
}
mrvl_pp2_main_t
;
80
81
extern
vnet_device_class_t
mrvl_pp2_device_class
;
82
extern
mrvl_pp2_main_t
mrvl_pp2_main
;
83
84
typedef
struct
85
{
86
u8
*
name
;
87
u16
rx_q_sz
;
88
u16
tx_q_sz
;
89
90
/* return */
91
int
rv
;
92
clib_error_t
*
error
;
93
}
mrvl_pp2_create_if_args_t
;
94
95
void
mrvl_pp2_create_if
(
mrvl_pp2_create_if_args_t
* args);
96
void
mrvl_pp2_delete_if
(
mrvl_pp2_if_t
* dfif);
97
98
/* output.c */
99
100
#define foreach_mrvl_pp2_tx_func_error \
101
_(NO_FREE_SLOTS, "no free tx slots") \
102
_(PPIO_SEND, "pp2_ppio_send errors") \
103
_(PPIO_GET_NUM_OUTQ_DONE, "pp2_ppio_get_num_outq_done errors")
104
105
typedef
enum
106
{
107
#define _(f,s) MRVL_PP2_TX_ERROR_##f,
108
foreach_mrvl_pp2_tx_func_error
109
#undef _
110
MRVL_PP2_TX_N_ERROR
,
111
}
mrvl_pp2_tx_func_error_t
;
112
113
uword
mrvl_pp2_interface_tx
(
vlib_main_t
*
vm
,
vlib_node_runtime_t
* node,
114
vlib_frame_t
* frame);
115
116
/* input.c */
117
118
typedef
struct
119
{
120
u32
next_index
;
121
u32
hw_if_index
;
122
struct
pp2_ppio_desc desc;
123
}
mrvl_pp2_input_trace_t
;
124
125
extern
vlib_node_registration_t
mrvl_pp2_input_node
;
126
127
/* format.c */
128
format_function_t
format_mrvl_pp2_input_trace
;
129
format_function_t
format_mrvl_pp2_interface
;
130
format_function_t
format_mrvl_pp2_interface_name
;
131
132
133
/*
134
* fd.io coding-style-patch-verification: ON
135
*
136
* Local Variables:
137
* eval: (c-set-style "gnu")
138
* End:
139
*/
mrvl_pp2_if_t::ppio
struct pp2_ppio * ppio
Definition:
pp2.h:53
mrvl_pp2_input_trace_t::next_index
u32 next_index
Definition:
pp2.h:120
mrvl_pp2_if_t::outqs
mrvl_pp2_outq_t * outqs
Definition:
pp2.h:57
CLIB_CACHE_LINE_ALIGN_MARK
#define CLIB_CACHE_LINE_ALIGN_MARK(mark)
Definition:
cache.h:63
mrvl_pp2_if_t::dev_instance
u32 dev_instance
Definition:
pp2.h:59
mrvl_pp2_outq_t::head
u16 head
Definition:
pp2.h:44
format_mrvl_pp2_input_trace
format_function_t format_mrvl_pp2_input_trace
Definition:
pp2.h:128
mrvl_pp2_per_thread_data_t::descs
struct pp2_ppio_desc * descs
Definition:
pp2.h:70
mrvl_pp2_create_if_args_t::rx_q_sz
u16 rx_q_sz
Definition:
pp2.h:87
mrvl_pp2_if_t::per_interface_next_index
u32 per_interface_next_index
Definition:
pp2.h:54
mrvl_pp2_device_class
vnet_device_class_t mrvl_pp2_device_class
mrvl_pp2_delete_if
void mrvl_pp2_delete_if(mrvl_pp2_if_t *dfif)
Definition:
pp2.c:115
format_function_t
u8 *( format_function_t)(u8 *s, va_list *args)
Definition:
format.h:48
mrvl_pp2_create_if_args_t
Definition:
pp2.h:84
mrvl_pp2_input_trace_t
Definition:
pp2.h:118
vnet_device_class_t
struct _vnet_device_class vnet_device_class_t
mrvl_pp2_create_if_args_t::tx_q_sz
u16 tx_q_sz
Definition:
pp2.h:88
u8
unsigned char u8
Definition:
types.h:56
vlib_frame_t
Definition:
node.h:368
mrvl_pp2_if_t::hw_if_index
u32 hw_if_index
Definition:
pp2.h:61
mrvl_pp2_create_if
void mrvl_pp2_create_if(mrvl_pp2_create_if_args_t *args)
Definition:
pp2.c:177
mrvl_pp2_create_if_args_t::rv
int rv
Definition:
pp2.h:91
mrvl_pp2_inq_t::bpool
struct pp2_bpool * bpool
Definition:
pp2.h:36
vlib_node_runtime_t
Definition:
node.h:445
MRVL_PP2_TX_N_ERROR
Definition:
pp2.h:110
mrvl_pp2_per_thread_data_t
Definition:
pp2.h:66
foreach_mrvl_pp2_tx_func_error
#define foreach_mrvl_pp2_tx_func_error
Definition:
pp2.h:100
format_mrvl_pp2_interface
format_function_t format_mrvl_pp2_interface
Definition:
pp2.h:129
mrvl_pp2_if_t::sw_if_index
u32 sw_if_index
Definition:
pp2.h:60
mrvl_pp2_tx_func_error_t
mrvl_pp2_tx_func_error_t
Definition:
pp2.h:105
mrvl_pp2_if_t
Definition:
pp2.h:48
u32
unsigned int u32
Definition:
types.h:88
mrvl_pp2_outq_t::size
u16 size
Definition:
pp2.h:42
VLIB_FRAME_SIZE
#define VLIB_FRAME_SIZE
Definition:
node.h:364
mrvl_pp2_per_thread_data_t::hif
struct pp2_hif * hif
Definition:
pp2.h:69
MRVL_PP2_BUFF_BATCH_SZ
#define MRVL_PP2_BUFF_BATCH_SZ
Definition:
pp2.h:64
u16
unsigned short u16
Definition:
types.h:57
mrvl_pp2_if_t::flags
u32 flags
Definition:
pp2.h:51
mrvl_pp2_main
mrvl_pp2_main_t mrvl_pp2_main
Definition:
pp2.c:36
mrvl_pp2_input_trace_t::hw_if_index
u32 hw_if_index
Definition:
pp2.h:121
vm
vlib_main_t * vm
Definition:
buffer.c:294
mrvl_pp2_outq_t::buffers
u32 * buffers
Definition:
pp2.h:43
mrvl_pp2_input_node
vlib_node_registration_t mrvl_pp2_input_node
(constructor) VLIB_REGISTER_NODE (mrvl_pp2_input_node)
Definition:
input.c:374
mrvl_pp2_outq_t::tail
u16 tail
Definition:
pp2.h:45
clib_error_t
Definition:
clib_error.h:21
vlib_node_registration_t
struct _vlib_node_registration vlib_node_registration_t
mrvl_pp2_outq_t
Definition:
pp2.h:39
mrvl_pp2_create_if_args_t::name
u8 * name
Definition:
pp2.h:86
vlib_main_t
Definition:
main.h:59
uword
u64 uword
Definition:
types.h:112
format_mrvl_pp2_interface_name
format_function_t format_mrvl_pp2_interface_name
Definition:
pp2.h:130
mrvl_pp2_main_t
Definition:
pp2.h:75
mrvl_pp2_create_if_args_t::error
clib_error_t * error
Definition:
pp2.h:92
mrvl_pp2_inq_t
Definition:
pp2.h:32
mrvl_pp2_main_t::interfaces
mrvl_pp2_if_t * interfaces
Definition:
pp2.h:77
mrvl_pp2_main_t::per_thread_data
mrvl_pp2_per_thread_data_t * per_thread_data
Definition:
pp2.h:78
mrvl_pp2_interface_tx
uword mrvl_pp2_interface_tx(vlib_main_t *vm, vlib_node_runtime_t *node, vlib_frame_t *frame)
Definition:
output.c:31
mrvl_pp2_if_t::inqs
mrvl_pp2_inq_t * inqs
Definition:
pp2.h:56
mrvl_pp2_inq_t::size
u16 size
Definition:
pp2.h:35
src
plugins
marvell
pp2
pp2.h
Generated on Tue Aug 21 2018 06:02:03 for FD.io VPP by
1.8.11