X-Git-Url: https://gerrit.fd.io/r/gitweb?a=blobdiff_plain;f=src%2Fvnet%2Finterface.c;h=0b4d78afbdec0c51bd950cfc04fe26fdacb32034;hb=e0792fdff;hp=889ba50cc7a970223625dc0a38b735b7b168ce27;hpb=5cdde5c25a0e71d923a6d56e5c94e058887f95d8;p=vpp.git diff --git a/src/vnet/interface.c b/src/vnet/interface.c index 889ba50cc7a..0b4d78afbde 100644 --- a/src/vnet/interface.c +++ b/src/vnet/interface.c @@ -394,15 +394,6 @@ vnet_sw_interface_set_flags_helper (vnet_main_t * vnm, u32 sw_if_index, } } - /* Do not change state for slave link of bonded interfaces */ - if (si->flags & VNET_SW_INTERFACE_FLAG_BOND_SLAVE) - { - error = clib_error_return - (0, "not allowed as %U belong to a BondEthernet interface", - format_vnet_sw_interface_name, vnm, si); - goto done; - } - /* Already in the desired state? */ if ((si->flags & mask) == flags) goto done; @@ -777,6 +768,7 @@ vnet_register_interface (vnet_main_t * vnm, pool_get (im->hw_interfaces, hw); clib_memset (hw, 0, sizeof (*hw)); + hw->trace_classify_table_index = ~0; hw_index = hw - im->hw_interfaces; hw->hw_if_index = hw_index; @@ -1435,6 +1427,48 @@ vnet_rename_interface (vnet_main_t * vnm, u32 hw_if_index, char *new_name) return error; } +clib_error_t * +vnet_hw_interface_add_del_mac_address (vnet_main_t * vnm, + u32 hw_if_index, + const u8 * mac_address, u8 is_add) +{ + clib_error_t *error = 0; + vnet_hw_interface_t *hi = vnet_get_hw_interface (vnm, hw_if_index); + + vnet_device_class_t *dev_class = + vnet_get_device_class (vnm, hi->dev_class_index); + + if (!hi->hw_address) + { + error = + clib_error_return + (0, "Secondary MAC Addresses not supported for interface index %u", + hw_if_index); + goto done; + } + + if (dev_class->mac_addr_add_del_function) + error = dev_class->mac_addr_add_del_function (hi, mac_address, is_add); + + if (!error) + { + vnet_hw_interface_class_t *hw_class; + + hw_class = vnet_get_hw_interface_class (vnm, hi->hw_class_index); + + if (NULL != hw_class->mac_addr_add_del_function) + error = hw_class->mac_addr_add_del_function (hi, mac_address, is_add); + } + + /* If no errors, add to the list of secondary MACs on the ethernet intf */ + if (!error) + ethernet_interface_add_del_address (ðernet_main, hw_if_index, + mac_address, is_add); + +done: + return error; +} + static clib_error_t * vnet_hw_interface_change_mac_address_helper (vnet_main_t * vnm, u32 hw_if_index,