summaryrefslogtreecommitdiffstats
path: root/vnet
diff options
context:
space:
mode:
authorDave Barach <dave@barachs.net>2016-07-01 12:38:11 -0400
committerDave Barach <dave@barachs.net>2016-07-01 12:38:29 -0400
commitb8dca74c232d6f177479d644dc3359b82772ea9e (patch)
tree85c1260131b9fb0c4987918bd78c75f4a0791b2c /vnet
parentbfd32fddb32a0927f85081c4a2364f5b3da5cfa5 (diff)
VPP-171: fix a set of hw interface recycling bugs
Change-Id: I735292bb2176742acab2295f90956c57e6f7ec1c Signed-off-by: Dave Barach <dave@barachs.net>
Diffstat (limited to 'vnet')
-rw-r--r--vnet/vnet/devices/dpdk/vhost_user.c2
-rw-r--r--vnet/vnet/interface.c9
-rw-r--r--vnet/vnet/ip/ip46_cli.c17
3 files changed, 27 insertions, 1 deletions
diff --git a/vnet/vnet/devices/dpdk/vhost_user.c b/vnet/vnet/devices/dpdk/vhost_user.c
index fd1bd221062..1918a8fe634 100644
--- a/vnet/vnet/devices/dpdk/vhost_user.c
+++ b/vnet/vnet/devices/dpdk/vhost_user.c
@@ -939,7 +939,7 @@ static void dpdk_unmap_all_mem_regions(dpdk_device_t * xd)
vui->region_addr[i]= -1;
if (r == -1) {
- clib_warning("failed to unmap memory region (errno %d)", errno);
+ clib_unix_warning("failed to unmap memory region");
}
close(vui->region_fd[i]);
}
diff --git a/vnet/vnet/interface.c b/vnet/vnet/interface.c
index 2fb93748b1e..d84c8b03bc2 100644
--- a/vnet/vnet/interface.c
+++ b/vnet/vnet/interface.c
@@ -656,7 +656,16 @@ vnet_register_interface (vnet_main_t * vnm,
rt = vlib_node_get_runtime_data (vm, hw->output_node_index);
ASSERT (rt->is_deleted == 1);
rt->is_deleted = 0;
+ rt->hw_if_index = hw_index;
+ rt->sw_if_index = hw->sw_if_index;
+ rt->dev_instance = hw->dev_instance;
+ rt = vlib_node_get_runtime_data (vm, hw->tx_node_index);
+ rt->hw_if_index = hw_index;
+ rt->sw_if_index = hw->sw_if_index;
+ rt->dev_instance = hw->dev_instance;
+
+ vlib_worker_thread_node_runtime_update();
_vec_len (im->deleted_hw_interface_nodes) -= 1;
}
else
diff --git a/vnet/vnet/ip/ip46_cli.c b/vnet/vnet/ip/ip46_cli.c
index 44dde9bf3e7..3bb7d766d70 100644
--- a/vnet/vnet/ip/ip46_cli.c
+++ b/vnet/vnet/ip/ip46_cli.c
@@ -102,6 +102,23 @@ void ip_del_all_interface_addresses (vlib_main_t *vm, u32 sw_if_index)
}
static clib_error_t *
+ip_address_delete_cleanup (vnet_main_t * vnm, u32 hw_if_index, u32 is_create)
+{
+ vlib_main_t * vm = vlib_get_main();
+ vnet_hw_interface_t * hw;
+
+ if (is_create)
+ return 0;
+
+ hw = vnet_get_hw_interface (vnm, hw_if_index);
+
+ ip_del_all_interface_addresses (vm, hw->sw_if_index);
+ return 0;
+}
+
+VNET_HW_INTERFACE_ADD_DEL_FUNCTION (ip_address_delete_cleanup);
+
+static clib_error_t *
add_del_ip_address (vlib_main_t * vm,
unformat_input_t * input,
vlib_cli_command_t * cmd)