aboutsummaryrefslogtreecommitdiffstats
path: root/src/vnet/adj
diff options
context:
space:
mode:
authorAkshayaNadahalli <anadahal@cisco.com>2017-03-27 14:47:41 +0530
committerNeale Ranns <nranns@cisco.com>2017-03-27 12:54:19 +0000
commit17f5f6097a1a613aceaa27912d6afb7f9249eaa2 (patch)
tree196d7679f81885f198751eb1659bdb272407ac91 /src/vnet/adj
parent9f81d4fe5cfab856e23926bfdb11c03c04838478 (diff)
Fix output feature processing (VPP-670)
Change-Id: Ia9bab28fb5341712a7d984bb343074ca22d05aab Signed-off-by: AkshayaNadahalli <anadahal@cisco.com>
Diffstat (limited to 'src/vnet/adj')
-rw-r--r--src/vnet/adj/adj_nbr.c42
1 files changed, 42 insertions, 0 deletions
diff --git a/src/vnet/adj/adj_nbr.c b/src/vnet/adj/adj_nbr.c
index 9ef3651de66..61b5c83053b 100644
--- a/src/vnet/adj/adj_nbr.c
+++ b/src/vnet/adj/adj_nbr.c
@@ -132,6 +132,47 @@ adj_get_nd_node (fib_protocol_t proto)
return (ip4_arp_node.index);
}
+/**
+ * @brief Check and set feature flags if o/p interface has any o/p features.
+ */
+static void
+adj_nbr_evaluate_feature (adj_index_t ai)
+{
+ ip_adjacency_t *adj;
+ vnet_feature_main_t *fm = &feature_main;
+ i16 feature_count;
+ u8 arc_index;
+ u32 sw_if_index;
+
+ adj = adj_get(ai);
+
+ switch (adj->ia_link)
+ {
+ case VNET_LINK_IP4:
+ arc_index = ip4_main.lookup_main.output_feature_arc_index;
+ break;
+ case VNET_LINK_IP6:
+ arc_index = ip6_main.lookup_main.output_feature_arc_index;
+ break;
+ case VNET_LINK_MPLS:
+ arc_index = mpls_main.output_feature_arc_index;
+ break;
+ default:
+ return;
+ }
+
+ sw_if_index = adj->rewrite_header.sw_if_index;
+ vec_validate (fm->feature_count_by_sw_if_index[arc_index], sw_if_index);
+ feature_count = fm->feature_count_by_sw_if_index[arc_index][sw_if_index];
+
+ if (feature_count > 0)
+ adj->rewrite_header.flags |= VNET_REWRITE_HAS_FEATURES;
+ else
+ adj->rewrite_header.flags &= ~VNET_REWRITE_HAS_FEATURES;
+
+ return;
+}
+
static ip_adjacency_t*
adj_nbr_alloc (fib_protocol_t nh_proto,
vnet_link_t link_type,
@@ -158,6 +199,7 @@ adj_nbr_alloc (fib_protocol_t nh_proto,
memset(&adj->sub_type.midchain.next_dpo, 0,
sizeof(adj->sub_type.midchain.next_dpo));
+ adj_nbr_evaluate_feature (adj_get_index(adj));
return (adj);
}
/* Literal.Number.Float */ .highlight .mh { color: #0000DD; font-weight: bold } /* Literal.Number.Hex */ .highlight .mi { color: #0000DD; font-weight: bold } /* Literal.Number.Integer */ .highlight .mo { color: #0000DD; font-weight: bold } /* Literal.Number.Oct */ .highlight .sa { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Affix */ .highlight .sb { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Backtick */ .highlight .sc { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Char */ .highlight .dl { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Delimiter */ .highlight .sd { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Doc */ .highlight .s2 { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Double */ .highlight .se { color: #0044dd; background-color: #fff0f0 } /* Literal.String.Escape */ .highlight .sh { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Heredoc */ .highlight .si { color: #3333bb; background-color: #fff0f0 } /* Literal.String.Interpol */ .highlight .sx { color: #22bb22; background-color: #f0fff0 } /* Literal.String.Other */ .highlight .sr { color: #008800; background-color: #fff0ff } /* Literal.String.Regex */ .highlight .s1 { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Single */ .highlight .ss { color: #aa6600; background-color: #fff0f0 } /* Literal.String.Symbol */ .highlight .bp { color: #003388 } /* Name.Builtin.Pseudo */ .highlight .fm { color: #0066bb; font-weight: bold } /* Name.Function.Magic */ .highlight .vc { color: #336699 } /* Name.Variable.Class */ .highlight .vg { color: #dd7700 } /* Name.Variable.Global */ .highlight .vi { color: #3333bb } /* Name.Variable.Instance */ .highlight .vm { color: #336699 } /* Name.Variable.Magic */ .highlight .il { color: #0000DD; font-weight: bold } /* Literal.Number.Integer.Long */ }
User Documentation    {#user_doc}
==================

Several modules provide operational, dataplane-user focused documentation.

- [GUI guided user demo](https://wiki.fd.io/view/VPP_Sandbox/vpp-userdemo)
- @subpage avf_plugin_doc
- @subpage bfd_doc
- @subpage dpdk_crypto_ipsec_doc
- @subpage flowprobe_plugin_doc
- @subpage ioam_plugin_doc
- @subpage ipsec_gre_doc
- @subpage kp_plugin_doc
- @subpage lacp_plugin_doc
- @subpage lb_plugin_doc
- @subpage lldp_doc
- @subpage map_doc
- @subpage marvel_plugin_doc
- @subpage nat64_doc
- @subpage qos_doc
- @subpage selinux_doc
- @subpage span_doc
- @subpage srmpls_doc
- @subpage srv6_doc
- @subpage vcl_ldpreload_doc