]>
Commit | Line | Data |
---|---|---|
6499e777 GKH |
1 | From 89705e92700170888236555fe91b45e4c1bb0985 Mon Sep 17 00:00:00 2001 |
2 | From: Danit Goldberg <danitg@mellanox.com> | |
3 | Date: Fri, 5 Jul 2019 19:21:57 +0300 | |
4 | Subject: IB/mlx5: Report correctly tag matching rendezvous capability | |
5 | ||
6 | From: Danit Goldberg <danitg@mellanox.com> | |
7 | ||
8 | commit 89705e92700170888236555fe91b45e4c1bb0985 upstream. | |
9 | ||
10 | Userspace expects the IB_TM_CAP_RC bit to indicate that the device | |
11 | supports RC transport tag matching with rendezvous offload. However the | |
12 | firmware splits this into two capabilities for eager and rendezvous tag | |
13 | matching. | |
14 | ||
15 | Only if the FW supports both modes should userspace be told the tag | |
16 | matching capability is available. | |
17 | ||
18 | Cc: <stable@vger.kernel.org> # 4.13 | |
19 | Fixes: eb761894351d ("IB/mlx5: Fill XRQ capabilities") | |
20 | Signed-off-by: Danit Goldberg <danitg@mellanox.com> | |
21 | Reviewed-by: Yishai Hadas <yishaih@mellanox.com> | |
22 | Reviewed-by: Artemy Kovalyov <artemyko@mellanox.com> | |
23 | Signed-off-by: Leon Romanovsky <leonro@mellanox.com> | |
24 | Signed-off-by: Jason Gunthorpe <jgg@mellanox.com> | |
25 | Signed-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 { |