aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/ethernet/chelsio/cxgb4/sge.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/net/ethernet/chelsio/cxgb4/sge.c')
-rw-r--r--drivers/net/ethernet/chelsio/cxgb4/sge.c20
1 files changed, 16 insertions, 4 deletions
diff --git a/drivers/net/ethernet/chelsio/cxgb4/sge.c b/drivers/net/ethernet/chelsio/cxgb4/sge.c
index 234c157a4879..e111d974afd8 100644
--- a/drivers/net/ethernet/chelsio/cxgb4/sge.c
+++ b/drivers/net/ethernet/chelsio/cxgb4/sge.c
@@ -767,8 +767,13 @@ static void write_sgl(const struct sk_buff *skb, struct sge_txq *q,
767static inline void ring_tx_db(struct adapter *adap, struct sge_txq *q, int n) 767static inline void ring_tx_db(struct adapter *adap, struct sge_txq *q, int n)
768{ 768{
769 wmb(); /* write descriptors before telling HW */ 769 wmb(); /* write descriptors before telling HW */
770 t4_write_reg(adap, MYPF_REG(SGE_PF_KDOORBELL), 770 spin_lock(&q->db_lock);
771 QID(q->cntxt_id) | PIDX(n)); 771 if (!q->db_disabled) {
772 t4_write_reg(adap, MYPF_REG(A_SGE_PF_KDOORBELL),
773 V_QID(q->cntxt_id) | V_PIDX(n));
774 }
775 q->db_pidx = q->pidx;
776 spin_unlock(&q->db_lock);
772} 777}
773 778
774/** 779/**
@@ -2081,6 +2086,7 @@ static void init_txq(struct adapter *adap, struct sge_txq *q, unsigned int id)
2081 q->stops = q->restarts = 0; 2086 q->stops = q->restarts = 0;
2082 q->stat = (void *)&q->desc[q->size]; 2087 q->stat = (void *)&q->desc[q->size];
2083 q->cntxt_id = id; 2088 q->cntxt_id = id;
2089 spin_lock_init(&q->db_lock);
2084 adap->sge.egr_map[id - adap->sge.egr_start] = q; 2090 adap->sge.egr_map[id - adap->sge.egr_start] = q;
2085} 2091}
2086 2092
@@ -2415,9 +2421,15 @@ void t4_sge_init(struct adapter *adap)
2415 RXPKTCPLMODE | 2421 RXPKTCPLMODE |
2416 (STAT_LEN == 128 ? EGRSTATUSPAGESIZE : 0)); 2422 (STAT_LEN == 128 ? EGRSTATUSPAGESIZE : 0));
2417 2423
2424 /*
2425 * Set up to drop DOORBELL writes when the DOORBELL FIFO overflows
2426 * and generate an interrupt when this occurs so we can recover.
2427 */
2418 t4_set_reg_field(adap, A_SGE_DBFIFO_STATUS, 2428 t4_set_reg_field(adap, A_SGE_DBFIFO_STATUS,
2419 V_HP_INT_THRESH(5) | V_LP_INT_THRESH(5), 2429 V_HP_INT_THRESH(M_HP_INT_THRESH) |
2420 V_HP_INT_THRESH(5) | V_LP_INT_THRESH(5)); 2430 V_LP_INT_THRESH(M_LP_INT_THRESH),
2431 V_HP_INT_THRESH(dbfifo_int_thresh) |
2432 V_LP_INT_THRESH(dbfifo_int_thresh));
2421 t4_set_reg_field(adap, A_SGE_DOORBELL_CONTROL, F_ENABLE_DROP, 2433 t4_set_reg_field(adap, A_SGE_DOORBELL_CONTROL, F_ENABLE_DROP,
2422 F_ENABLE_DROP); 2434 F_ENABLE_DROP);
2423 2435