diff options
Diffstat (limited to 'src/vnet/l2/l2_bvi.c')
-rw-r--r-- | src/vnet/l2/l2_bvi.c | 25 |
1 files changed, 5 insertions, 20 deletions
diff --git a/src/vnet/l2/l2_bvi.c b/src/vnet/l2/l2_bvi.c index e5623682657..e39c4aae39d 100644 --- a/src/vnet/l2/l2_bvi.c +++ b/src/vnet/l2/l2_bvi.c @@ -58,14 +58,12 @@ bvi_mac_change (vnet_hw_interface_t * hi, return (NULL); } -/* *INDENT-OFF* */ VNET_DEVICE_CLASS (bvi_device_class) = { .name = "BVI", .format_device_name = format_bvi_name, .admin_up_down_function = bvi_admin_up_down, .mac_addr_change_function = bvi_mac_change, }; -/* *INDENT-ON* */ /* * Maintain a bitmap of allocated bvi instance numbers. @@ -138,13 +136,11 @@ l2_bvi_create (u32 user_instance, { vnet_main_t *vnm = vnet_get_main (); vlib_main_t *vm = vlib_get_main (); + vnet_eth_interface_registration_t eir = {}; u32 instance, hw_if_index, slot; vnet_hw_interface_t *hw_if; - clib_error_t *error; mac_address_t mac; - int rv = 0; - ASSERT (sw_if_indexp); *sw_if_indexp = (u32) ~ 0; @@ -178,17 +174,10 @@ l2_bvi_create (u32 user_instance, mac_address_copy (&mac, mac_in); } - error = ethernet_register_interface (vnm, - bvi_device_class.index, - instance, mac.bytes, &hw_if_index, - /* flag change */ 0); - - if (error) - { - rv = VNET_API_ERROR_INVALID_REGISTRATION; - clib_error_report (error); - return rv; - } + eir.dev_class_index = bvi_device_class.index; + eir.dev_instance = instance; + eir.address = mac.bytes; + hw_if_index = vnet_eth_register_interface (vnm, &eir); hw_if = vnet_get_hw_interface (vnm, hw_if_index); @@ -282,13 +271,11 @@ l2_bvi_create_cli (vlib_main_t * vm, * Example of how to create a bvi interface: * @cliexcmd{bvi create} ?*/ -/* *INDENT-OFF* */ VLIB_CLI_COMMAND (l2_bvi_create_command, static) = { .path = "bvi create", .short_help = "bvi create [mac <mac-addr>] [instance <instance>]", .function = l2_bvi_create_cli, }; -/* *INDENT-ON* */ static clib_error_t * l2_bvi_delete_cli (vlib_main_t * vm, @@ -333,13 +320,11 @@ l2_bvi_delete_cli (vlib_main_t * vm, * Example of how to create a bvi interface: * @cliexcmd{bvi delete bvi0} ?*/ -/* *INDENT-OFF* */ VLIB_CLI_COMMAND (l2_bvi_delete_command, static) = { .path = "bvi delete", .short_help = "bvi delete <interface>", .function = l2_bvi_delete_cli, }; -/* *INDENT-ON* */ /* |