[PATCH rdma-core] mlx4: Add a report of RSS capabilities in ibv_query_device_ex

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



From: Guy Levi <guyle@xxxxxxxxxxxx>

Report few extra RSS capabilities that were missed in previous patches.

Signed-off-by: Guy Levi <guyle@xxxxxxxxxxxx>
Reviewed-by: Yishai Hadas <yishaih@xxxxxxxxxxxx>
---

The matching kernel part was already merged into 4.15.
PR was sent:
https://github.com/linux-rdma/rdma-core/pull/256

 providers/mlx4/mlx4-abi.h | 8 +++++++-
 providers/mlx4/verbs.c    | 3 +++
 2 files changed, 10 insertions(+), 1 deletion(-)

diff --git a/providers/mlx4/mlx4-abi.h b/providers/mlx4/mlx4-abi.h
index 4f2132c..c4783d2 100644
--- a/providers/mlx4/mlx4-abi.h
+++ b/providers/mlx4/mlx4-abi.h
@@ -99,13 +99,19 @@ struct mlx4_resize_cq {
 	__u64				buf_addr;
 };
 
+struct mlx4_rss_caps {
+	__u64 rx_hash_fields_mask; /* enum ibv_rx_hash_fields */
+	__u8 rx_hash_function; /* enum ibv_rx_hash_function_flags */
+	__u8 reserved[7];
+};
+
 struct mlx4_query_device_ex_resp {
 	struct ibv_query_device_resp_ex ibv_resp;
 	__u32				comp_mask;
 	__u32				response_length;
 	__u64				hca_core_clock_offset;
 	__u32				max_inl_recv_sz;
-	__u32				reserved;
+	struct mlx4_rss_caps            rss_caps; /* vendor data channel */
 };
 
 struct mlx4_query_device_ex {
diff --git a/providers/mlx4/verbs.c b/providers/mlx4/verbs.c
index 8532882..8a2773f 100644
--- a/providers/mlx4/verbs.c
+++ b/providers/mlx4/verbs.c
@@ -87,6 +87,9 @@ int mlx4_query_device_ex(struct ibv_context *context,
 	if (err)
 		return err;
 
+	attr->rss_caps.rx_hash_fields_mask = resp.rss_caps.rx_hash_fields_mask;
+	attr->rss_caps.rx_hash_function = resp.rss_caps.rx_hash_function;
+
 	if (resp.comp_mask & MLX4_QUERY_DEV_RESP_MASK_CORE_CLOCK_OFFSET) {
 		mctx->core_clock.offset = resp.hca_core_clock_offset;
 		mctx->core_clock.offset_valid = 1;
-- 
1.8.3.1

--
To unsubscribe from this list: send the line "unsubscribe linux-rdma" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html



[Index of Archives]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Photo]     [Yosemite News]     [Yosemite Photos]     [Linux Kernel]     [Linux SCSI]     [XFree86]
  Powered by Linux