From 5c954c4641c7894636aa0533634ef4f5a6bed615 Mon Sep 17 00:00:00 2001 From: Damjan Marion Date: Thu, 6 Jan 2022 20:36:14 +0100 Subject: ethernet: new interface registration function Prep for supporting multiple callbacks, optional args, etc. Type: improvement Change-Id: I96244c098712e8213374678623f12527b0e7f387 Signed-off-by: Damjan Marion --- src/plugins/geneve/geneve.c | 15 ++++++--------- 1 file changed, 6 insertions(+), 9 deletions(-) (limited to 'src/plugins/geneve') diff --git a/src/plugins/geneve/geneve.c b/src/plugins/geneve/geneve.c index 81c96c1c42e..bc0ad58672a 100644 --- a/src/plugins/geneve/geneve.c +++ b/src/plugins/geneve/geneve.c @@ -425,18 +425,15 @@ int vnet_geneve_add_del_tunnel vnet_hw_interface_t *hi; if (a->l3_mode) { + vnet_eth_interface_registration_t eir = {}; u32 t_idx = t - vxm->tunnels; u8 address[6] = { 0xd0, 0x0b, 0xee, 0xd0, (u8) (t_idx >> 8), (u8) t_idx }; - clib_error_t *error = - ethernet_register_interface (vnm, geneve_device_class.index, - t_idx, - address, &hw_if_index, 0); - if (error) - { - clib_error_report (error); - return VNET_API_ERROR_INVALID_REGISTRATION; - } + + eir.dev_class_index = geneve_device_class.index; + eir.dev_instance = t_idx; + eir.address = address; + hw_if_index = vnet_eth_register_interface (vnm, &eir); } else { -- cgit 1.2.3-korg