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/memif | |
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/memif')
-rw-r--r-- | src/plugins/memif/memif.c | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/src/plugins/memif/memif.c b/src/plugins/memif/memif.c index d7b82ceee5e..5da73621536 100644 --- a/src/plugins/memif/memif.c +++ b/src/plugins/memif/memif.c @@ -897,6 +897,7 @@ memif_create_if (vlib_main_t * vm, memif_create_if_args_t * args) memif_main_t *mm = &memif_main; vlib_thread_main_t *tm = vlib_get_thread_main (); vnet_main_t *vnm = vnet_get_main (); + vnet_eth_interface_registration_t eir = {}; memif_if_t *mif = 0; vnet_sw_interface_t *sw; clib_error_t *error = 0; @@ -1011,10 +1012,12 @@ memif_create_if (vlib_main_t * vm, memif_create_if_args_t * args) args->hw_addr[0] = 2; args->hw_addr[1] = 0xfe; } - error = ethernet_register_interface (vnm, memif_device_class.index, - mif->dev_instance, args->hw_addr, - &mif->hw_if_index, - memif_eth_flag_change); + + eir.dev_class_index = memif_device_class.index; + eir.dev_instance = mif->dev_instance; + eir.address = args->hw_addr; + eir.cb.flag_change = memif_eth_flag_change; + mif->hw_if_index = vnet_eth_register_interface (vnm, &eir); } else if (mif->mode == MEMIF_INTERFACE_MODE_IP) { |