Skip to content

Commit

Permalink
IB/mlx5: Report correctly tag matching rendezvous capability
Browse files Browse the repository at this point in the history
Userspace expects the IB_TM_CAP_RC bit to indicate that the device
supports RC transport tag matching with rendezvous offload. However the
firmware splits this into two capabilities for eager and rendezvous tag
matching.

Only if the FW supports both modes should userspace be told the tag
matching capability is available.

Cc: <stable@vger.kernel.org> # 4.13
Fixes: eb76189 ("IB/mlx5: Fill XRQ capabilities")
Signed-off-by: Danit Goldberg <danitg@mellanox.com>
Reviewed-by: Yishai Hadas <yishaih@mellanox.com>
Reviewed-by: Artemy Kovalyov <artemyko@mellanox.com>
Signed-off-by: Leon Romanovsky <leonro@mellanox.com>
Signed-off-by: Jason Gunthorpe <jgg@mellanox.com>
  • Loading branch information
Danit Goldberg authored and Jason Gunthorpe committed Jul 8, 2019
1 parent a3a400d commit 89705e9
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 4 deletions.
8 changes: 6 additions & 2 deletions drivers/infiniband/hw/mlx5/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -1046,15 +1046,19 @@ static int mlx5_ib_query_device(struct ib_device *ibdev,
}

if (MLX5_CAP_GEN(mdev, tag_matching)) {
props->tm_caps.max_rndv_hdr_size = MLX5_TM_MAX_RNDV_MSG_SIZE;
props->tm_caps.max_num_tags =
(1 << MLX5_CAP_GEN(mdev, log_tag_matching_list_sz)) - 1;
props->tm_caps.flags = IB_TM_CAP_RC;
props->tm_caps.max_ops =
1 << MLX5_CAP_GEN(mdev, log_max_qp_sz);
props->tm_caps.max_sge = MLX5_TM_MAX_SGE;
}

if (MLX5_CAP_GEN(mdev, tag_matching) &&
MLX5_CAP_GEN(mdev, rndv_offload_rc)) {
props->tm_caps.flags = IB_TM_CAP_RNDV_RC;
props->tm_caps.max_rndv_hdr_size = MLX5_TM_MAX_RNDV_MSG_SIZE;
}

if (MLX5_CAP_GEN(dev->mdev, cq_moderation)) {
props->cq_caps.max_cq_moderation_count =
MLX5_MAX_CQ_COUNT;
Expand Down
4 changes: 2 additions & 2 deletions include/rdma/ib_verbs.h
Original file line number Diff line number Diff line change
Expand Up @@ -307,8 +307,8 @@ struct ib_rss_caps {
};

enum ib_tm_cap_flags {
/* Support tag matching on RC transport */
IB_TM_CAP_RC = 1 << 0,
/* Support tag matching with rendezvous offload for RC transport */
IB_TM_CAP_RNDV_RC = 1 << 0,
};

struct ib_tm_caps {
Expand Down

0 comments on commit 89705e9

Please sign in to comment.