nsh: fix load failure 14/17914/3
authorFilip Tehlar <ftehlar@cisco.com>
Wed, 27 Feb 2019 16:44:26 +0000 (08:44 -0800)
committerDamjan Marion <dmarion@me.com>
Fri, 1 Mar 2019 20:27:40 +0000 (20:27 +0000)
Change-Id: I687ddba41bc80e2fbb39ebc30449ced7254e45f8
Signed-off-by: Filip Tehlar <ftehlar@cisco.com>
src/plugins/nsh/nsh.c
src/plugins/nsh/nsh_api.c
src/plugins/nsh/nsh_node.c
src/plugins/nsh/nsh_output.c
src/plugins/nsh/nsh_pop.c

index 446314c..d18cede 100644 (file)
@@ -147,61 +147,6 @@ nsh_md2_unregister_option (u16 class,
   return (0);
 }
 
-/**
- * @brief Naming for NSH tunnel
- *
- * @param *s formatting string
- * @param *args
- *
- * @return *s formatted string
- *
- */
-static u8 *
-format_nsh_name (u8 * s, va_list * args)
-{
-  u32 dev_instance = va_arg (*args, u32);
-  return format (s, "nsh_tunnel%d", dev_instance);
-}
-
-/**
- * @brief CLI function for NSH admin up/down
- *
- * @param *vnm
- * @param nsh_hw_if
- * @param flag
- *
- * @return *rc
- *
- */
-static clib_error_t *
-nsh_interface_admin_up_down (vnet_main_t * vnm, u32 nsh_hw_if, u32 flags)
-{
-  if (flags & VNET_SW_INTERFACE_FLAG_ADMIN_UP)
-    vnet_hw_interface_set_flags (vnm, nsh_hw_if,
-                                VNET_HW_INTERFACE_FLAG_LINK_UP);
-  else
-    vnet_hw_interface_set_flags (vnm, nsh_hw_if, 0);
-
-  return 0;
-}
-
-static uword
-dummy_interface_tx (vlib_main_t * vm,
-                   vlib_node_runtime_t * node, vlib_frame_t * frame)
-{
-  clib_warning ("you shouldn't be here, leaking buffers...");
-  return frame->n_vectors;
-}
-
-/* *INDENT-OFF* */
-VNET_DEVICE_CLASS (nsh_device_class, static) = {
-  .name = "NSH",
-  .format_device_name = format_nsh_name,
-  .tx_function = dummy_interface_tx,
-  .admin_up_down_function = nsh_interface_admin_up_down,
-};
-/* *INDENT-ON* */
-
 /**
  * @brief Formatting function for tracing VXLAN GPE with length
  *
index 72ca2d2..ccae554 100644 (file)
@@ -104,6 +104,61 @@ typedef enum
   _(NSH_ADD_DEL_MAP, nsh_add_del_map)           \
   _(NSH_MAP_DUMP, nsh_map_dump)
 
+/**
+ * @brief CLI function for NSH admin up/down
+ *
+ * @param *vnm
+ * @param nsh_hw_if
+ * @param flag
+ *
+ * @return *rc
+ *
+ */
+static clib_error_t *
+nsh_interface_admin_up_down (vnet_main_t * vnm, u32 nsh_hw_if, u32 flags)
+{
+  if (flags & VNET_SW_INTERFACE_FLAG_ADMIN_UP)
+    vnet_hw_interface_set_flags (vnm, nsh_hw_if,
+                                VNET_HW_INTERFACE_FLAG_LINK_UP);
+  else
+    vnet_hw_interface_set_flags (vnm, nsh_hw_if, 0);
+
+  return 0;
+}
+
+static uword
+dummy_interface_tx (vlib_main_t * vm,
+                   vlib_node_runtime_t * node, vlib_frame_t * frame)
+{
+  clib_warning ("you shouldn't be here, leaking buffers...");
+  return frame->n_vectors;
+}
+
+/**
+ * @brief Naming for NSH tunnel
+ *
+ * @param *s formatting string
+ * @param *args
+ *
+ * @return *s formatted string
+ *
+ */
+static u8 *
+format_nsh_name (u8 * s, va_list * args)
+{
+  u32 dev_instance = va_arg (*args, u32);
+  return format (s, "nsh_tunnel%d", dev_instance);
+}
+
+/* *INDENT-OFF* */
+VNET_DEVICE_CLASS (nsh_device_class, static) = {
+  .name = "NSH",
+  .format_device_name = format_nsh_name,
+  .tx_function = dummy_interface_tx,
+  .admin_up_down_function = nsh_interface_admin_up_down,
+};
+/* *INDENT-ON* */
+
 static void send_nsh_entry_details
   (nsh_entry_t * t, unix_shared_memory_queue_t * q, u32 context)
 {
@@ -329,7 +384,6 @@ nsh_header_rewrite (nsh_entry_t * nsh_entry)
   return 0;
 }
 
