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/avf/device.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/avf/device.c')
-rw-r--r-- | src/plugins/avf/device.c | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/src/plugins/avf/device.c b/src/plugins/avf/device.c index 627ead6f4e5..df6d12881a5 100644 --- a/src/plugins/avf/device.c +++ b/src/plugins/avf/device.c @@ -1589,6 +1589,7 @@ void avf_create_if (vlib_main_t * vm, avf_create_if_args_t * args) { vnet_main_t *vnm = vnet_get_main (); + vnet_eth_interface_registration_t eir = {}; avf_main_t *am = &avf_main; avf_device_t *ad, **adp; vlib_pci_dev_handle_t h; @@ -1722,12 +1723,11 @@ avf_create_if (vlib_main_t * vm, avf_create_if_args_t * args) goto error; /* create interface */ - error = ethernet_register_interface (vnm, avf_device_class.index, - ad->dev_instance, ad->hwaddr, - &ad->hw_if_index, avf_flag_change); - - if (error) - goto error; + eir.dev_class_index = avf_device_class.index; + eir.dev_instance = ad->dev_instance; + eir.address = ad->hwaddr; + eir.cb.flag_change = avf_flag_change; + ad->hw_if_index = vnet_eth_register_interface (vnm, &eir); ethernet_set_flags (vnm, ad->hw_if_index, ETHERNET_INTERFACE_FLAG_DEFAULT_L3); |