diff options
author | Steven Luong <sluong@cisco.com> | 2022-10-24 09:10:59 -0700 |
---|---|---|
committer | Dave Wallace <dwallacelf@gmail.com> | 2023-01-19 21:37:25 +0000 |
commit | 8bd4db5996ba1144f659ea5341f1c2727c650bcd (patch) | |
tree | 05ebf7985499bf10b842faf68af2c1d4a5d7c138 /src/plugins/nsh | |
parent | dd2eff6d060c787e4a49863c9b97bde7215f7740 (diff) |
vxlan: convert vxlan to a plugin
per https://jira.fd.io/browse/VPP-2058
Type: improvement
Signed-off-by: Steven Luong <sluong@cisco.com>
Change-Id: Ica0828de218d25ada2d0d1491e373c3b78179ac1
Diffstat (limited to 'src/plugins/nsh')
-rw-r--r-- | src/plugins/nsh/FEATURE.yaml | 1 | ||||
-rw-r--r-- | src/plugins/nsh/nsh.c | 16 | ||||
-rw-r--r-- | src/plugins/nsh/nsh_pop.c | 1 |
3 files changed, 14 insertions, 4 deletions
diff --git a/src/plugins/nsh/FEATURE.yaml b/src/plugins/nsh/FEATURE.yaml index a6ef3749952..986008e41a5 100644 --- a/src/plugins/nsh/FEATURE.yaml +++ b/src/plugins/nsh/FEATURE.yaml @@ -8,6 +8,7 @@ features: - NSH Proxy - NSH OAM - NSH Metadata + - Requires vxlan_plugin.so to run description: "NSH for SFC" state: production diff --git a/src/plugins/nsh/nsh.c b/src/plugins/nsh/nsh.c index ea084e4a553..391fa8dbac5 100644 --- a/src/plugins/nsh/nsh.c +++ b/src/plugins/nsh/nsh.c @@ -19,7 +19,7 @@ #include <vnet/plugin/plugin.h> #include <nsh/nsh.h> #include <vnet/gre/gre.h> -#include <vnet/vxlan/vxlan.h> +#include <vxlan/vxlan.h> #include <vnet/vxlan-gpe/vxlan_gpe.h> #include <vnet/l2/l2_classify.h> #include <vnet/adj/adj.h> @@ -188,6 +188,7 @@ nsh_init (vlib_main_t * vm) nsh_main_t *nm = &nsh_main; clib_error_t *error = 0; uword next_node; + vlib_node_registration_t *vxlan4_input, *vxlan6_input; /* Init the main structures from VPP */ nm->vlib_main = vm; @@ -250,8 +251,17 @@ nsh_init (vlib_main_t * vm) nsh_aware_vnf_proxy_node.index); /* Add NSH-Proxy support */ - vlib_node_add_next (vm, vxlan4_input_node.index, nm->nsh_proxy_node_index); - vlib_node_add_next (vm, vxlan6_input_node.index, nm->nsh_proxy_node_index); + vxlan4_input = + vlib_get_plugin_symbol ("vxlan_plugin.so", "vxlan4_input_node"); + vxlan6_input = + vlib_get_plugin_symbol ("vxlan_plugin.so", "vxlan6_input_node"); + if (vxlan4_input == 0 || vxlan6_input == 0) + { + error = clib_error_return (0, "vxlan_plugin.so is not loaded"); + return error; + } + vlib_node_add_next (vm, vxlan4_input->index, nm->nsh_proxy_node_index); + vlib_node_add_next (vm, vxlan6_input->index, nm->nsh_proxy_node_index); /* Add NSH-Classifier support */ vlib_node_add_next (vm, ip4_classify_node.index, diff --git a/src/plugins/nsh/nsh_pop.c b/src/plugins/nsh/nsh_pop.c index 90b8a73b5fb..8de319e158b 100644 --- a/src/plugins/nsh/nsh_pop.c +++ b/src/plugins/nsh/nsh_pop.c @@ -19,7 +19,6 @@ #include <vnet/plugin/plugin.h> #include <nsh/nsh.h> #include <vnet/gre/packet.h> -#include <vnet/vxlan/vxlan.h> #include <vnet/vxlan-gpe/vxlan_gpe.h> #include <vnet/l2/l2_classify.h> |