Using the cli "set interface tx-queue", it is not possible to assign
tx queue to the last worker thread.
The reason is that vdm->first_worker_thread_index is 1. Adding that
to clib_bitmap_last_set (bitmap) exceeds vdm->last_worker_thread_index
when the CLI specifies the last worker thread.
Also make the threads argument optional to enable user to unbind a queue
from any thread.
Type: fix
Signed-off-by: Steven Luong <sluong@cisco.com>
Change-Id: I796259c20f571289c8f5a97b9418caf452d0ab3d
hw = vnet_get_hw_interface (vnm, hw_if_index);
/* highest set bit in bitmap should not exceed last worker thread index */
hw = vnet_get_hw_interface (vnm, hw_if_index);
/* highest set bit in bitmap should not exceed last worker thread index */
- thread_index =
- clib_bitmap_last_set (bitmap) + vdm->first_worker_thread_index;
- if (thread_index > vdm->last_worker_thread_index)
+ thread_index = clib_bitmap_last_set (bitmap);
+ if ((thread_index != ~0) && (thread_index > vdm->last_worker_thread_index))
return clib_error_return (0, "please specify valid thread(s)");
queue_index =
return clib_error_return (0, "please specify valid thread(s)");
queue_index =
VLIB_CLI_COMMAND (cmd_set_if_tx_queue, static) = {
.path = "set interface tx-queue",
.short_help = "set interface tx-queue <interface> queue <n> "
VLIB_CLI_COMMAND (cmd_set_if_tx_queue, static) = {
.path = "set interface tx-queue",
.short_help = "set interface tx-queue <interface> queue <n> "
.function = set_interface_tx_queue,
.is_mp_safe = 1,
};
.function = set_interface_tx_queue,
.is_mp_safe = 1,
};