interface: support configuring RSS steering queues
This patch adds the RSS steering queues set interface, and it's
implementation in DPDK device:
/* Interface to set rss queues of the interface */
typedef clib_error_t *(vnet_interface_rss_queues_set_t)
(struct vnet_main_t * vnm, struct vnet_hw_interface_t * hi,
clib_bitmap_t *bitmap);
This patch also introduces a command line to set the RSS queues:
set interface rss queues <interface> <list <queue-list>>
To display the rss queues, use "show hardware-interfaces"
Below is the example to configure rss queues for interface Gig0:
vpp# set interface rss queues Gig0 list 0,2,4-7
vpp# show hardware-interfaces brief
Name Idx Link Hardware
VirtualFunctionEthernet18/1/0 1 down VirtualFunctionEthernet18/1/0
Link speed: unknown
RSS queues: 0 2 4 5 6 7
local0 0 down local0
Link speed: unknown
vpp#
Users can also configure the rss queues on a dpdk interface in
startup.conf:
dpdk {
dev 0000:18:01.0 {
rss-queues 0,2,5-7
}
}
Type: feature
Signed-off-by: Chenmin Sun <chenmin.sun@intel.com>
Change-Id: I1835595a1c54016a84eabee9fd62ce137935385d
diff --git a/src/vnet/interface_format.c b/src/vnet/interface_format.c
index 8278102..2b691a6 100644
--- a/src/vnet/interface_format.c
+++ b/src/vnet/interface_format.c
@@ -130,6 +130,26 @@
return format (s, "%u Kbps", link_speed);
}
+u8 *
+format_vnet_hw_interface_rss_queues (u8 * s, va_list * args)
+{
+ clib_bitmap_t *bitmap = va_arg (*args, clib_bitmap_t *);
+ int i;
+
+ if (bitmap == NULL)
+ return s;
+
+ if (bitmap)
+ {
+ /* *INDENT-OFF* */
+ clib_bitmap_foreach (i, bitmap, ({
+ s = format (s, "%u ", i);
+ }));
+ /* *INDENT-ON* */
+ }
+
+ return s;
+}
u8 *
format_vnet_hw_interface (u8 * s, va_list * args)
@@ -172,6 +192,12 @@
s = format (s, "\n%ULink speed: %U", format_white_space, indent + 2,
format_vnet_hw_interface_link_speed, hi->link_speed);
+ if (hi->rss_queues)
+ {
+ s = format (s, "\n%URSS queues: %U", format_white_space, indent + 2,
+ format_vnet_hw_interface_rss_queues, hi->rss_queues);
+ }
+
if (verbose)
{
if (hw_class->format_device)