FD.io VPP  v21.10.1-2-g0a485f517
Vector Packet Processing
gbp_learn.c
Go to the documentation of this file.
1 /*
2  * Copyright (c) 2018 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 <plugins/gbp/gbp.h>
17 #include <plugins/gbp/gbp_learn.h>
19 
20 #include <vnet/l2/l2_input.h>
21 
23 
24 void
26 {
27  vnet_feature_enable_disable ("ip4-unicast",
28  "gbp-learn-ip4", sw_if_index, 1, 0, 0);
29  vnet_feature_enable_disable ("ip6-unicast",
30  "gbp-learn-ip6", sw_if_index, 1, 0, 0);
31 }
32 
33 void
35 {
36  vnet_feature_enable_disable ("ip4-unicast",
37  "gbp-learn-ip4", sw_if_index, 0, 0, 0);
38  vnet_feature_enable_disable ("ip6-unicast",
39  "gbp-learn-ip6", sw_if_index, 0, 0, 0);
40 }
41 
42 static clib_error_t *
44 {
47 
48  vlib_node_t *node = vlib_get_node_by_name (vm, (u8 *) "gbp-learn-l2");
49 
50  /* Initialize the feature next-node indices */
52  node->index,
56 
59 
62 
63  glm->gl_logger = vlib_log_register_class ("gbp", "learn");
64 
65  return 0;
66 }
67 
69 
70 /*
71  * fd.io coding-style-patch-verification: ON
72  *
73  * Local Variables:
74  * eval: (c-set-style "gnu")
75  * End:
76  */
gbp_learn.h
throttle_init
void throttle_init(throttle_t *t, u32 n_threads, f64 time)
Definition: throttle.c:19
gbp_learn_disable
void gbp_learn_disable(u32 sw_if_index)
Definition: gbp_learn.c:34
gbp_learn_main_t_
Grouping of global data for the GBP source EPG classification feature.
Definition: gbp_learn.h:31
GBP_ENDPOINT_HASH_LEARN_RATE
#define GBP_ENDPOINT_HASH_LEARN_RATE
The maximum learning rate per-hashed EP.
Definition: gbp_learn.h:26
vlib_log_register_class
vlib_log_class_t vlib_log_register_class(char *class, char *subclass)
Definition: log.c:339
node
vlib_main_t vlib_node_runtime_t * node
Definition: nat44_ei.c:3047
gbp.h
vm
vlib_main_t * vm
X-connect all packets from the HOST to the PHY.
Definition: nat44_ei.c:3047
vlib_thread_main_t::n_vlib_mains
u32 n_vlib_mains
Definition: threads.h:262
gbp_learn_init
static clib_error_t * gbp_learn_init(vlib_main_t *vm)
Definition: gbp_learn.c:43
vlib_thread_main
vlib_thread_main_t vlib_thread_main
Definition: threads.c:36
l2input_get_feat_names
char ** l2input_get_feat_names(void)
Return an array of strings containing graph node names of each feature.
Definition: l2_input.c:59
gbp_learn_main
gbp_learn_main_t gbp_learn_main
Definition: gbp_learn.c:22
gbp_learn_main_t_::gl_logger
vlib_log_class_t gl_logger
logger - VLIB log class
Definition: gbp_learn.h:41
L2INPUT_N_FEAT
@ L2INPUT_N_FEAT
Definition: l2_input.h:165
gbp_bridge_domain.h
l2_input.h
vlib_get_node_by_name
vlib_node_t * vlib_get_node_by_name(vlib_main_t *vm, u8 *name)
Definition: node.c:45
u32
unsigned int u32
Definition: types.h:88
VLIB_INIT_FUNCTION
#define VLIB_INIT_FUNCTION(x)
Definition: init.h:172
vlib_thread_main_t
Definition: threads.h:243
gbp_learn_main_t_::gl_l3_throttle
throttle_t gl_l3_throttle
Definition: gbp_learn.h:47
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
vlib_main_t
Definition: main.h:102
vlib_node_t
Definition: node.h:247
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
gbp_learn_enable
void gbp_learn_enable(u32 sw_if_index)
Definition: gbp_learn.c:25
gbp_learn_main_t_::gl_l2_input_feat_next
u32 gl_l2_input_feat_next[32]
Next nodes for L2 output features.
Definition: gbp_learn.h:36
sw_if_index
vl_api_interface_index_t sw_if_index
Definition: wireguard.api:34
feat_bitmap_init_next_nodes
static void feat_bitmap_init_next_nodes(vlib_main_t *vm, u32 node_index, u32 num_features, char **feat_names, u32 *next_nodes)
Initialize the feature next-node indexes of a graph node.
Definition: feat_bitmap.h:43
gbp_learn_main_t_::gl_l2_throttle
throttle_t gl_l2_throttle
throttles for the DP leanring
Definition: gbp_learn.h:46