summaryrefslogtreecommitdiffstats
path: root/src/vnet/interface.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/vnet/interface.c')
-rw-r--r--src/vnet/interface.c36
1 files changed, 36 insertions, 0 deletions
diff --git a/src/vnet/interface.c b/src/vnet/interface.c
index 6d5b3561f19..18c7696e9a4 100644
--- a/src/vnet/interface.c
+++ b/src/vnet/interface.c
@@ -1692,6 +1692,42 @@ default_update_adjacency (vnet_main_t * vnm, u32 sw_if_index, u32 ai)
}
}
+clib_error_t *
+vnet_hw_interface_set_rss_queues (vnet_main_t * vnm,
+ vnet_hw_interface_t * hi,
+ clib_bitmap_t * bitmap)
+{
+ clib_error_t *error = 0;
+ vnet_device_class_t *dev_class =
+ vnet_get_device_class (vnm, hi->dev_class_index);
+
+ if (dev_class->set_rss_queues_function)
+ {
+ if (clib_bitmap_count_set_bits (bitmap) == 0)
+ {
+ error = clib_error_return (0,
+ "must assign at least one valid rss queue");
+ goto done;
+ }
+
+ error = dev_class->set_rss_queues_function (vnm, hi, bitmap);
+ }
+ else
+ {
+ error = clib_error_return (0,
+ "setting rss queues is not supported on this interface");
+ }
+
+ if (!error)
+ {
+ clib_bitmap_free (hi->rss_queues);
+ hi->rss_queues = clib_bitmap_dup (bitmap);
+ }
+
+done:
+ return error;
+}
+
int collect_detailed_interface_stats_flag = 0;
void