X-Git-Url: https://gerrit.fd.io/r/gitweb?a=blobdiff_plain;f=src%2Fvnet%2Fl2%2Fl2_input.c;h=d8a0a6bd798a35217ce9e553df1976885ce3569e;hb=4f8863b21405d1ab3e067e978a60be72a343358b;hp=5d16b1ddc9e285f814bee75760102a1c08edaf67;hpb=109139eed67b7f472cf7328a02265528dbe8934e;p=vpp.git diff --git a/src/vnet/l2/l2_input.c b/src/vnet/l2/l2_input.c index 5d16b1ddc9e..d8a0a6bd798 100644 --- a/src/vnet/l2/l2_input.c +++ b/src/vnet/l2/l2_input.c @@ -564,6 +564,7 @@ set_int_l2_mode (vlib_main_t * vm, vnet_main_t * vnet_main, /* */ l2_bridge_domain_t *bd_config; i32 l2_if_adjust = 0; u32 slot; + vnet_device_class_t *dev_class; hi = vnet_get_sup_hw_interface (vnet_main, sw_if_index); config = l2input_intf_config (sw_if_index); @@ -579,6 +580,8 @@ set_int_l2_mode (vlib_main_t * vm, vnet_main_t * vnet_main, /* */ /* undo any BVI-related config */ if (bd_config->bvi_sw_if_index == sw_if_index) { + vnet_sw_interface_t *si; + bd_config->bvi_sw_if_index = ~0; config->bvi = 0; @@ -591,6 +594,10 @@ set_int_l2_mode (vlib_main_t * vm, vnet_main_t * vnet_main, /* */ "ethernet-input", VNET_SIMULATED_ETHERNET_TX_NEXT_ETHERNET_INPUT); ASSERT (slot == VNET_SIMULATED_ETHERNET_TX_NEXT_ETHERNET_INPUT); + + /* since this is a no longer BVI interface do not to flood to it */ + si = vnet_get_sw_interface (vnm, sw_if_index); + si->flood_class = VNET_FLOOD_CLASS_NO_FLOOD; } /* Clear MACs learned on the interface */ @@ -673,6 +680,8 @@ set_int_l2_mode (vlib_main_t * vm, vnet_main_t * vnet_main, /* */ /* Do BVI interface initializations */ if (bvi) { + vnet_sw_interface_t *si; + /* ensure BD has no bvi interface (or replace that one with this??) */ if (bd_config->bvi_sw_if_index != ~0) { @@ -693,6 +702,10 @@ set_int_l2_mode (vlib_main_t * vm, vnet_main_t * vnet_main, /* */ "l2-input", VNET_SIMULATED_ETHERNET_TX_NEXT_ETHERNET_INPUT); ASSERT (slot == VNET_SIMULATED_ETHERNET_TX_NEXT_ETHERNET_INPUT); + + /* since this is a BVI interface we want to flood to it */ + si = vnet_get_sw_interface (vnm, sw_if_index); + si->flood_class = VNET_FLOOD_CLASS_BVI; } /* Add interface to bridge-domain flood vector */ @@ -786,6 +799,12 @@ set_int_l2_mode (vlib_main_t * vm, vnet_main_t * vnet_main, /* */ /* Set up the L2/L3 flag in the interface parsing tables */ ethernet_sw_interface_set_l2_mode (vnm, sw_if_index, (mode != MODE_L3)); + dev_class = vnet_get_device_class (vnet_main, hi->dev_class_index); + if (dev_class->set_l2_mode_function) + { + dev_class->set_l2_mode_function (vnet_main, hi, l2_if_adjust); + } + return 0; }