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/plugins/dpdk/device/init.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) (limited to 'src/plugins/dpdk/device') diff --git a/src/plugins/dpdk/device/init.c b/src/plugins/dpdk/device/init.c index d30c08c28fd..8a466a0169f 100644 --- a/src/plugins/dpdk/device/init.c +++ b/src/plugins/dpdk/device/init.c @@ -176,7 +176,6 @@ dpdk_lib_init (dpdk_main_t * dm) vnet_main_t *vnm = vnet_get_main (); u32 nports; u16 port_id; - clib_error_t *error; vlib_main_t *vm = vlib_get_main (); vlib_thread_main_t *tm = vlib_get_thread_main (); vnet_device_main_t *vdm = &vnet_device_main; @@ -226,6 +225,7 @@ dpdk_lib_init (dpdk_main_t * dm) struct rte_vmbus_device *vmbus_dev; dpdk_portid_t next_port_id; dpdk_device_config_t *devconf = 0; + vnet_eth_interface_registration_t eir = {}; vlib_pci_addr_t pci_addr; vlib_vmbus_addr_t vmbus_addr; uword *p = 0; @@ -650,11 +650,11 @@ dpdk_lib_init (dpdk_main_t * dm) /* assign interface to input thread */ int q; - error = ethernet_register_interface ( - vnm, dpdk_device_class.index, xd->device_index, - /* ethernet address */ addr, &xd->hw_if_index, dpdk_flag_change); - if (error) - return error; + eir.dev_class_index = dpdk_device_class.index; + eir.dev_instance = xd->device_index; + eir.address = addr; + eir.cb.flag_change = dpdk_flag_change; + xd->hw_if_index = vnet_eth_register_interface (vnm, &eir); sw = vnet_get_hw_sw_interface (vnm, xd->hw_if_index); xd->sw_if_index = sw->sw_if_index; -- cgit 1.2.3-korg