From 4ed7096d4a4aff47a812a79252edd0834277ee30 Mon Sep 17 00:00:00 2001 From: rainbow_0206 Date: Fri, 19 Oct 2018 17:04:02 +0800 Subject: Feat: support vhost-user in lwip stack Change-Id: I6685fae6dafb4a4ac4f03bd868aa5ca636ce7054 Signed-off-by: rainbow_0206 --- src/framework/hal/hal.c | 4 ++-- src/framework/hal/hal.h | 3 ++- src/framework/include/hal_api.h | 3 ++- 3 files changed, 6 insertions(+), 4 deletions(-) (limited to 'src/framework') diff --git a/src/framework/hal/hal.c b/src/framework/hal/hal.c index 545c759..49b1fb7 100644 --- a/src/framework/hal/hal.c +++ b/src/framework/hal/hal.c @@ -312,7 +312,7 @@ hal_get_invalid_hdl () Called By : *****************************************************************************/ hal_hdl_t -hal_create (const char *name, hal_netif_config_t * conf) +hal_create (const char *name, const char *nic_type, hal_netif_config_t * conf) { int ret = -1; uint32_t netif_type; @@ -336,7 +336,7 @@ hal_create (const char *name, hal_netif_config_t * conf) /*open */ for (netif_type = 0; NULL != netif_ops_table[netif_type]; ++netif_type) { - ret = netif_ops_table[netif_type]->open (inst, name); + ret = netif_ops_table[netif_type]->open (inst, name, nic_type); if (0 == ret) { diff --git a/src/framework/hal/hal.h b/src/framework/hal/hal.h index 36ad79d..5a8f51e 100644 --- a/src/framework/hal/hal.h +++ b/src/framework/hal/hal.h @@ -66,6 +66,7 @@ typedef struct dpdk_if char pci_addr[HAL_MAX_PCI_ADDR_LEN]; char nic_name[HAL_MAX_NIC_NAME_LEN]; + char nic_type[HAL_MAX_NIC_NAME_LEN]; char driver_name[HAL_MAX_DRIVER_NAME_LEN]; } dpdk_if_t; @@ -93,7 +94,7 @@ typedef struct netif_ops const char *name; int (*init_global) (int argc, char **argv); int (*init_local) (void); - int (*open) (netif_inst_t * inst, const char *name); + int (*open) (netif_inst_t * inst, const char *name, const char *type); int (*close) (netif_inst_t * inst); int (*start) (netif_inst_t * inst); int (*stop) (netif_inst_t * inst); diff --git a/src/framework/include/hal_api.h b/src/framework/include/hal_api.h index 90c3100..a5d7725 100644 --- a/src/framework/include/hal_api.h +++ b/src/framework/include/hal_api.h @@ -110,7 +110,8 @@ typedef struct hal_netif_config int hal_init_global (int argc, char **argv); int hal_init_local (); -hal_hdl_t hal_create (const char *name, hal_netif_config_t * conf); +hal_hdl_t hal_create (const char *name, const char *nic_type, + hal_netif_config_t * conf); hal_hdl_t hal_bond (const char *bond_name, uint8_t slave_num, hal_hdl_t slave_hdl[]); -- cgit