aboutsummaryrefslogtreecommitdiffstats
path: root/src/plugins/dpdk/device
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/dpdk/device
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/dpdk/device')
-rw-r--r--src/plugins/dpdk/device/init.c12
1 files changed, 6 insertions, 6 deletions
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;