Skip to content

Commit

Permalink
RDMA/qedr: eliminate duplicate barriers on weakly-ordered archs
Browse files Browse the repository at this point in the history
Code includes wmb() followed by writel() in multiple places. writel()
already has a barrier on some architectures like arm64.

This ends up CPU observing two barriers back to back before executing the
register write.

Since code already has an explicit barrier call, changing writel() to
writel_relaxed().

Signed-off-by: Sinan Kaya <okaya@codeaurora.org>
Signed-off-by: Jason Gunthorpe <jgg@mellanox.com>
  • Loading branch information
Sinan Kaya authored and Jason Gunthorpe committed Mar 15, 2018
1 parent 7b48221 commit 561e5d4
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions drivers/infiniband/hw/qedr/verbs.c
Original file line number Diff line number Diff line change
Expand Up @@ -1870,7 +1870,7 @@ static int qedr_update_qp_state(struct qedr_dev *dev,

if (rdma_protocol_roce(&dev->ibdev, 1)) {
wmb();
writel(qp->rq.db_data.raw, qp->rq.db);
writel_relaxed(qp->rq.db_data.raw, qp->rq.db);
/* Make sure write takes effect */
mmiowb();
}
Expand Down Expand Up @@ -3257,7 +3257,7 @@ int qedr_post_send(struct ib_qp *ibqp, struct ib_send_wr *wr,
* redundant doorbell.
*/
wmb();
writel(qp->sq.db_data.raw, qp->sq.db);
writel_relaxed(qp->sq.db_data.raw, qp->sq.db);

/* Make sure write sticks */
mmiowb();
Expand Down

0 comments on commit 561e5d4

Please sign in to comment.