aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/cxgb3/cxgb3_main.c
diff options
context:
space:
mode:
authorDivy Le Ray <divy@chelsio.com>2008-12-16 04:09:39 -0500
committerDavid S. Miller <davem@davemloft.net>2008-12-16 04:09:39 -0500
commit82ad33297410c1af8e993210da76e114a4c1670d (patch)
tree63044ca2d003efc85461a5e0943a175dbc960742 /drivers/net/cxgb3/cxgb3_main.c
parent89c88b16f12e9df9ac39418638f267ec3b36a6c6 (diff)
cxgb3: Add multiple Tx queue support.
Implement NIC Tx multiqueue. Bump up driver version. Signed-off-by: Divy Le Ray <divy@chelsio.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/cxgb3/cxgb3_main.c')
-rw-r--r--drivers/net/cxgb3/cxgb3_main.c11
1 files changed, 7 insertions, 4 deletions
diff --git a/drivers/net/cxgb3/cxgb3_main.c b/drivers/net/cxgb3/cxgb3_main.c
index 46c114e928a0..9e8727c5eced 100644
--- a/drivers/net/cxgb3/cxgb3_main.c
+++ b/drivers/net/cxgb3/cxgb3_main.c
@@ -550,7 +550,8 @@ static int setup_sge_qsets(struct adapter *adap)
550 err = t3_sge_alloc_qset(adap, qset_idx, 1, 550 err = t3_sge_alloc_qset(adap, qset_idx, 1,
551 (adap->flags & USING_MSIX) ? qset_idx + 1 : 551 (adap->flags & USING_MSIX) ? qset_idx + 1 :
552 irq_idx, 552 irq_idx,
553 &adap->params.sge.qset[qset_idx], ntxq, dev); 553 &adap->params.sge.qset[qset_idx], ntxq, dev,
554 netdev_get_tx_queue(dev, j));
554 if (err) { 555 if (err) {
555 t3_stop_sge_timers(adap); 556 t3_stop_sge_timers(adap);
556 t3_free_sge_resources(adap); 557 t3_free_sge_resources(adap);
@@ -1165,9 +1166,10 @@ static int cxgb_open(struct net_device *dev)
1165 "Could not initialize offload capabilities\n"); 1166 "Could not initialize offload capabilities\n");
1166 } 1167 }
1167 1168
1169 dev->real_num_tx_queues = pi->nqsets;
1168 link_start(dev); 1170 link_start(dev);
1169 t3_port_intr_enable(adapter, pi->port_id); 1171 t3_port_intr_enable(adapter, pi->port_id);
1170 netif_start_queue(dev); 1172 netif_tx_start_all_queues(dev);
1171 if (!other_ports) 1173 if (!other_ports)
1172 schedule_chk_task(adapter); 1174 schedule_chk_task(adapter);
1173 1175
@@ -1180,7 +1182,7 @@ static int cxgb_close(struct net_device *dev)
1180 struct adapter *adapter = pi->adapter; 1182 struct adapter *adapter = pi->adapter;
1181 1183
1182 t3_port_intr_disable(adapter, pi->port_id); 1184 t3_port_intr_disable(adapter, pi->port_id);
1183 netif_stop_queue(dev); 1185 netif_tx_stop_all_queues(dev);
1184 pi->phy.ops->power_down(&pi->phy, 1); 1186 pi->phy.ops->power_down(&pi->phy, 1);
1185 netif_carrier_off(dev); 1187 netif_carrier_off(dev);
1186 t3_mac_disable(&pi->mac, MAC_DIRECTION_TX | MAC_DIRECTION_RX); 1188 t3_mac_disable(&pi->mac, MAC_DIRECTION_TX | MAC_DIRECTION_RX);
@@ -2932,7 +2934,7 @@ static int __devinit init_one(struct pci_dev *pdev,
2932 for (i = 0; i < ai->nports; ++i) { 2934 for (i = 0; i < ai->nports; ++i) {
2933 struct net_device *netdev; 2935 struct net_device *netdev;
2934 2936
2935 netdev = alloc_etherdev(sizeof(struct port_info)); 2937 netdev = alloc_etherdev_mq(sizeof(struct port_info), SGE_QSETS);
2936 if (!netdev) { 2938 if (!netdev) {
2937 err = -ENOMEM; 2939 err = -ENOMEM;
2938 goto out_free_dev; 2940 goto out_free_dev;
@@ -2946,6 +2948,7 @@ static int __devinit init_one(struct pci_dev *pdev,
2946 pi->rx_csum_offload = 1; 2948 pi->rx_csum_offload = 1;
2947 pi->port_id = i; 2949 pi->port_id = i;
2948 netif_carrier_off(netdev); 2950 netif_carrier_off(netdev);
2951 netif_tx_stop_all_queues(netdev);
2949 netdev->irq = pdev->irq; 2952 netdev->irq = pdev->irq;
2950 netdev->mem_start = mmio_start; 2953 netdev->mem_start = mmio_start;
2951 netdev->mem_end = mmio_start + mmio_len - 1; 2954 netdev->mem_end = mmio_start + mmio_len - 1;