FD.io VPP  v21.06-3-gbb25fbf28
Vector Packet Processing
gso.c
Go to the documentation of this file.
1 /*
2  * Copyright (c) 2019 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 <vlib/vlib.h>
17 #include <vnet/vnet.h>
18 #include <vppinfra/error.h>
19 #include <vnet/ethernet/ethernet.h>
20 #include <vnet/feature/feature.h>
22 #include <vnet/gso/gso.h>
23 
25 
26 int
28 {
29  vnet_feature_enable_disable ("ip4-output", "gso-ip4", sw_if_index, enable,
30  0, 0);
31  vnet_feature_enable_disable ("ip6-output", "gso-ip6", sw_if_index, enable,
32  0, 0);
33 
34  vnet_l2_feature_enable_disable ("l2-output-nonip", "gso-l2-nonip",
35  sw_if_index, enable, 0, 0);
36  vnet_l2_feature_enable_disable ("l2-output-ip4", "gso-l2-ip4",
37  sw_if_index, enable, 0, 0);
38  vnet_l2_feature_enable_disable ("l2-output-ip6", "gso-l2-ip6",
39  sw_if_index, enable, 0, 0);
40 
41  return (0);
42 }
43 
44 static clib_error_t *
46 {
48 
49  clib_memset (gm, 0, sizeof (gm[0]));
50  gm->vlib_main = vm;
51  gm->vnet_main = vnet_get_main ();
52 
53  return 0;
54 }
55 
57 
58 /*
59  * fd.io coding-style-patch-verification: ON
60  *
61  * Local Variables:
62  * eval: (c-set-style "gnu")
63  * End:
64  */
vlib.h
gso_init
static clib_error_t * gso_init(vlib_main_t *vm)
Definition: gso.c:45
vm
vlib_main_t * vm
X-connect all packets from the HOST to the PHY.
Definition: nat44_ei.c:3047
ethernet.h
error.h
feature.h
vnet_l2_feature_enable_disable
int vnet_l2_feature_enable_disable(const char *arc_name, const char *node_name, u32 sw_if_index, int enable_disable, void *feature_config, u32 n_feature_config_bytes)
Definition: l2_in_out_feat_arc.c:582
vnet_get_main
vnet_main_t * vnet_get_main(void)
Definition: pnat_test_stubs.h:56
vnet_sw_interface_gso_enable_disable
int vnet_sw_interface_gso_enable_disable(u32 sw_if_index, u8 enable)
Definition: gso.c:27
gso.h
gm
#define gm
Definition: dlmalloc.c:1219
u32
unsigned int u32
Definition: types.h:88
VLIB_INIT_FUNCTION
#define VLIB_INIT_FUNCTION(x)
Definition: init.h:172
gso_main
gso_main_t gso_main
Definition: gso.c:24
vnet_feature_enable_disable
int vnet_feature_enable_disable(const char *arc_name, const char *node_name, u32 sw_if_index, int enable_disable, void *feature_config, u32 n_feature_config_bytes)
Definition: pnat_test_stubs.h:50
clib_memset
clib_memset(h->entries, 0, sizeof(h->entries[0]) *entries)
vlib_main_t
Definition: main.h:102
u8
unsigned char u8
Definition: types.h:56
clib_error_t
Definition: clib_error.h:21
vlib_init_function_t
clib_error_t *() vlib_init_function_t(struct vlib_main_t *vm)
Definition: init.h:51
vnet.h
sw_if_index
vl_api_interface_index_t sw_if_index
Definition: wireguard.api:34
l2_in_out_feat_arc.h
gso_main_t
Definition: gso.h:21