diff options
author | Scott Feldman <scofeldm@cisco.com> | 2008-11-22 00:29:01 -0500 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2008-11-22 00:29:01 -0500 |
commit | 845964515a76381e204d3399af82c149f8abcc1c (patch) | |
tree | 46f7f16c17294ccf56bd9f964e74a92cf7e7871e /drivers/net/enic/vnic_rq.h | |
parent | cb3c766975985885e64e20cc72c4a36d90da2b30 (diff) |
enic: move wmb closer to where needed: before writing posted_index to hw
Signed-off-by: Scott Feldman <scofeldm@cisco.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/enic/vnic_rq.h')
-rw-r--r-- | drivers/net/enic/vnic_rq.h | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/drivers/net/enic/vnic_rq.h b/drivers/net/enic/vnic_rq.h index 82bfca67cc4d..fd0ef66d2e9f 100644 --- a/drivers/net/enic/vnic_rq.h +++ b/drivers/net/enic/vnic_rq.h | |||
@@ -132,8 +132,15 @@ static inline void vnic_rq_post(struct vnic_rq *rq, | |||
132 | #define VNIC_RQ_RETURN_RATE 0xf /* keep 2^n - 1 */ | 132 | #define VNIC_RQ_RETURN_RATE 0xf /* keep 2^n - 1 */ |
133 | #endif | 133 | #endif |
134 | 134 | ||
135 | if ((buf->index & VNIC_RQ_RETURN_RATE) == 0) | 135 | if ((buf->index & VNIC_RQ_RETURN_RATE) == 0) { |
136 | /* Adding write memory barrier prevents compiler and/or CPU | ||
137 | * reordering, thus avoiding descriptor posting before | ||
138 | * descriptor is initialized. Otherwise, hardware can read | ||
139 | * stale descriptor fields. | ||
140 | */ | ||
141 | wmb(); | ||
136 | iowrite32(buf->index, &rq->ctrl->posted_index); | 142 | iowrite32(buf->index, &rq->ctrl->posted_index); |
143 | } | ||
137 | } | 144 | } |
138 | 145 | ||
139 | static inline void vnic_rq_return_descs(struct vnic_rq *rq, unsigned int count) | 146 | static inline void vnic_rq_return_descs(struct vnic_rq *rq, unsigned int count) |