diff options
author | John Lo <loj@cisco.com> | 2016-04-12 18:20:39 -0400 |
---|---|---|
committer | Gerrit Code Review <gerrit@fd.io> | 2016-04-14 23:06:54 +0000 |
commit | d1f5d047988655a001655357f1ce35152161bedf (patch) | |
tree | d2a3f442190a352e8ed8cbfab7fefbf58e994133 /vnet/vnet/l2/l2_input.c | |
parent | e10e372e5a7a1be385e77a8062a2573eb58b29d8 (diff) |
Change ARP and IP6-ND nodes to use interface-output node for output
The current mechanism for setting up arp-input and ip6-discover-neighbor
output nodes for interfaces using their interface link up/down callback
function is inefficient and has potential timing issue, as observed for
bonded interface. Now both nodes will setup output interface sw_if_index
in the the sw_if_index[VLIB_TX] field of current packet buffer and then
use the interface-ouput node to tx the packet.
One side effect is that vlib_node_add_next_with_slot() needs to be
modified to allow the same output node-id to be put at the specified
slot, even if another slot contain that same node-id already exist. This
requirement is caused by BVI support where all loopback interfaces set
up as BVIs will have the same output node-id being l2-input while, for
output-interface node, the output slot must match the hw_if_index of the
interface.
Change-Id: I18bd1d4fe9bea047018796f7b8a4d4c20ee31d6e
Signed-off-by: John Lo <loj@cisco.com>
Diffstat (limited to 'vnet/vnet/l2/l2_input.c')
-rw-r--r-- | vnet/vnet/l2/l2_input.c | 24 |
1 files changed, 9 insertions, 15 deletions
diff --git a/vnet/vnet/l2/l2_input.c b/vnet/vnet/l2/l2_input.c index a42fcae059b..3d3d51f54b4 100644 --- a/vnet/vnet/l2/l2_input.c +++ b/vnet/vnet/l2/l2_input.c @@ -35,14 +35,8 @@ #include <vppinfra/cache.h> extern clib_error_t * -ethernet_arp_hw_interface_link_up_down (vnet_main_t * vnm, - u32 hw_if_index, - u32 flags); - -extern clib_error_t * -ip6_discover_neighbor_hw_interface_link_up_down (vnet_main_t * vnm, - u32 hw_if_index, - u32 flags); +vnet_per_buffer_interface_output_hw_interface_add_del ( + vnet_main_t * vnm, u32 hw_if_index, u32 is_create); // Feature graph node names static char * l2input_feat_names[] = { @@ -567,9 +561,9 @@ u32 set_int_l2_mode (vlib_main_t * vm, mac = *((u64 *)hi->hw_address); l2fib_del_entry (mac, config->bd_index); - // Let ARP and NDP know that the output node index changed - ethernet_arp_hw_interface_link_up_down(vnet_main, hi->hw_if_index, 0); - ip6_discover_neighbor_hw_interface_link_up_down(vnet_main, hi->hw_if_index, 0); + // Let interface-output node know that the output node index changed + vnet_per_buffer_interface_output_hw_interface_add_del( + vnet_main, hi->hw_if_index, 0); } l2_if_adjust--; } else if (config->xconnect) { @@ -653,10 +647,10 @@ u32 set_int_l2_mode (vlib_main_t * vm, // Disable learning by default. no use since l2fib entry is static. config->feature_bitmap &= ~L2INPUT_FEAT_LEARN; - // Let ARP and NDP know that the output_index_node changed so they - // can send requests via BVI to BD - ethernet_arp_hw_interface_link_up_down(vnet_main, hi->hw_if_index, 0); - ip6_discover_neighbor_hw_interface_link_up_down(vnet_main, hi->hw_if_index, 0); + // Let interface-output node know that the output node index changed + // so output can be sent via BVI to BD + vnet_per_buffer_interface_output_hw_interface_add_del( + vnet_main, hi->hw_if_index, 0); } // Add interface to bridge-domain flood vector |