FD.io VPP
v18.10-34-gcce845e
Vector Packet Processing
Main Page
Related Pages
Modules
Namespaces
Data Structures
Source
Files
Symbols
nsim.h
Go to the documentation of this file.
1
2
/*
3
* nsim.h - skeleton vpp engine plug-in header file
4
*
5
* Copyright (c) <current-year> <your-organization>
6
* Licensed under the Apache License, Version 2.0 (the "License");
7
* you may not use this file except in compliance with the License.
8
* You may obtain a copy of the License at:
9
*
10
* http://www.apache.org/licenses/LICENSE-2.0
11
*
12
* Unless required by applicable law or agreed to in writing, software
13
* distributed under the License is distributed on an "AS IS" BASIS,
14
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15
* See the License for the specific language governing permissions and
16
* limitations under the License.
17
*/
18
#ifndef __included_nsim_h__
19
#define __included_nsim_h__
20
21
#include <
vnet/vnet.h
>
22
#include <
vnet/ip/ip.h
>
23
#include <
vnet/ethernet/ethernet.h
>
24
25
#include <
vppinfra/hash.h
>
26
#include <
vppinfra/error.h
>
27
28
#define WHEEL_ENTRY_DATA_SIZE 1536
/* an even multiple of 64, pls */
29
30
typedef
struct
31
{
32
f64
tx_time
;
33
u32
tx_sw_if_index
;
34
u32
current_length
;
35
CLIB_CACHE_LINE_ALIGN_MARK
(
pad
);
36
u8
data[
WHEEL_ENTRY_DATA_SIZE
];
37
}
nsim_wheel_entry_t
;
38
39
typedef
struct
40
{
41
u32
wheel_size
;
42
u32
cursize
;
43
u32
head
;
44
u32
tail
;
45
nsim_wheel_entry_t
*
entries
;
46
CLIB_CACHE_LINE_ALIGN_MARK
(
pad
);
47
}
nsim_wheel_t
;
48
49
typedef
struct
50
{
51
/* API message ID base */
52
u16
msg_id_base
;
53
54
/* Two interfaces, cross-connected with delay */
55
u32
sw_if_index0,
sw_if_index1
;
56
u32
output_next_index0,
output_next_index1
;
57
58
/* Per-thread buffer / scheduler wheels */
59
nsim_wheel_t
**
wheel_by_thread
;
60
u32
**
buffer_indices_by_thread
;
61
62
/* Config parameters */
63
f64
delay
;
64
f64
bandwidth
;
65
f64
packet_size
;
66
67
u64
mmap_size
;
68
69
/* Wheels are configured */
70
int
is_configured
;
71
72
/* convenience */
73
vlib_main_t
*
vlib_main
;
74
vnet_main_t
*
vnet_main
;
75
}
nsim_main_t
;
76
77
extern
nsim_main_t
nsim_main
;
78
79
extern
vlib_node_registration_t
nsim_node
;
80
extern
vlib_node_registration_t
nsim_input_node
;
81
82
#endif
/* __included_nsim_h__ */
83
84
/*
85
* fd.io coding-style-patch-verification: ON
86
*
87
* Local Variables:
88
* eval: (c-set-style "gnu")
89
* End:
90
*/
nsim_main_t::packet_size
f64 packet_size
Definition:
nsim.h:65
pad
u8 pad[3]
log2 (size of the packing page block)
Definition:
bihash_doc.h:61
CLIB_CACHE_LINE_ALIGN_MARK
#define CLIB_CACHE_LINE_ALIGN_MARK(mark)
Definition:
cache.h:60
WHEEL_ENTRY_DATA_SIZE
#define WHEEL_ENTRY_DATA_SIZE
Definition:
nsim.h:28
nsim_main_t::msg_id_base
u16 msg_id_base
Definition:
nsim.h:52
u64
unsigned long u64
Definition:
types.h:89
nsim_wheel_entry_t
Definition:
nsim.h:30
ip.h
u8
unsigned char u8
Definition:
types.h:56
hash.h
nsim_wheel_entry_t::current_length
u32 current_length
Definition:
nsim.h:34
f64
double f64
Definition:
types.h:142
nsim_wheel_t::cursize
u32 cursize
Definition:
nsim.h:42
nsim_wheel_entry_t::tx_sw_if_index
u32 tx_sw_if_index
Definition:
nsim.h:33
nsim_main_t::vnet_main
vnet_main_t * vnet_main
Definition:
nsim.h:74
nsim_main_t::is_configured
int is_configured
Definition:
nsim.h:70
nsim_wheel_t
Definition:
nsim.h:39
u32
unsigned int u32
Definition:
types.h:88
nsim_node
vlib_node_registration_t nsim_node
(constructor) VLIB_REGISTER_NODE (nsim_node)
Definition:
node.c:49
ethernet.h
nsim_main_t::mmap_size
u64 mmap_size
Definition:
nsim.h:67
u16
unsigned short u16
Definition:
types.h:57
nsim_wheel_t::tail
u32 tail
Definition:
nsim.h:44
vnet.h
nsim_main_t::sw_if_index1
u32 sw_if_index1
Definition:
nsim.h:55
nsim_input_node
vlib_node_registration_t nsim_input_node
(constructor) VLIB_REGISTER_NODE (nsim_input_node)
Definition:
nsim_input.c:204
nsim_wheel_t::entries
nsim_wheel_entry_t * entries
Definition:
nsim.h:45
nsim_wheel_t::head
u32 head
Definition:
nsim.h:43
nsim_main_t::vlib_main
vlib_main_t * vlib_main
Definition:
nsim.h:73
vnet_main_t
Definition:
vnet.h:51
nsim_main_t
Definition:
nsim.h:49
nsim_main_t::wheel_by_thread
nsim_wheel_t ** wheel_by_thread
Definition:
nsim.h:59
vlib_node_registration_t
struct _vlib_node_registration vlib_node_registration_t
nsim_main_t::bandwidth
f64 bandwidth
Definition:
nsim.h:64
nsim_wheel_entry_t::tx_time
f64 tx_time
Definition:
nsim.h:32
vlib_main_t
Definition:
main.h:59
nsim_main
nsim_main_t nsim_main
Definition:
nsim.c:59
nsim_main_t::buffer_indices_by_thread
u32 ** buffer_indices_by_thread
Definition:
nsim.h:60
error.h
nsim_main_t::delay
f64 delay
Definition:
nsim.h:63
nsim_wheel_t::wheel_size
u32 wheel_size
Definition:
nsim.h:41
nsim_main_t::output_next_index1
u32 output_next_index1
Definition:
nsim.h:56
src
plugins
nsim
nsim.h
Generated on Thu May 16 2019 14:25:36 for FD.io VPP by
1.8.11