net: make the net initialization in a correct way

Change-Id: If795ae841127a0742b366ac5df019e5a2d6e6b65
Signed-off-by: Ziye Yang <optimistyzy@gmail.com>
Reviewed-on: https://review.gerrithub.io/436901
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Chandler-Test-Pool: SPDK Automated Test System <sys_sgsw@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Reviewed-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
Reviewed-by: Changpeng Liu <changpeng.liu@intel.com>
This commit is contained in:
Ziye Yang 2018-12-12 17:12:13 +08:00 committed by Changpeng Liu
parent 672115fef4
commit ef8e47571b
2 changed files with 5 additions and 4 deletions

View File

@ -51,7 +51,7 @@ struct spdk_sock;
struct spdk_net_framework {
const char *name;
int (*init)(void);
void (*init)(void);
void (*fini)(void);
STAILQ_ENTRY(spdk_net_framework) link;

View File

@ -624,7 +624,7 @@ static struct spdk_net_impl g_vpp_net_impl = {
SPDK_NET_IMPL_REGISTER(vpp, &g_vpp_net_impl);
static int
static void
spdk_vpp_net_framework_init(void)
{
int rc;
@ -633,7 +633,8 @@ spdk_vpp_net_framework_init(void)
app_name = spdk_sprintf_alloc("SPDK_%d", getpid());
if (app_name == NULL) {
SPDK_ERRLOG("Cannot alloc memory for SPDK app name\n");
return -ENOMEM;
spdk_net_framework_init_next(-ENOMEM);
return;
}
rc = vppcom_app_create(app_name);
@ -643,7 +644,7 @@ spdk_vpp_net_framework_init(void)
free(app_name);
return 0;
spdk_net_framework_init_next(0);
}
static void