FD.io VPP
v17.01.1-3-gc6833f8
Vector Packet Processing
Main Page
Related Pages
Data Structures
Source
Files
Symbols
devices.c
Go to the documentation of this file.
1
/*
2
* Copyright (c) 2015 Cisco and/or its affiliates.
3
* Licensed under the Apache License, Version 2.0 (the "License");
4
* you may not use this file except in compliance with the License.
5
* You may obtain a copy of the License at:
6
*
7
* http://www.apache.org/licenses/LICENSE-2.0
8
*
9
* Unless required by applicable law or agreed to in writing, software
10
* distributed under the License is distributed on an "AS IS" BASIS,
11
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12
* See the License for the specific language governing permissions and
13
* limitations under the License.
14
*/
15
16
#include <
vnet/vnet.h
>
17
#include <
vnet/devices/devices.h
>
18
#include <
vnet/feature/feature.h
>
19
#include <
vnet/ip/ip.h
>
20
#include <
vnet/ethernet/ethernet.h
>
21
22
static
uword
23
device_input_fn
(
vlib_main_t
* vm,
vlib_node_runtime_t
* node,
24
vlib_frame_t
* frame)
25
{
26
return
0;
27
}
28
29
/* *INDENT-OFF* */
30
VLIB_REGISTER_NODE
(
device_input_node
) = {
31
.function =
device_input_fn
,
32
.name =
"device-input"
,
33
.type =
VLIB_NODE_TYPE_INPUT
,
34
.state = VLIB_NODE_STATE_DISABLED,
35
.n_next_nodes =
VNET_DEVICE_INPUT_N_NEXT_NODES
,
36
.next_nodes =
VNET_DEVICE_INPUT_NEXT_NODES
,
37
};
38
39
/* Table defines how much we need to advance current data pointer
40
in the buffer if we shortcut to l3 nodes */
41
42
const
u32
__attribute__((aligned (
CLIB_CACHE_LINE_BYTES
)))
43
device_input_next_node_advance
[((
VNET_DEVICE_INPUT_N_NEXT_NODES
/
44
CLIB_CACHE_LINE_BYTES
) +1) *
CLIB_CACHE_LINE_BYTES
] =
45
{
46
[
VNET_DEVICE_INPUT_NEXT_IP4_INPUT
] =
sizeof
(
ethernet_header_t
),
47
[
VNET_DEVICE_INPUT_NEXT_IP4_NCS_INPUT
] =
sizeof
(
ethernet_header_t
),
48
[
VNET_DEVICE_INPUT_NEXT_IP6_INPUT
] =
sizeof
(
ethernet_header_t
),
49
[
VNET_DEVICE_INPUT_NEXT_MPLS_INPUT
] =
sizeof
(
ethernet_header_t
),
50
};
51
52
VNET_FEATURE_ARC_INIT
(device_input,
static
) =
53
{
54
.arc_name =
"device-input"
,
55
.start_nodes =
VNET_FEATURES
(
"device-input"
),
56
.end_node =
"ethernet-input"
,
57
.arc_index_ptr = &
feature_main
.
device_input_feature_arc_index
,
58
};
59
60
VNET_FEATURE_INIT
(l2_patch,
static
) = {
61
.arc_name =
"device-input"
,
62
.node_name =
"l2-patch"
,
63
.runs_before =
VNET_FEATURES
(
"ethernet-input"
),
64
};
65
66
VNET_FEATURE_INIT
(worker_handoff,
static
) = {
67
.arc_name =
"device-input"
,
68
.node_name =
"worker-handoff"
,
69
.runs_before =
VNET_FEATURES
(
"ethernet-input"
),
70
};
71
72
VNET_FEATURE_INIT
(span_input,
static
) = {
73
.arc_name =
"device-input"
,
74
.node_name =
"span-input"
,
75
.runs_before =
VNET_FEATURES
(
"ethernet-input"
),
76
};
77
78
VNET_FEATURE_INIT
(
ethernet_input
,
static
) = {
79
.arc_name =
"device-input"
,
80
.node_name =
"ethernet-input"
,
81
.runs_before = 0,
/* not before any other features */
82
};
83
/* *INDENT-ON* */
84
85
/*
86
* fd.io coding-style-patch-verification: ON
87
*
88
* Local Variables:
89
* eval: (c-set-style "gnu")
90
* End:
91
*/
ip.h
vlib_frame_t
Definition:
node.h:332
VNET_DEVICE_INPUT_NEXT_IP6_INPUT
Definition:
devices.h:26
VNET_DEVICE_INPUT_NEXT_IP4_INPUT
Definition:
devices.h:25
vlib_node_runtime_t
Definition:
node.h:412
device_input_fn
static uword device_input_fn(vlib_main_t *vm, vlib_node_runtime_t *node, vlib_frame_t *frame)
Definition:
devices.c:23
devices.h
VLIB_NODE_TYPE_INPUT
Definition:
node.h:65
ethernet.h
device_input_next_node_advance
const u32 device_input_next_node_advance[((VNET_DEVICE_INPUT_N_NEXT_NODES/CLIB_CACHE_LINE_BYTES)+1)*CLIB_CACHE_LINE_BYTES]
Definition:
devices.c:44
VNET_DEVICE_INPUT_NEXT_NODES
#define VNET_DEVICE_INPUT_NEXT_NODES
Definition:
devices.h:33
feature.h
vnet.h
ethernet_input
static uword ethernet_input(vlib_main_t *vm, vlib_node_runtime_t *node, vlib_frame_t *from_frame)
Definition:
node.c:734
ethernet_header_t
Definition:
packet.h:50
VNET_DEVICE_INPUT_NEXT_MPLS_INPUT
Definition:
devices.h:27
u32
unsigned int u32
Definition:
types.h:88
VNET_FEATURES
#define VNET_FEATURES(...)
Definition:
feature.h:363
uword
u64 uword
Definition:
types.h:112
vnet_feature_main_t::device_input_feature_arc_index
u8 device_input_feature_arc_index
Feature arc index for device-input.
Definition:
feature.h:95
VNET_DEVICE_INPUT_NEXT_IP4_NCS_INPUT
Definition:
devices.h:24
VNET_FEATURE_INIT
VNET_FEATURE_INIT(l2_patch, static)
VNET_DEVICE_INPUT_N_NEXT_NODES
Definition:
devices.h:30
vlib_main_t
Definition:
main.h:59
VNET_FEATURE_ARC_INIT
VNET_FEATURE_ARC_INIT(device_input, static)
VLIB_REGISTER_NODE
#define VLIB_REGISTER_NODE(x,...)
Definition:
node.h:143
CLIB_CACHE_LINE_BYTES
#define CLIB_CACHE_LINE_BYTES
Definition:
cache.h:67
feature_main
vnet_feature_main_t feature_main
Definition:
feature.c:18
device_input_node
vlib_node_registration_t device_input_node
(constructor) VLIB_REGISTER_NODE (device_input_node)
Definition:
devices.c:30
vnet
vnet
devices
devices.c
Generated on Mon May 15 2017 22:01:54 for FD.io VPP by
1.8.11