Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 122078
b: refs/heads/master
c: 8459645
h: refs/heads/master
v: v3
  • Loading branch information
Scott Feldman authored and David S. Miller committed Nov 22, 2008
1 parent 40d6b31 commit 0a9b03e
Show file tree
Hide file tree
Showing 4 changed files with 17 additions and 7 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: cb3c766975985885e64e20cc72c4a36d90da2b30
refs/heads/master: 845964515a76381e204d3399af82c149f8abcc1c
4 changes: 0 additions & 4 deletions trunk/drivers/net/enic/enic_res.h
Original file line number Diff line number Diff line change
Expand Up @@ -58,8 +58,6 @@ static inline void enic_queue_wq_desc_ex(struct vnic_wq *wq,
(u16)vlan_tag,
0 /* loopback */);

wmb();

vnic_wq_post(wq, os_buf, dma_addr, len, sop, eop);
}

Expand Down Expand Up @@ -127,8 +125,6 @@ static inline void enic_queue_rq_desc(struct vnic_rq *rq,
(u64)dma_addr | VNIC_PADDR_TARGET,
type, (u16)len);

wmb();

vnic_rq_post(rq, os_buf, os_buf_index, dma_addr, len);
}

Expand Down
9 changes: 8 additions & 1 deletion trunk/drivers/net/enic/vnic_rq.h
Original file line number Diff line number Diff line change
Expand Up @@ -132,8 +132,15 @@ static inline void vnic_rq_post(struct vnic_rq *rq,
#define VNIC_RQ_RETURN_RATE 0xf /* keep 2^n - 1 */
#endif

if ((buf->index & VNIC_RQ_RETURN_RATE) == 0)
if ((buf->index & VNIC_RQ_RETURN_RATE) == 0) {
/* Adding write memory barrier prevents compiler and/or CPU
* reordering, thus avoiding descriptor posting before
* descriptor is initialized. Otherwise, hardware can read
* stale descriptor fields.
*/
wmb();
iowrite32(buf->index, &rq->ctrl->posted_index);
}
}

static inline void vnic_rq_return_descs(struct vnic_rq *rq, unsigned int count)
Expand Down
9 changes: 8 additions & 1 deletion trunk/drivers/net/enic/vnic_wq.h
Original file line number Diff line number Diff line change
Expand Up @@ -108,8 +108,15 @@ static inline void vnic_wq_post(struct vnic_wq *wq,
buf->len = len;

buf = buf->next;
if (eop)
if (eop) {
/* Adding write memory barrier prevents compiler and/or CPU
* reordering, thus avoiding descriptor posting before
* descriptor is initialized. Otherwise, hardware can read
* stale descriptor fields.
*/
wmb();
iowrite32(buf->index, &wq->ctrl->posted_index);
}
wq->to_use = buf;

wq->ring.desc_avail--;
Expand Down

0 comments on commit 0a9b03e

Please sign in to comment.