Skip to content

Commit

Permalink
cxgb3 - Fix I/O synchronization
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Divy Le Ray authored and David S. Miller committed Jan 28, 2008
1 parent a2604be commit afefce6
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions drivers/net/cxgb3/sge.c
Original file line number Diff line number Diff line change
Expand Up @@ -174,6 +174,7 @@ static inline struct sge_qset *txq_to_qset(const struct sge_txq *q, int qidx)
static inline void refill_rspq(struct adapter *adapter,
const struct sge_rspq *q, unsigned int credits)
{
rmb();
t3_write_reg(adapter, A_SG_RSPQ_CREDIT_RETURN,
V_RSPQ(q->cntxt_id) | V_CREDITS(credits));
}
Expand Down Expand Up @@ -458,7 +459,7 @@ nomem: q->alloc_failed++;
}
q->credits++;
}

wmb();
t3_write_reg(adap, A_SG_KDOORBELL, V_EGRCNTX(q->cntxt_id));
}

Expand Down Expand Up @@ -1353,6 +1354,7 @@ static void restart_ctrlq(unsigned long data)
}

spin_unlock(&q->lock);
wmb();
t3_write_reg(qs->adap, A_SG_KDOORBELL,
F_SELEGRCNTX | V_EGRCNTX(q->cntxt_id));
}
Expand Down Expand Up @@ -1572,6 +1574,7 @@ static void restart_offloadq(unsigned long data)
set_bit(TXQ_RUNNING, &q->flags);
set_bit(TXQ_LAST_PKT_DB, &q->flags);
#endif
wmb();
t3_write_reg(adap, A_SG_KDOORBELL,
F_SELEGRCNTX | V_EGRCNTX(q->cntxt_id));
}
Expand Down Expand Up @@ -1737,7 +1740,6 @@ static inline int rx_offload(struct t3cdev *tdev, struct sge_rspq *rq,
struct sk_buff *skb, struct sk_buff *rx_gather[],
unsigned int gather_idx)
{
rq->offload_pkts++;
skb_reset_mac_header(skb);
skb_reset_network_header(skb);
skb_reset_transport_header(skb);
Expand Down Expand Up @@ -2031,6 +2033,7 @@ static int process_responses(struct adapter *adap, struct sge_qset *qs,
if (eth)
rx_eth(adap, q, skb, ethpad);
else {
q->offload_pkts++;
/* Preserve the RSS info in csum & priority */
skb->csum = rss_hi;
skb->priority = rss_lo;
Expand Down

0 comments on commit afefce6

Please sign in to comment.