diff options
author | Eli Cohen <eli@mellanox.com> | 2016-06-22 16:27:26 +0200 |
---|---|---|
committer | Doug Ledford <dledford@redhat.com> | 2016-06-23 16:03:57 +0200 |
commit | c9b254955b9f8814966f5dabd34c39d0e0a2b437 (patch) | |
tree | e9047224895572e01a408f9d5aaa2c1de32df4b5 /drivers/infiniband | |
parent | IB/uverbs: Initialize ib_qp_init_attr with zeros (diff) | |
download | linux-c9b254955b9f8814966f5dabd34c39d0e0a2b437.tar.xz linux-c9b254955b9f8814966f5dabd34c39d0e0a2b437.zip |
IB/mlx5: Fix post send fence logic
If the caller specified IB_SEND_FENCE in the send flags of the work
request and no previous work request stated that the successive one
should be fenced, the work request would be executed without a fence.
This could result in RDMA read or atomic operations failure due to a MR
being invalidated. Fix this by adding the mlx5 enumeration for fencing
RDMA/atomic operations and fix the logic to apply this.
Fixes: e126ba97dba9 ('mlx5: Add driver for Mellanox Connect-IB adapters')
Signed-off-by: Eli Cohen <eli@mellanox.com>
Signed-off-by: Leon Romanovsky <leon@kernel.org>
Signed-off-by: Doug Ledford <dledford@redhat.com>
Diffstat (limited to 'drivers/infiniband')
-rw-r--r-- | drivers/infiniband/hw/mlx5/qp.c | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/drivers/infiniband/hw/mlx5/qp.c b/drivers/infiniband/hw/mlx5/qp.c index ce434228a5ea..ce0a7ab35a22 100644 --- a/drivers/infiniband/hw/mlx5/qp.c +++ b/drivers/infiniband/hw/mlx5/qp.c @@ -3332,10 +3332,11 @@ static u8 get_fence(u8 fence, struct ib_send_wr *wr) return MLX5_FENCE_MODE_SMALL_AND_FENCE; else return fence; - - } else { - return 0; + } else if (unlikely(wr->send_flags & IB_SEND_FENCE)) { + return MLX5_FENCE_MODE_FENCE; } + + return 0; } static int begin_wqe(struct mlx5_ib_qp *qp, void **seg, |