Blame SOURCES/mlx4-add-a-report-of-rss-cap.patch

95af3a
commit 22a04b26a8c1428b87b3cc35fd256ee615172648
95af3a
Author: Guy Levi <guyle@mellanox.com>
95af3a
Date:   Tue Oct 17 15:23:10 2017 +0300
95af3a
95af3a
    mlx4: Add a report of RSS capabilities in ibv_query_device_ex
95af3a
    
95af3a
    Report few extra RSS capabilities that were missed in previous patches.
95af3a
    
95af3a
    Signed-off-by: Guy Levi <guyle@mellanox.com>
95af3a
    Reviewed-by: Yishai Hadas <yishaih@mellanox.com>
95af3a
95af3a
diff --git a/providers/mlx4/mlx4-abi.h b/providers/mlx4/mlx4-abi.h
95af3a
index 4f2132c2..c4783d29 100644
95af3a
--- a/providers/mlx4/mlx4-abi.h
95af3a
+++ b/providers/mlx4/mlx4-abi.h
95af3a
@@ -99,13 +99,19 @@ struct mlx4_resize_cq {
95af3a
 	__u64				buf_addr;
95af3a
 };
95af3a
 
95af3a
+struct mlx4_rss_caps {
95af3a
+	__u64 rx_hash_fields_mask; /* enum ibv_rx_hash_fields */
95af3a
+	__u8 rx_hash_function; /* enum ibv_rx_hash_function_flags */
95af3a
+	__u8 reserved[7];
95af3a
+};
95af3a
+
95af3a
 struct mlx4_query_device_ex_resp {
95af3a
 	struct ibv_query_device_resp_ex ibv_resp;
95af3a
 	__u32				comp_mask;
95af3a
 	__u32				response_length;
95af3a
 	__u64				hca_core_clock_offset;
95af3a
 	__u32				max_inl_recv_sz;
95af3a
-	__u32				reserved;
95af3a
+	struct mlx4_rss_caps            rss_caps; /* vendor data channel */
95af3a
 };
95af3a
 
95af3a
 struct mlx4_query_device_ex {
95af3a
diff --git a/providers/mlx4/verbs.c b/providers/mlx4/verbs.c
95af3a
index 8532882e..8a2773f9 100644
95af3a
--- a/providers/mlx4/verbs.c
95af3a
+++ b/providers/mlx4/verbs.c
95af3a
@@ -87,6 +87,9 @@ int mlx4_query_device_ex(struct ibv_context *context,
95af3a
 	if (err)
95af3a
 		return err;
95af3a
 
95af3a
+	attr->rss_caps.rx_hash_fields_mask = resp.rss_caps.rx_hash_fields_mask;
95af3a
+	attr->rss_caps.rx_hash_function = resp.rss_caps.rx_hash_function;
95af3a
+
95af3a
 	if (resp.comp_mask & MLX4_QUERY_DEV_RESP_MASK_CORE_CLOCK_OFFSET) {
95af3a
 		mctx->core_clock.offset = resp.hca_core_clock_offset;
95af3a
 		mctx->core_clock.offset_valid = 1;