]> git.ipfire.org Git - thirdparty/kernel/stable-queue.git/blame - queue-5.1/ib-mlx5-report-correctly-tag-matching-rendezvous-capability.patch
5.1-stable patches
[thirdparty/kernel/stable-queue.git] / queue-5.1 / ib-mlx5-report-correctly-tag-matching-rendezvous-capability.patch
CommitLineData
6499e777
GKH
1From 89705e92700170888236555fe91b45e4c1bb0985 Mon Sep 17 00:00:00 2001
2From: Danit Goldberg <danitg@mellanox.com>
3Date: Fri, 5 Jul 2019 19:21:57 +0300
4Subject: IB/mlx5: Report correctly tag matching rendezvous capability
5
6From: Danit Goldberg <danitg@mellanox.com>
7
8commit 89705e92700170888236555fe91b45e4c1bb0985 upstream.
9
10Userspace expects the IB_TM_CAP_RC bit to indicate that the device
11supports RC transport tag matching with rendezvous offload. However the
12firmware splits this into two capabilities for eager and rendezvous tag
13matching.
14
15Only if the FW supports both modes should userspace be told the tag
16matching capability is available.
17
18Cc: <stable@vger.kernel.org> # 4.13
19Fixes: eb761894351d ("IB/mlx5: Fill XRQ capabilities")
20Signed-off-by: Danit Goldberg <danitg@mellanox.com>
21Reviewed-by: Yishai Hadas <yishaih@mellanox.com>
22Reviewed-by: Artemy Kovalyov <artemyko@mellanox.com>
23Signed-off-by: Leon Romanovsky <leonro@mellanox.com>
24Signed-off-by: Jason Gunthorpe <jgg@mellanox.com>
25Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
26
27---
28 drivers/infiniband/hw/mlx5/main.c | 8 ++++++--
29 include/rdma/ib_verbs.h | 4 ++--
30 2 files changed, 8 insertions(+), 4 deletions(-)
31
32--- a/drivers/infiniband/hw/mlx5/main.c
33+++ b/drivers/infiniband/hw/mlx5/main.c
34@@ -1041,15 +1041,19 @@ static int mlx5_ib_query_device(struct i
35 }
36
37 if (MLX5_CAP_GEN(mdev, tag_matching)) {
38- props->tm_caps.max_rndv_hdr_size = MLX5_TM_MAX_RNDV_MSG_SIZE;
39 props->tm_caps.max_num_tags =
40 (1 << MLX5_CAP_GEN(mdev, log_tag_matching_list_sz)) - 1;
41- props->tm_caps.flags = IB_TM_CAP_RC;
42 props->tm_caps.max_ops =
43 1 << MLX5_CAP_GEN(mdev, log_max_qp_sz);
44 props->tm_caps.max_sge = MLX5_TM_MAX_SGE;
45 }
46
47+ if (MLX5_CAP_GEN(mdev, tag_matching) &&
48+ MLX5_CAP_GEN(mdev, rndv_offload_rc)) {
49+ props->tm_caps.flags = IB_TM_CAP_RNDV_RC;
50+ props->tm_caps.max_rndv_hdr_size = MLX5_TM_MAX_RNDV_MSG_SIZE;
51+ }
52+
53 if (MLX5_CAP_GEN(dev->mdev, cq_moderation)) {
54 props->cq_caps.max_cq_moderation_count =
55 MLX5_MAX_CQ_COUNT;
56--- a/include/rdma/ib_verbs.h
57+++ b/include/rdma/ib_verbs.h
58@@ -293,8 +293,8 @@ struct ib_rss_caps {
59 };
60
61 enum ib_tm_cap_flags {
62- /* Support tag matching on RC transport */
63- IB_TM_CAP_RC = 1 << 0,
64+ /* Support tag matching with rendezvous offload for RC transport */
65+ IB_TM_CAP_RNDV_RC = 1 << 0,
66 };
67
68 struct ib_tm_caps {