diff options
Diffstat (limited to 'drivers/net/enic/vnic_wq.h')
-rw-r--r-- | drivers/net/enic/vnic_wq.h | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/drivers/net/enic/vnic_wq.h b/drivers/net/enic/vnic_wq.h index 7081828d8a42..c826137dc651 100644 --- a/drivers/net/enic/vnic_wq.h +++ b/drivers/net/enic/vnic_wq.h | |||
@@ -108,8 +108,15 @@ static inline void vnic_wq_post(struct vnic_wq *wq, | |||
108 | buf->len = len; | 108 | buf->len = len; |
109 | 109 | ||
110 | buf = buf->next; | 110 | buf = buf->next; |
111 | if (eop) | 111 | if (eop) { |
112 | /* Adding write memory barrier prevents compiler and/or CPU | ||
113 | * reordering, thus avoiding descriptor posting before | ||
114 | * descriptor is initialized. Otherwise, hardware can read | ||
115 | * stale descriptor fields. | ||
116 | */ | ||
117 | wmb(); | ||
112 | iowrite32(buf->index, &wq->ctrl->posted_index); | 118 | iowrite32(buf->index, &wq->ctrl->posted_index); |
119 | } | ||
113 | wq->to_use = buf; | 120 | wq->to_use = buf; |
114 | 121 | ||
115 | wq->ring.desc_avail--; | 122 | wq->ring.desc_avail--; |