From: Valentine Fatiev <valentinef@nvidia.com>
Subject: [PATCH] BACKPORT: drivers/infiniband/hw/mlx5/wr.c

Change-Id: Ib34ec9ec88f0dc773a11334a81603496849b753d
---
 drivers/infiniband/hw/mlx5/wr.c | 5 +++++
 1 file changed, 5 insertions(+)

--- a/drivers/infiniband/hw/mlx5/wr.c
+++ b/drivers/infiniband/hw/mlx5/wr.c
@@ -419,10 +419,14 @@ static void set_reg_mkey_segment(struct
 		MLX5_SET(mkc, seg, relaxed_ordering_write,
 			 !!(umrwr->access_flags & IB_ACCESS_RELAXED_ORDERING));
 	if (MLX5_CAP_GEN(dev->mdev, relaxed_ordering_read_umr))
+#ifdef HAVE_PCIE_RELAXED_ORDERING_ENABLED
 		if (umrwr->access_flags & IB_ACCESS_RELAXED_ORDERING &&
 		    (MLX5_CAP_GEN(dev->mdev, relaxed_ordering_read) ||
 		     mlx5_core_is_vf(dev->mdev) ||
 		     pcie_relaxed_ordering_enabled(dev->mdev->pdev)))
+#else
+		if (umrwr->access_flags & IB_ACCESS_RELAXED_ORDERING)
+#endif
 			MLX5_SET(mkc, seg, relaxed_ordering_read, 1);
 
 	if (umrwr->pd)
@@ -1374,6 +1378,7 @@ int mlx5_ib_post_send(struct ib_qp *ibqp
 			seg += sizeof(*xrc);
 			size += sizeof(*xrc) / 16;
 			fallthrough;
+
 		case IB_QPT_RC:
 			err = handle_qpt_rc(dev, qp, wr, &ctrl, &seg, &size,
 					    &cur_edge, &idx, nreq, fence,
