diff options
author | Damjan Marion <damarion@cisco.com> | 2022-01-06 20:36:14 +0100 |
---|---|---|
committer | Ole Tr�an <otroan@employees.org> | 2022-01-07 12:49:47 +0000 |
commit | 5c954c4641c7894636aa0533634ef4f5a6bed615 (patch) | |
tree | ee3cbeb1e94fadda57aa8620eacfc30d16b7b1df /src/plugins/vmxnet3/vmxnet3.c | |
parent | c58b1747b34fe1987835f68268218779a81ae3db (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/plugins/vmxnet3/vmxnet3.c')
-rw-r--r-- | src/plugins/vmxnet3/vmxnet3.c | 17 |
1 files changed, 7 insertions, 10 deletions
diff --git a/src/plugins/vmxnet3/vmxnet3.c b/src/plugins/vmxnet3/vmxnet3.c index 8059d03c595..edd0b4f4f75 100644 --- a/src/plugins/vmxnet3/vmxnet3.c +++ b/src/plugins/vmxnet3/vmxnet3.c @@ -617,6 +617,8 @@ vmxnet3_create_if (vlib_main_t * vm, vmxnet3_create_if_args_t * args) { vnet_main_t *vnm = vnet_get_main (); vmxnet3_main_t *vmxm = &vmxnet3_main; + vnet_eth_interface_registration_t eir = {}; + vmxnet3_device_t *vd; vlib_pci_dev_handle_t h; clib_error_t *error = 0; @@ -802,16 +804,11 @@ vmxnet3_create_if (vlib_main_t * vm, vmxnet3_create_if_args_t * args) } /* create interface */ - error = ethernet_register_interface (vnm, vmxnet3_device_class.index, - vd->dev_instance, vd->mac_addr, - &vd->hw_if_index, vmxnet3_flag_change); - - if (error) - { - vmxnet3_log_error (vd, - "error encountered on ethernet register interface"); - goto error; - } + eir.dev_class_index = vmxnet3_device_class.index; + eir.dev_instance = vd->dev_instance; + eir.address = vd->mac_addr; + eir.cb.flag_change = vmxnet3_flag_change; + vd->hw_if_index = vnet_eth_register_interface (vnm, &eir); vnet_sw_interface_t *sw = vnet_get_hw_sw_interface (vnm, vd->hw_if_index); vd->sw_if_index = sw->sw_if_index; |