X-Git-Url: https://gerrit.fd.io/r/gitweb?a=blobdiff_plain;f=src%2Fvnet%2Fdevices%2Ftap%2Ftap.c;h=6f16a4cd71d15ba7f1513f6eb8a0f8c78b2c8c9f;hb=91592c0c9cdd1bc61a2796e41a8becc30aaf8082;hp=f47c1ea3f95ef2157a6c9776265d1fcd69acc1c7;hpb=3039753eda526e63d57a09debd3762e5590459df;p=vpp.git diff --git a/src/vnet/devices/tap/tap.c b/src/vnet/devices/tap/tap.c index f47c1ea3f95..6f16a4cd71d 100644 --- a/src/vnet/devices/tap/tap.c +++ b/src/vnet/devices/tap/tap.c @@ -411,18 +411,6 @@ tap_create_if (vlib_main_t * vm, tap_create_if_args_t * args) } } - /* switch back to old net namespace */ - if (args->host_namespace) - { - if (setns (old_netns_fd, CLONE_NEWNET) == -1) - { - args->rv = VNET_API_ERROR_SYSCALL_ERROR_2; - args->error = clib_error_return_unix (0, "setns '%s'", - args->host_namespace); - goto error; - } - } - if (args->host_mtu_set) { args->error = @@ -446,6 +434,18 @@ tap_create_if (vlib_main_t * vm, tap_create_if_args_t * args) args->host_mtu_size = tm->host_mtu_size; } + /* switch back to old net namespace */ + if (args->host_namespace) + { + if (setns (old_netns_fd, CLONE_NEWNET) == -1) + { + args->rv = VNET_API_ERROR_SYSCALL_ERROR_2; + args->error = clib_error_return_unix (0, "setns '%s'", + args->host_namespace); + goto error; + } + } + for (i = 0; i < num_q_pairs; i++) { if (i < vif->num_rxqs && (args->error = @@ -621,6 +621,7 @@ error: args->rv = VNET_API_ERROR_SYSCALL_ERROR_3; } + tap_log_err (vif, "%U", format_clib_error, args->error); tap_free (vm, vif); done: if (vhost_mem)