aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorYishai Hadas <yishaih@mellanox.com>2016-08-28 04:28:44 -0400
committerDoug Ledford <dledford@redhat.com>2016-10-07 16:54:12 -0400
commit47adf2f4f5805d075359fe6cbe3437612f7d4a34 (patch)
tree71b115d2db3866eb8f708d77c14abc61c6a19fc2
parentccf20562601d2b911787ffa730ad96bb78269a9c (diff)
IB/uverbs: Expose RSS related capabilities
Query RSS related attributes and return them to user-space via the extended query device uverbs command. It includes both direct ones (i.e. struct ib_uverbs_rss_caps) and max_wq_type_rq which may be used in both RSS and non RSS flows. Signed-off-by: Yishai Hadas <yishaih@mellanox.com> Signed-off-by: Leon Romanovsky <leon@kernel.org> Signed-off-by: Doug Ledford <dledford@redhat.com>
-rw-r--r--drivers/infiniband/core/uverbs_cmd.c17
-rw-r--r--include/uapi/rdma/ib_user_verbs.h14
2 files changed, 31 insertions, 0 deletions
diff --git a/drivers/infiniband/core/uverbs_cmd.c b/drivers/infiniband/core/uverbs_cmd.c
index fe784a908817..19c1ebf596ad 100644
--- a/drivers/infiniband/core/uverbs_cmd.c
+++ b/drivers/infiniband/core/uverbs_cmd.c
@@ -4173,6 +4173,23 @@ int ib_uverbs_ex_query_device(struct ib_uverbs_file *file,
4173 4173
4174 resp.device_cap_flags_ex = attr.device_cap_flags; 4174 resp.device_cap_flags_ex = attr.device_cap_flags;
4175 resp.response_length += sizeof(resp.device_cap_flags_ex); 4175 resp.response_length += sizeof(resp.device_cap_flags_ex);
4176
4177 if (ucore->outlen < resp.response_length + sizeof(resp.rss_caps))
4178 goto end;
4179
4180 resp.rss_caps.supported_qpts = attr.rss_caps.supported_qpts;
4181 resp.rss_caps.max_rwq_indirection_tables =
4182 attr.rss_caps.max_rwq_indirection_tables;
4183 resp.rss_caps.max_rwq_indirection_table_size =
4184 attr.rss_caps.max_rwq_indirection_table_size;
4185
4186 resp.response_length += sizeof(resp.rss_caps);
4187
4188 if (ucore->outlen < resp.response_length + sizeof(resp.max_wq_type_rq))
4189 goto end;
4190
4191 resp.max_wq_type_rq = attr.max_wq_type_rq;
4192 resp.response_length += sizeof(resp.max_wq_type_rq);
4176end: 4193end:
4177 err = ib_copy_to_udata(ucore, &resp, resp.response_length); 4194 err = ib_copy_to_udata(ucore, &resp, resp.response_length);
4178 return err; 4195 return err;
diff --git a/include/uapi/rdma/ib_user_verbs.h b/include/uapi/rdma/ib_user_verbs.h
index 7f035f4b53b0..a9ebb477dc77 100644
--- a/include/uapi/rdma/ib_user_verbs.h
+++ b/include/uapi/rdma/ib_user_verbs.h
@@ -224,6 +224,17 @@ struct ib_uverbs_odp_caps {
224 __u32 reserved; 224 __u32 reserved;
225}; 225};
226 226
227struct ib_uverbs_rss_caps {
228 /* Corresponding bit will be set if qp type from
229 * 'enum ib_qp_type' is supported, e.g.
230 * supported_qpts |= 1 << IB_QPT_UD
231 */
232 __u32 supported_qpts;
233 __u32 max_rwq_indirection_tables;
234 __u32 max_rwq_indirection_table_size;
235 __u32 reserved;
236};
237
227struct ib_uverbs_ex_query_device_resp { 238struct ib_uverbs_ex_query_device_resp {
228 struct ib_uverbs_query_device_resp base; 239 struct ib_uverbs_query_device_resp base;
229 __u32 comp_mask; 240 __u32 comp_mask;
@@ -232,6 +243,9 @@ struct ib_uverbs_ex_query_device_resp {
232 __u64 timestamp_mask; 243 __u64 timestamp_mask;
233 __u64 hca_core_clock; /* in KHZ */ 244 __u64 hca_core_clock; /* in KHZ */
234 __u64 device_cap_flags_ex; 245 __u64 device_cap_flags_ex;
246 struct ib_uverbs_rss_caps rss_caps;
247 __u32 max_wq_type_rq;
248 __u32 reserved;
235}; 249};
236 250
237struct ib_uverbs_query_port { 251struct ib_uverbs_query_port {