summaryrefslogtreecommitdiffstats
path: root/src/vnet/l2/l2_bvi.c
diff options
context:
space:
mode:
authorDamjan Marion <damarion@cisco.com>2022-01-06 20:36:14 +0100
committerOle Tr�an <otroan@employees.org>2022-01-07 12:49:47 +0000
commit5c954c4641c7894636aa0533634ef4f5a6bed615 (patch)
treeee3cbeb1e94fadda57aa8620eacfc30d16b7b1df /src/vnet/l2/l2_bvi.c
parentc58b1747b34fe1987835f68268218779a81ae3db (diff)
ethernet: new interface registration function
Prep for supporting multiple callbacks, optional args, etc. Type: improvement Change-Id: I96244c098712e8213374678623f12527b0e7f387 Signed-off-by: Damjan Marion <damarion@cisco.com>
Diffstat (limited to 'src/vnet/l2/l2_bvi.c')
-rw-r--r--src/vnet/l2/l2_bvi.c19
1 files changed, 5 insertions, 14 deletions
diff --git a/src/vnet/l2/l2_bvi.c b/src/vnet/l2/l2_bvi.c
index e5623682657..9cfff55fb45 100644
--- a/src/vnet/l2/l2_bvi.c
+++ b/src/vnet/l2/l2_bvi.c
@@ -138,13 +138,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 +176,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);