aboutsummaryrefslogtreecommitdiffstats
path: root/vnet/vnet/vxlan-gpe/decap.c
diff options
context:
space:
mode:
authorKeith Burns (alagalah) <alagalah@gmail.com>2016-08-25 11:21:39 -0700
committerKeith Burns (alagalah) <alagalah@gmail.com>2016-08-25 13:56:13 -0700
commitaa4338556edef0fc7ebf7afa52af4886b0532eb4 (patch)
tree4cba44ac8ea71609457c8046a1944f0aedcde904 /vnet/vnet/vxlan-gpe/decap.c
parent52ecf85946cbbcabc77d747c1f1ffd48768ef14e (diff)
VPP-307: Documentation for vnet/vnet/vxlan-gpe
Change-Id: Iaab6f4b63ed0d986be1ac0636c692b46098ad54d Signed-off-by: Keith Burns (alagalah) <alagalah@gmail.com>
Diffstat (limited to 'vnet/vnet/vxlan-gpe/decap.c')
-rw-r--r--vnet/vnet/vxlan-gpe/decap.c78
1 files changed, 74 insertions, 4 deletions
diff --git a/vnet/vnet/vxlan-gpe/decap.c b/vnet/vnet/vxlan-gpe/decap.c
index 7f32cbd8a49..3720837a333 100644
--- a/vnet/vnet/vxlan-gpe/decap.c
+++ b/vnet/vnet/vxlan-gpe/decap.c
@@ -14,6 +14,11 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
+/**
+ * @file
+ * @brief Functions for decapsulating VXLAN GPE tunnels
+ *
+*/
#include <vlib/vlib.h>
#include <vnet/pg/pg.h>
@@ -21,12 +26,25 @@
vlib_node_registration_t vxlan_gpe_input_node;
+/**
+ * @brief Struct for VXLAN GPE decap packet tracing
+ *
+ */
typedef struct {
u32 next_index;
u32 tunnel_index;
u32 error;
} vxlan_gpe_rx_trace_t;
+/**
+ * @brief Tracing function for VXLAN GPE packet decapsulation
+ *
+ * @param *s - u8 - format string
+ * @param *args - va_list - arguments to display
+ *
+ * @return *s u8 - formatted trace output
+ *
+ */
static u8 * format_vxlan_gpe_rx_trace (u8 * s, va_list * args)
{
CLIB_UNUSED (vlib_main_t * vm) = va_arg (*args, vlib_main_t *);
@@ -46,7 +64,15 @@ static u8 * format_vxlan_gpe_rx_trace (u8 * s, va_list * args)
return s;
}
-
+/**
+ * @brief Tracing function for VXLAN GPE packet decapsulation including length
+ *
+ * @param *s - u8 - format string
+ * @param *args - va_list - arguments to display
+ *
+ * @return *s u8 - formatted trace output
+ *
+ */
static u8 * format_vxlan_gpe_with_length (u8 * s, va_list * args)
{
CLIB_UNUSED (vlib_main_t * vm) = va_arg (*args, vlib_main_t *);
@@ -56,6 +82,25 @@ static u8 * format_vxlan_gpe_with_length (u8 * s, va_list * args)
return s;
}
+/**
+ * @brief Common processing for IPv4 and IPv6 VXLAN GPE decap dispatch functions
+ *
+ * It is worth noting that other than trivial UDP forwarding (transit), VXLAN GPE
+ * tunnels are "terminate local". This means that there is no "TX" interface for this
+ * decap case, so that field in the buffer_metadata can be "used for something else".
+ * The something else in this case is, for the IPv4/IPv6 inner-packet type case, the
+ * FIB index used to look up the inner-packet's adjacency.
+ *
+ * vnet_buffer(b0)->sw_if_index[VLIB_TX] = t0->decap_fib_index;
+ *
+ * @param *vm - vlib_main_t
+ * @param *node - vlib_node_runtime_t
+ * @param *from_frame - vlib_frame_t
+ * @param ip_ip4 - u8
+ *
+ * @return from_frame->n_vectors - uword
+ *
+ */
always_inline uword
vxlan_gpe_input (vlib_main_t * vm,
vlib_node_runtime_t * node,
@@ -250,7 +295,7 @@ vxlan_gpe_input (vlib_main_t * vm,
/* Required to make the l2 tag push / pop code work on l2 subifs */
vnet_update_l2_len (b0);
- /*
+ /**
* ip[46] lookup in the configured FIB
*/
vnet_buffer(b0)->sw_if_index[VLIB_TX] = t0->decap_fib_index;
@@ -545,6 +590,17 @@ vxlan_gpe_input (vlib_main_t * vm,
return from_frame->n_vectors;
}
+/**
+ * @brief Graph processing dispatch function for IPv4 VXLAN GPE
+ *
+ * @node vxlan4-gpe-input
+ * @param *vm - vlib_main_t
+ * @param *node - vlib_node_runtime_t
+ * @param *from_frame - vlib_frame_t
+ *
+ * @return from_frame->n_vectors - uword
+ *
+ */
static uword
vxlan4_gpe_input (vlib_main_t * vm, vlib_node_runtime_t * node,
vlib_frame_t * from_frame)
@@ -552,6 +608,17 @@ vxlan4_gpe_input (vlib_main_t * vm, vlib_node_runtime_t * node,
return vxlan_gpe_input (vm, node, from_frame, /* is_ip4 */1);
}
+/**
+ * @brief Graph processing dispatch function for IPv6 VXLAN GPE
+ *
+ * @node vxlan6-gpe-input
+ * @param *vm - vlib_main_t
+ * @param *node - vlib_node_runtime_t
+ * @param *from_frame - vlib_frame_t
+ *
+ * @return from_frame->n_vectors - uword
+ *
+ */
static uword
vxlan6_gpe_input (vlib_main_t * vm, vlib_node_runtime_t * node,
vlib_frame_t * from_frame)
@@ -559,6 +626,9 @@ vxlan6_gpe_input (vlib_main_t * vm, vlib_node_runtime_t * node,
return vxlan_gpe_input (vm, node, from_frame, /* is_ip4 */0);
}
+/**
+ * @brief VXLAN GPE error strings
+ */
static char * vxlan_gpe_error_strings[] = {
#define vxlan_gpe_error(n,s) s,
#include <vnet/vxlan-gpe/vxlan_gpe_error.def>
@@ -587,7 +657,7 @@ VLIB_REGISTER_NODE (vxlan4_gpe_input_node) = {
// $$$$ .unformat_buffer = unformat_vxlan_gpe_header,
};
-VLIB_NODE_FUNCTION_MULTIARCH (vxlan4_gpe_input_node, vxlan4_gpe_input)
+VLIB_NODE_FUNCTION_MULTIARCH (vxlan4_gpe_input_node, vxlan4_gpe_input);
VLIB_REGISTER_NODE (vxlan6_gpe_input_node) = {
.function = vxlan6_gpe_input,
@@ -610,4 +680,4 @@ VLIB_REGISTER_NODE (vxlan6_gpe_input_node) = {
// $$$$ .unformat_buffer = unformat_vxlan_gpe_header,
};
-VLIB_NODE_FUNCTION_MULTIARCH (vxlan6_gpe_input_node, vxlan6_gpe_input)
+VLIB_NODE_FUNCTION_MULTIARCH (vxlan6_gpe_input_node, vxlan6_gpe_input);