aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDivy Le Ray <divy@chelsio.com>2009-03-26 12:39:09 -0400
committerDavid S. Miller <davem@davemloft.net>2009-03-27 03:46:56 -0400
commit3156378993b0fc0f9f12f5f297f0a9b4c4fe0fc8 (patch)
tree006025c8420ac7603a7074ee7bc48ddcd6898c10
parent6d1ec7812d6350409ecfe7f6dded3a6c801b89d3 (diff)
cxgb3: start qset timers when setup succeeded
Start queue set reclaim timers after the queue sets have been allocated successfully. Signed-off-by: Divy Le Ray <divy@chelsio.com> Signed-off-by: David S. Miller <davem@davemloft.net>
-rw-r--r--drivers/net/cxgb3/adapter.h1
-rwxr-xr-x[-rw-r--r--]drivers/net/cxgb3/cxgb3_main.c3
-rwxr-xr-x[-rw-r--r--]drivers/net/cxgb3/sge.c24
3 files changed, 24 insertions, 4 deletions
diff --git a/drivers/net/cxgb3/adapter.h b/drivers/net/cxgb3/adapter.h
index 71eaa431371d..2cf6c9299f22 100644
--- a/drivers/net/cxgb3/adapter.h
+++ b/drivers/net/cxgb3/adapter.h
@@ -291,6 +291,7 @@ void t3_os_link_fault_handler(struct adapter *adapter, int port_id);
291 291
292void t3_sge_start(struct adapter *adap); 292void t3_sge_start(struct adapter *adap);
293void t3_sge_stop(struct adapter *adap); 293void t3_sge_stop(struct adapter *adap);
294void t3_start_sge_timers(struct adapter *adap);
294void t3_stop_sge_timers(struct adapter *adap); 295void t3_stop_sge_timers(struct adapter *adap);
295void t3_free_sge_resources(struct adapter *adap); 296void t3_free_sge_resources(struct adapter *adap);
296void t3_sge_err_intr_handler(struct adapter *adapter); 297void t3_sge_err_intr_handler(struct adapter *adapter);
diff --git a/drivers/net/cxgb3/cxgb3_main.c b/drivers/net/cxgb3/cxgb3_main.c
index d8be89621bf7..8ad5f3299baf 100644..100755
--- a/drivers/net/cxgb3/cxgb3_main.c
+++ b/drivers/net/cxgb3/cxgb3_main.c
@@ -602,7 +602,6 @@ static int setup_sge_qsets(struct adapter *adap)
602 &adap->params.sge.qset[qset_idx], ntxq, dev, 602 &adap->params.sge.qset[qset_idx], ntxq, dev,
603 netdev_get_tx_queue(dev, j)); 603 netdev_get_tx_queue(dev, j));
604 if (err) { 604 if (err) {
605 t3_stop_sge_timers(adap);
606 t3_free_sge_resources(adap); 605 t3_free_sge_resources(adap);
607 return err; 606 return err;
608 } 607 }
@@ -1046,6 +1045,8 @@ static int cxgb_up(struct adapter *adap)
1046 setup_rss(adap); 1045 setup_rss(adap);
1047 if (!(adap->flags & NAPI_INIT)) 1046 if (!(adap->flags & NAPI_INIT))
1048 init_napi(adap); 1047 init_napi(adap);
1048
1049 t3_start_sge_timers(adap);
1049 adap->flags |= FULL_INIT_DONE; 1050 adap->flags |= FULL_INIT_DONE;
1050 } 1051 }
1051 1052
diff --git a/drivers/net/cxgb3/sge.c b/drivers/net/cxgb3/sge.c
index a7555cb3fa4a..fcd1a4f4f778 100644..100755
--- a/drivers/net/cxgb3/sge.c
+++ b/drivers/net/cxgb3/sge.c
@@ -3044,9 +3044,6 @@ int t3_sge_alloc_qset(struct adapter *adapter, unsigned int id, int nports,
3044 t3_write_reg(adapter, A_SG_GTS, V_RSPQ(q->rspq.cntxt_id) | 3044 t3_write_reg(adapter, A_SG_GTS, V_RSPQ(q->rspq.cntxt_id) |
3045 V_NEWTIMER(q->rspq.holdoff_tmr)); 3045 V_NEWTIMER(q->rspq.holdoff_tmr));
3046 3046
3047 mod_timer(&q->tx_reclaim_timer, jiffies + TX_RECLAIM_PERIOD);
3048 mod_timer(&q->rx_reclaim_timer, jiffies + RX_RECLAIM_PERIOD);
3049
3050 return 0; 3047 return 0;
3051 3048
3052err_unlock: 3049err_unlock:
@@ -3057,6 +3054,27 @@ err:
3057} 3054}
3058 3055
3059/** 3056/**
3057 * t3_start_sge_timers - start SGE timer call backs
3058 * @adap: the adapter
3059 *
3060 * Starts each SGE queue set's timer call back
3061 */
3062void t3_start_sge_timers(struct adapter *adap)
3063{
3064 int i;
3065
3066 for (i = 0; i < SGE_QSETS; ++i) {
3067 struct sge_qset *q = &adap->sge.qs[i];
3068
3069 if (q->tx_reclaim_timer.function)
3070 mod_timer(&q->tx_reclaim_timer, jiffies + TX_RECLAIM_PERIOD);
3071
3072 if (q->rx_reclaim_timer.function)
3073 mod_timer(&q->rx_reclaim_timer, jiffies + RX_RECLAIM_PERIOD);
3074 }
3075}
3076
3077/**
3060 * t3_stop_sge_timers - stop SGE timer call backs 3078 * t3_stop_sge_timers - stop SGE timer call backs
3061 * @adap: the adapter 3079 * @adap: the adapter
3062 * 3080 *