summaryrefslogtreecommitdiffstats
path: root/vnet
diff options
context:
space:
mode:
Diffstat (limited to 'vnet')
-rw-r--r--vnet/vnet/ethernet/interface.c5
-rw-r--r--vnet/vnet/l2/l2_input.c14
-rw-r--r--vnet/vnet/l2/l2_input.h3
3 files changed, 13 insertions, 9 deletions
diff --git a/vnet/vnet/ethernet/interface.c b/vnet/vnet/ethernet/interface.c
index f2e2ca0d7d8..78d89f7e259 100644
--- a/vnet/vnet/ethernet/interface.c
+++ b/vnet/vnet/ethernet/interface.c
@@ -347,7 +347,10 @@ simulated_ethernet_interface_tx (vlib_main_t * vm,
// and update l2_len in packet as required for l2 forwarding path
vnet_buffer (b)->sw_if_index[VLIB_RX] = sw_if_index;
if (bvi_flag)
- vnet_update_l2_len (b);
+ {
+ vnet_update_l2_len (b);
+ vnet_buffer (b)->sw_if_index[VLIB_TX] = L2INPUT_BVI;
+ }
else
vnet_buffer (b)->sw_if_index[VLIB_TX] = (u32) ~ 0;
diff --git a/vnet/vnet/l2/l2_input.c b/vnet/vnet/l2/l2_input.c
index dca13e30191..171ba7344f1 100644
--- a/vnet/vnet/l2/l2_input.c
+++ b/vnet/vnet/l2/l2_input.c
@@ -247,16 +247,14 @@ classify_and_dispatch (vlib_main_t * vm,
}
else
{
-
/*
- * Check for from-BVI processing, TX is non-~0 if from BVI loopback
- * Set SHG for BVI packets to 0 so it is not dropped for VXLAN tunnels
+ * Check for from-BVI processing - set SHG of unicast packets from BVI
+ * to 0 so it is not dropped for VXLAN tunnels or other ports with the
+ * same SHG as that of the BVI.
*/
- if (PREDICT_FALSE (vnet_buffer (b0)->sw_if_index[VLIB_TX] != ~0))
- {
- vnet_buffer (b0)->sw_if_index[VLIB_TX] = ~0;
- vnet_buffer (b0)->l2.shg = 0;
- }
+ if (PREDICT_FALSE (vnet_buffer (b0)->sw_if_index[VLIB_TX] == L2INPUT_BVI
+ && !mcast_dmac))
+ vnet_buffer (b0)->l2.shg = 0;
/* Do bridge-domain processing */
bd_index0 = config->bd_index;
diff --git a/vnet/vnet/l2/l2_input.h b/vnet/vnet/l2/l2_input.h
index c1c9eb1daa2..b4e90af550c 100644
--- a/vnet/vnet/l2/l2_input.h
+++ b/vnet/vnet/l2/l2_input.h
@@ -86,6 +86,9 @@ l2input_bd_config_from_index (l2input_main_t * l2im, u32 bd_index)
return bd_is_valid (bd_config) ? bd_config : NULL;
}
+/* L2 input indication packet is from BVI, using -2 */
+#define L2INPUT_BVI ((u32) (~0-1))
+
/* L2 input features */
/* Mappings from feature ID to graph node name */