-extern vnet_device_class_t nsh_device_class;
 extern vnet_hw_interface_class_t nsh_hw_class;
 
 /**
index 5e2af68..d658068 100644 (file)
@@ -835,8 +835,8 @@ nsh_input_map (vlib_main_t * vm,
  * @return from_frame->n_vectors
  *
  */
-VLIB_NODE_FN (nsh_input) (vlib_main_t * vm, vlib_node_runtime_t * node,
-                         vlib_frame_t * from_frame)
+VLIB_NODE_FN (nsh_input_node) (vlib_main_t * vm, vlib_node_runtime_t * node,
+                              vlib_frame_t * from_frame)
 {
   return nsh_input_map (vm, node, from_frame, NSH_INPUT_TYPE);
 }
@@ -852,8 +852,8 @@ VLIB_NODE_FN (nsh_input) (vlib_main_t * vm, vlib_node_runtime_t * node,
  * @return from_frame->n_vectors
  *
  */
-VLIB_NODE_FN (nsh_proxy) (vlib_main_t * vm, vlib_node_runtime_t * node,
-                         vlib_frame_t * from_frame)
+VLIB_NODE_FN (nsh_proxy_node) (vlib_main_t * vm, vlib_node_runtime_t * node,
+                              vlib_frame_t * from_frame)
 {
   return nsh_input_map (vm, node, from_frame, NSH_PROXY_TYPE);
 }
@@ -869,8 +869,9 @@ VLIB_NODE_FN (nsh_proxy) (vlib_main_t * vm, vlib_node_runtime_t * node,
  * @return from_frame->n_vectors
  *
  */
-VLIB_NODE_FN (nsh_classifier) (vlib_main_t * vm, vlib_node_runtime_t * node,
-                              vlib_frame_t * from_frame)
+VLIB_NODE_FN (nsh_classifier_node) (vlib_main_t * vm,
+                                   vlib_node_runtime_t * node,
+                                   vlib_frame_t * from_frame)
 {
   return nsh_input_map (vm, node, from_frame, NSH_CLASSIFIER_TYPE);
 }
@@ -886,9 +887,9 @@ VLIB_NODE_FN (nsh_classifier) (vlib_main_t * vm, vlib_node_runtime_t * node,
  * @return from_frame->n_vectors
  *
  */
-VLIB_NODE_FN (nsh_aware_vnf_proxy) (vlib_main_t * vm,
-                                   vlib_node_runtime_t * node,
-                                   vlib_frame_t * from_frame)
+VLIB_NODE_FN (nsh_aware_vnf_proxy_node) (vlib_main_t * vm,
+                                        vlib_node_runtime_t * node,
+                                        vlib_frame_t * from_frame)
 {
   return nsh_input_map (vm, node, from_frame, NSH_AWARE_VNF_PROXY_TYPE);
 }
index 047fe8a..89b4bae 100644 (file)
@@ -323,7 +323,7 @@ typedef enum nsh_midchain_next_t_
     NSH_MIDCHAIN_NEXT_DROP,
 } nsh_midchain_next_t;
 
-VLIB_NODE_FN (nsh_eth_output) (vlib_main_t * vm,
+VLIB_NODE_FN (nsh_eth_output_node) (vlib_main_t * vm,
                 vlib_node_runtime_t * node,
                 vlib_frame_t * from_frame)
 {
@@ -344,7 +344,7 @@ VLIB_REGISTER_NODE (nsh_eth_output_node) = {
   .format_trace = format_nsh_output_trace,
 };
 
-VLIB_NODE_FN (nsh_midchain) (vlib_main_t * vm,
+VLIB_NODE_FN (nsh_midchain_node) (vlib_main_t * vm,
                vlib_node_runtime_t * node,
                vlib_frame_t * from_frame)
 {
@@ -415,7 +415,7 @@ typedef struct nsh_adj_incomplete_trace_t_
  * We pay a cost for this 'routing' node, but an incomplete adj is the
  * exception case.
  */
-VLIB_NODE_FN (nsh_adj_incomplete) (vlib_main_t * vm,
+VLIB_NODE_FN (nsh_adj_incomplete_node) (vlib_main_t * vm,
                      vlib_node_runtime_t * node,
                      vlib_frame_t * from_frame)
 {
index 15d50fd..188c513 100644 (file)
@@ -314,7 +314,7 @@ nsh_pop_inline (vlib_main_t * vm,
  * @return from_frame->n_vectors
  *
  */
-VLIB_NODE_FN (nsh_pop) (vlib_main_t * vm, vlib_node_runtime_t * node,
+VLIB_NODE_FN (nsh_pop_node) (vlib_main_t * vm, vlib_node_runtime_t * node,
                   vlib_frame_t * from_frame)
 {
   return nsh_pop_inline (vm, node, from_frame);