-static clib_error_t *
-show_device_placement_fn (vlib_main_t * vm, unformat_input_t * input,
- vlib_cli_command_t * cmd)
-{
- u8 *s = 0;
- vnet_main_t *vnm = vnet_get_main ();
- vnet_device_input_runtime_t *rt;
- vnet_device_and_queue_t *dq;
- vlib_node_t *pn = vlib_get_node_by_name (vm, (u8 *) "device-input");
- uword si;
- int index = 0;
-
- /* *INDENT-OFF* */
- foreach_vlib_main (({
- clib_bitmap_foreach (si, pn->sibling_bitmap,
- ({
- rt = vlib_node_get_runtime_data (this_vlib_main, si);
-
- if (vec_len (rt->devices_and_queues))
- s = format (s, " node %U:\n", format_vlib_node_name, vm, si);
-
- vec_foreach (dq, rt->devices_and_queues)
- {
- s = format (s, " %U queue %u\n",
- format_vnet_sw_if_index_name, vnm, dq->hw_if_index,
- dq->queue_id);
- }
- }));
- if (vec_len (s) > 0)
+ if (vec_len (rt->devices_and_queues) == 0)
+ vlib_node_set_state (vm, hw->input_node_index, VLIB_NODE_STATE_DISABLED);
+ else if (mode == VNET_HW_INTERFACE_RX_MODE_POLLING)
+ {
+ /*
+ * if the deleted interface is polling, we may need to set the node state
+ * to interrupt if there is no more polling interface for this device's
+ * corresponding thread. This is because mixed interfaces
+ * (polling and interrupt), assigned to the same thread, set the
+ * thread to polling prior to the deletion.
+ */
+ vec_foreach (dq, rt->devices_and_queues)