diff options
author | Ralph Campbell <ralph.campbell@qlogic.com> | 2007-07-06 23:48:23 +0400 |
---|---|---|
committer | Roland Dreier <rolandd@cisco.com> | 2007-07-10 07:12:26 +0400 |
commit | 4fc570bcbe77f823aae183dd824869f79e74cc97 (patch) | |
tree | 3955946608a973b06db8b7e5b3ec319354a6fa73 /drivers/infiniband/hw/ipath/ipath_verbs.c | |
parent | 06cc85086e6896939f8c68f8518224748f6b0b2f (diff) | |
download | linux-4fc570bcbe77f823aae183dd824869f79e74cc97.tar.xz |
IB/ipath: Add barrier before updating WC head in shared memory
Add a barrier to make sure the CPU doesn't reorder writes to memory,
since user programs can be polling on the head index update and the
entry should be written before that.
Signed-off-by: Ralph Campbell <ralph.campbell@qlogic.com>
Signed-off-by: Roland Dreier <rolandd@cisco.com>
Diffstat (limited to 'drivers/infiniband/hw/ipath/ipath_verbs.c')
-rw-r--r-- | drivers/infiniband/hw/ipath/ipath_verbs.c | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/drivers/infiniband/hw/ipath/ipath_verbs.c b/drivers/infiniband/hw/ipath/ipath_verbs.c index 0aecded6af86..c76ea0e0b024 100644 --- a/drivers/infiniband/hw/ipath/ipath_verbs.c +++ b/drivers/infiniband/hw/ipath/ipath_verbs.c @@ -327,6 +327,8 @@ static int ipath_post_receive(struct ib_qp *ibqp, struct ib_recv_wr *wr, wqe->num_sge = wr->num_sge; for (i = 0; i < wr->num_sge; i++) wqe->sg_list[i] = wr->sg_list[i]; + /* Make sure queue entry is written before the head index. */ + smp_wmb(); wq->head = next; spin_unlock_irqrestore(&qp->r_rq.lock, flags); } |