Commit 31563789 authored by Divy Le Ray's avatar Divy Le Ray Committed by David S. Miller

cxgb3: start qset timers when setup succeeded

Start queue set reclaim timers after the queue sets have been
allocated successfully.
Signed-off-by: default avatarDivy Le Ray <divy@chelsio.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 6d1ec781
...@@ -291,6 +291,7 @@ void t3_os_link_fault_handler(struct adapter *adapter, int port_id); ...@@ -291,6 +291,7 @@ void t3_os_link_fault_handler(struct adapter *adapter, int port_id);
void t3_sge_start(struct adapter *adap); void t3_sge_start(struct adapter *adap);
void t3_sge_stop(struct adapter *adap); void t3_sge_stop(struct adapter *adap);
void t3_start_sge_timers(struct adapter *adap);
void t3_stop_sge_timers(struct adapter *adap); void t3_stop_sge_timers(struct adapter *adap);
void t3_free_sge_resources(struct adapter *adap); void t3_free_sge_resources(struct adapter *adap);
void t3_sge_err_intr_handler(struct adapter *adapter); void t3_sge_err_intr_handler(struct adapter *adapter);
......
...@@ -602,7 +602,6 @@ static int setup_sge_qsets(struct adapter *adap) ...@@ -602,7 +602,6 @@ static int setup_sge_qsets(struct adapter *adap)
&adap->params.sge.qset[qset_idx], ntxq, dev, &adap->params.sge.qset[qset_idx], ntxq, dev,
netdev_get_tx_queue(dev, j)); netdev_get_tx_queue(dev, j));
if (err) { if (err) {
t3_stop_sge_timers(adap);
t3_free_sge_resources(adap); t3_free_sge_resources(adap);
return err; return err;
} }
...@@ -1046,6 +1045,8 @@ static int cxgb_up(struct adapter *adap) ...@@ -1046,6 +1045,8 @@ static int cxgb_up(struct adapter *adap)
setup_rss(adap); setup_rss(adap);
if (!(adap->flags & NAPI_INIT)) if (!(adap->flags & NAPI_INIT))
init_napi(adap); init_napi(adap);
t3_start_sge_timers(adap);
adap->flags |= FULL_INIT_DONE; adap->flags |= FULL_INIT_DONE;
} }
......
...@@ -3044,9 +3044,6 @@ int t3_sge_alloc_qset(struct adapter *adapter, unsigned int id, int nports, ...@@ -3044,9 +3044,6 @@ int t3_sge_alloc_qset(struct adapter *adapter, unsigned int id, int nports,
t3_write_reg(adapter, A_SG_GTS, V_RSPQ(q->rspq.cntxt_id) | t3_write_reg(adapter, A_SG_GTS, V_RSPQ(q->rspq.cntxt_id) |
V_NEWTIMER(q->rspq.holdoff_tmr)); V_NEWTIMER(q->rspq.holdoff_tmr));
mod_timer(&q->tx_reclaim_timer, jiffies + TX_RECLAIM_PERIOD);
mod_timer(&q->rx_reclaim_timer, jiffies + RX_RECLAIM_PERIOD);
return 0; return 0;
err_unlock: err_unlock:
...@@ -3056,6 +3053,27 @@ int t3_sge_alloc_qset(struct adapter *adapter, unsigned int id, int nports, ...@@ -3056,6 +3053,27 @@ int t3_sge_alloc_qset(struct adapter *adapter, unsigned int id, int nports,
return ret; return ret;
} }
/**
* t3_start_sge_timers - start SGE timer call backs
* @adap: the adapter
*
* Starts each SGE queue set's timer call back
*/
void t3_start_sge_timers(struct adapter *adap)
{
int i;
for (i = 0; i < SGE_QSETS; ++i) {
struct sge_qset *q = &adap->sge.qs[i];
if (q->tx_reclaim_timer.function)
mod_timer(&q->tx_reclaim_timer, jiffies + TX_RECLAIM_PERIOD);
if (q->rx_reclaim_timer.function)
mod_timer(&q->rx_reclaim_timer, jiffies + RX_RECLAIM_PERIOD);
}
}
/** /**
* t3_stop_sge_timers - stop SGE timer call backs * t3_stop_sge_timers - stop SGE timer call backs
* @adap: the adapter * @adap: the adapter
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment