aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorHongjun Ni <hongjun.ni@intel.com>2017-08-27 14:58:24 +0800
committerHongjun Ni <hongjun.ni@intel.com>2017-08-27 07:11:35 +0000
commit9b3c3af8bee2f7c055a7d89d95fbbc577fb0739d (patch)
treeca739650b71869159f447f670be14c295607fda3
parentfa9f5a2c9f4808ea10b978d6a36c468731798343 (diff)
NSH Plugin crashes VPP. NSHSFC-34
Change-Id: If7a3c3ebbbdc00a4ad351a056ebaacf9a9c237be Signed-off-by: Hongjun Ni <hongjun.ni@intel.com>
-rw-r--r--nsh-plugin/nsh/nsh.h6
-rw-r--r--nsh-plugin/nsh/nsh_output.c24
2 files changed, 29 insertions, 1 deletions
diff --git a/nsh-plugin/nsh/nsh.h b/nsh-plugin/nsh/nsh.h
index ea4e192..8605fc7 100644
--- a/nsh-plugin/nsh/nsh.h
+++ b/nsh-plugin/nsh/nsh.h
@@ -255,4 +255,10 @@ nsh_md2_register_option (u16 class,
nsh_tlv_header_t * opt),
u8 * trace (u8 * s,
nsh_tlv_header_t * opt));
+
+typedef struct _nsh_main_dummy
+{
+ u8 output_feature_arc_index;
+} nsh_main_dummy_t;
+
#endif /* included_nsh_h */
diff --git a/nsh-plugin/nsh/nsh_output.c b/nsh-plugin/nsh/nsh_output.c
index c104ee7..5671463 100644
--- a/nsh-plugin/nsh/nsh_output.c
+++ b/nsh-plugin/nsh/nsh_output.c
@@ -315,6 +315,10 @@ nsh_output_inline (vlib_main_t * vm,
return from_frame->n_vectors;
}
+typedef enum nsh_midchain_next_t_
+{
+ NSH_MIDCHAIN_NEXT_DROP,
+} nsh_midchain_next_t;
static inline uword
nsh_eth_output (vlib_main_t * vm,
@@ -354,7 +358,10 @@ VLIB_REGISTER_NODE (nsh_midchain_node) = {
.name = "nsh-midchain",
.vector_size = sizeof (u32),
.format_trace = format_nsh_output_trace,
- .sibling_of = "nsh-eth-output",
+ .n_next_nodes = 1,
+ .next_nodes = {
+ [NSH_MIDCHAIN_NEXT_DROP] = "error-drop",
+ },
};
VLIB_NODE_FUNCTION_MULTIARCH (nsh_midchain_node, nsh_midchain)
@@ -366,6 +373,21 @@ VNET_FEATURE_INIT (nsh_interface_output, static) = {
.runs_before = 0, /* not before any other features */
};
+/* Built-in ip4 tx feature path definition */
+/* *INDENT-OFF* */
+VNET_FEATURE_ARC_INIT (nsh_eth_output, static) =
+{
+ .arc_name = "nsh-eth-output",
+ .start_nodes = VNET_FEATURES ("nsh-midchain"),
+};
+
+VNET_FEATURE_INIT (nsh_eth_tx_drop, static) =
+{
+ .arc_name = "nsh-eth-output",
+ .node_name = "error-drop",
+ .runs_before = 0, /* not before any other features */
+};
+/* *INDENT-ON* */
/**
* @brief Next index values from the NSH incomplete adj node
*/