diff options
author | Divy Le Ray <divy@chelsio.com> | 2007-11-16 14:22:21 -0500 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2008-01-28 18:04:12 -0500 |
commit | afefce66a5c73aef597074b184b83a4df9704afd (patch) | |
tree | 6e877448c409fb68c00492d3e62fb377f1021d8d /drivers/net/cxgb3/sge.c | |
parent | a2604be5488095657aeb1a09c3f08d9f760132ec (diff) |
cxgb3 - Fix I/O synchronization
Synchronize memory access before ringing
the Tx door bell.
Signed-off-by: Divy Le Ray <divy@chelsio.com>
Signed-off-by: Jeff Garzik <jeff@garzik.org>
Diffstat (limited to 'drivers/net/cxgb3/sge.c')
-rw-r--r-- | drivers/net/cxgb3/sge.c | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/drivers/net/cxgb3/sge.c b/drivers/net/cxgb3/sge.c index 7b13d8a31e38..666c317dc6d6 100644 --- a/drivers/net/cxgb3/sge.c +++ b/drivers/net/cxgb3/sge.c | |||
@@ -174,6 +174,7 @@ static inline struct sge_qset *txq_to_qset(const struct sge_txq *q, int qidx) | |||
174 | static inline void refill_rspq(struct adapter *adapter, | 174 | static inline void refill_rspq(struct adapter *adapter, |
175 | const struct sge_rspq *q, unsigned int credits) | 175 | const struct sge_rspq *q, unsigned int credits) |
176 | { | 176 | { |
177 | rmb(); | ||
177 | t3_write_reg(adapter, A_SG_RSPQ_CREDIT_RETURN, | 178 | t3_write_reg(adapter, A_SG_RSPQ_CREDIT_RETURN, |
178 | V_RSPQ(q->cntxt_id) | V_CREDITS(credits)); | 179 | V_RSPQ(q->cntxt_id) | V_CREDITS(credits)); |
179 | } | 180 | } |
@@ -458,7 +459,7 @@ nomem: q->alloc_failed++; | |||
458 | } | 459 | } |
459 | q->credits++; | 460 | q->credits++; |
460 | } | 461 | } |
461 | 462 | wmb(); | |
462 | t3_write_reg(adap, A_SG_KDOORBELL, V_EGRCNTX(q->cntxt_id)); | 463 | t3_write_reg(adap, A_SG_KDOORBELL, V_EGRCNTX(q->cntxt_id)); |
463 | } | 464 | } |
464 | 465 | ||
@@ -1353,6 +1354,7 @@ static void restart_ctrlq(unsigned long data) | |||
1353 | } | 1354 | } |
1354 | 1355 | ||
1355 | spin_unlock(&q->lock); | 1356 | spin_unlock(&q->lock); |
1357 | wmb(); | ||
1356 | t3_write_reg(qs->adap, A_SG_KDOORBELL, | 1358 | t3_write_reg(qs->adap, A_SG_KDOORBELL, |
1357 | F_SELEGRCNTX | V_EGRCNTX(q->cntxt_id)); | 1359 | F_SELEGRCNTX | V_EGRCNTX(q->cntxt_id)); |
1358 | } | 1360 | } |
@@ -1572,6 +1574,7 @@ static void restart_offloadq(unsigned long data) | |||
1572 | set_bit(TXQ_RUNNING, &q->flags); | 1574 | set_bit(TXQ_RUNNING, &q->flags); |
1573 | set_bit(TXQ_LAST_PKT_DB, &q->flags); | 1575 | set_bit(TXQ_LAST_PKT_DB, &q->flags); |
1574 | #endif | 1576 | #endif |
1577 | wmb(); | ||
1575 | t3_write_reg(adap, A_SG_KDOORBELL, | 1578 | t3_write_reg(adap, A_SG_KDOORBELL, |
1576 | F_SELEGRCNTX | V_EGRCNTX(q->cntxt_id)); | 1579 | F_SELEGRCNTX | V_EGRCNTX(q->cntxt_id)); |
1577 | } | 1580 | } |
@@ -1737,7 +1740,6 @@ static inline int rx_offload(struct t3cdev *tdev, struct sge_rspq *rq, | |||
1737 | struct sk_buff *skb, struct sk_buff *rx_gather[], | 1740 | struct sk_buff *skb, struct sk_buff *rx_gather[], |
1738 | unsigned int gather_idx) | 1741 | unsigned int gather_idx) |
1739 | { | 1742 | { |
1740 | rq->offload_pkts++; | ||
1741 | skb_reset_mac_header(skb); | 1743 | skb_reset_mac_header(skb); |
1742 | skb_reset_network_header(skb); | 1744 | skb_reset_network_header(skb); |
1743 | skb_reset_transport_header(skb); | 1745 | skb_reset_transport_header(skb); |
@@ -2031,6 +2033,7 @@ no_mem: | |||
2031 | if (eth) | 2033 | if (eth) |
2032 | rx_eth(adap, q, skb, ethpad); | 2034 | rx_eth(adap, q, skb, ethpad); |
2033 | else { | 2035 | else { |
2036 | q->offload_pkts++; | ||
2034 | /* Preserve the RSS info in csum & priority */ | 2037 | /* Preserve the RSS info in csum & priority */ |
2035 | skb->csum = rss_hi; | 2038 | skb->csum = rss_hi; |
2036 | skb->priority = rss_lo; | 2039 | skb->priority = rss_lo; |