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/vnet/devices/tap/tap.c | 16 ++++++---------- 1 file changed, 6 insertions(+), 10 deletions(-) (limited to 'src/vnet/devices/tap') diff --git a/src/vnet/devices/tap/tap.c b/src/vnet/devices/tap/tap.c index 93140ec0c3f..19333f0ab10 100644 --- a/src/vnet/devices/tap/tap.c +++ b/src/vnet/devices/tap/tap.c @@ -643,17 +643,13 @@ tap_create_if (vlib_main_t * vm, tap_create_if_args_t * args) if (vif->type != VIRTIO_IF_TYPE_TUN) { - args->error = - ethernet_register_interface (vnm, virtio_device_class.index, - vif->dev_instance, vif->mac_addr, - &vif->hw_if_index, - virtio_eth_flag_change); - if (args->error) - { - args->rv = VNET_API_ERROR_INVALID_REGISTRATION; - goto error; - } + vnet_eth_interface_registration_t eir = {}; + eir.dev_class_index = virtio_device_class.index; + eir.dev_instance = vif->dev_instance; + eir.address = vif->mac_addr; + eir.cb.flag_change = virtio_eth_flag_change; + vif->hw_if_index = vnet_eth_register_interface (vnm, &eir); } else { -- cgit 1.2.3-korg