aboutsummaryrefslogtreecommitdiffstats
path: root/vnet/vnet/l2/l2_bvi.h
diff options
context:
space:
mode:
authorJohn Lo <loj@cisco.com>2016-04-23 15:14:12 -0400
committerDave Barach <openvpp@barachs.net>2016-04-25 12:58:41 +0000
commit405e41b50e336dccfdeeafae93bf4453774ecfec (patch)
tree021e77ef0458f1b2e814655d1d64a0b5b08f7613 /vnet/vnet/l2/l2_bvi.h
parentd06b9f9cbf9402d66d26fc638a12b84ade197848 (diff)
Improve mechanism for using loopback interface as BVI for BDs
When loopback interface is configured as BVI, instead of changing its output node from loopN-output to l2-input, the loopN-output node is now kept while its next tx node is changed from ethernet-input to l2-input. The packet setup previously done in bvi_to_l2 as part of l2-input is now performed in the loop output node. This change adds an extra node in the BVI output path but provides the following improvements: 1. IP address/route created on loopback prior to it being configured as BVI will still work properly. The requirement to (re)configure IP/route on loopback after it is configured as BVI is removed. 2. The output stats for loopback interfaces are always provided irrespective of their BVI configuration. 3. The loopback-BVI output stats can be batch updated outside the packet loop in output node, instead of per packet update in l2-input node, making l2-input node more efficient for BVI packets. 4. Restore original node property as implemented in node.c function vlib_node_add_next_with_slot() where next node indices stored in next slots of each node will remain unique. 5. Packet trace for BVI output includes loopN output node which provides useful packet data. Change-Id: I7f5bc72ef953a367363a179088210596881f9e73 Signed-off-by: John Lo <loj@cisco.com>
Diffstat (limited to 'vnet/vnet/l2/l2_bvi.h')
-rw-r--r--vnet/vnet/l2/l2_bvi.h29
1 files changed, 0 insertions, 29 deletions
diff --git a/vnet/vnet/l2/l2_bvi.h b/vnet/vnet/l2/l2_bvi.h
index ca5673373fb..b3b20d63104 100644
--- a/vnet/vnet/l2/l2_bvi.h
+++ b/vnet/vnet/l2/l2_bvi.h
@@ -86,35 +86,6 @@ l2_to_bvi (vlib_main_t * vlib_main,
return TO_BVI_ERR_OK;
}
-
-// Prepare a packet that was sent to the BVI interface for L2 processing.
-
-static_always_inline void
-bvi_to_l2 (vlib_main_t * vlib_main,
- vnet_main_t * vnet_main,
- u32 cpu_index,
- vlib_buffer_t * b0,
- u32 bvi_sw_if_index)
-{
- // Set the input interface to be the BVI interface
- vnet_buffer(b0)->sw_if_index[VLIB_RX] = bvi_sw_if_index;
- vnet_buffer(b0)->sw_if_index[VLIB_TX] = ~0;
-
- // Update l2_len in packet which is expected by l2 path,
- // including l2 tag push/pop code on output
- vnet_update_l2_len(b0);
-
- // increment BVI TX interface stat
- vlib_increment_combined_counter
- (vnet_main->interface_main.combined_sw_if_counters
- + VNET_INTERFACE_COUNTER_TX,
- cpu_index,
- bvi_sw_if_index,
- 1,
- vlib_buffer_length_in_chain (vlib_main, b0));
-}
-
-
void
l2bvi_register_input_type (vlib_main_t * vm,
ethernet_type_t type,