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/virtio/vhost_user.c | 15 +++++---------- 1 file changed, 5 insertions(+), 10 deletions(-) (limited to 'src/vnet/devices/virtio/vhost_user.c') diff --git a/src/vnet/devices/virtio/vhost_user.c b/src/vnet/devices/virtio/vhost_user.c index 85c39b9de8b..2d8cad8da43 100644 --- a/src/vnet/devices/virtio/vhost_user.c +++ b/src/vnet/devices/virtio/vhost_user.c @@ -1563,8 +1563,8 @@ vhost_user_create_ethernet (vnet_main_t *vnm, vlib_main_t *vm, vhost_user_create_if_args_t *args) { vhost_user_main_t *vum = &vhost_user_main; + vnet_eth_interface_registration_t eir = {}; u8 hwaddr[6]; - clib_error_t *error; /* create hw and sw interface */ if (args->use_custom_mac) @@ -1579,15 +1579,10 @@ vhost_user_create_ethernet (vnet_main_t *vnm, vlib_main_t *vm, hwaddr[1] = 0xfe; } - error = ethernet_register_interface - (vnm, - vhost_user_device_class.index, - vui - vum->vhost_user_interfaces /* device instance */ , - hwaddr /* ethernet address */ , - &vui->hw_if_index, 0 /* flag change */ ); - - if (error) - clib_error_report (error); + eir.dev_class_index = vhost_user_device_class.index; + eir.dev_instance = vui - vum->vhost_user_interfaces /* device instance */, + eir.address = hwaddr; + vui->hw_if_index = vnet_eth_register_interface (vnm, &eir); } /* -- cgit 1.2.3-korg