aboutsummaryrefslogtreecommitdiffstats
path: root/src/plugins/marvell
diff options
context:
space:
mode:
authorDamjan Marion <damarion@cisco.com>2022-01-06 20:36:14 +0100
committerOle Tr�an <otroan@employees.org>2022-01-07 12:49:47 +0000
commit5c954c4641c7894636aa0533634ef4f5a6bed615 (patch)
treeee3cbeb1e94fadda57aa8620eacfc30d16b7b1df /src/plugins/marvell
parentc58b1747b34fe1987835f68268218779a81ae3db (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/marvell')
-rw-r--r--src/plugins/marvell/pp2/pp2.c16
1 files changed, 6 insertions, 10 deletions
diff --git a/src/plugins/marvell/pp2/pp2.c b/src/plugins/marvell/pp2/pp2.c
index dfe5c157018..071fb5d9d66 100644
--- a/src/plugins/marvell/pp2/pp2.c
+++ b/src/plugins/marvell/pp2/pp2.c
@@ -178,6 +178,7 @@ mrvl_pp2_create_if (mrvl_pp2_create_if_args_t * args)
vlib_main_t *vm = vlib_get_main ();
vnet_main_t *vnm = vnet_get_main ();
vlib_thread_main_t *tm = vlib_get_thread_main ();
+ vnet_eth_interface_registration_t eir = {};
mrvl_pp2_main_t *ppm = &mrvl_pp2_main;
struct pp2_bpool_params bpool_params = { 0 };
struct pp2_ppio_params ppio_params = { 0 };
@@ -282,16 +283,11 @@ mrvl_pp2_create_if (mrvl_pp2_create_if_args_t * args)
goto error;
}
- args->error = ethernet_register_interface (vnm, mrvl_pp2_device_class.index,
- ppif->dev_instance,
- mac_addr,
- &ppif->hw_if_index,
- mrvl_pp2_eth_flag_change);
- if (args->error)
- {
- args->rv = VNET_API_ERROR_INVALID_REGISTRATION;
- goto error;
- }
+ eir.dev_class_index = mrvl_pp2_device_class.index;
+ eir.dev_instance = ppif->dev_instance;
+ eir.address = mac_addr;
+ eir.cb.flag_change = mrvl_pp2_eth_flag_change;
+ ppif->hw_if_index = vnet_eth_register_interface (vnm, &eir);
sw = vnet_get_hw_sw_interface (vnm, ppif->hw_if_index);
ppif->sw_if_index = sw->sw_if_index;