qlcnic: Enable multiple Tx queue support for 83xx/84xx Series adapters.
authorHimanshu Madhani <himanshu.madhani@qlogic.com>
Mon, 4 Nov 2013 18:31:32 +0000 (13:31 -0500)
committerDavid S. Miller <davem@davemloft.net>
Mon, 4 Nov 2013 20:33:19 +0000 (15:33 -0500)
o 83xx and 84xx firmware is capable of multiple Tx queues.
  This patch will enable multiple Tx queues for 83xx/84xx
  series adapters. Max number of Tx queues supported will be 8.

Signed-off-by: Himanshu Madhani <himanshu.madhani@qlogic.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/ethernet/qlogic/qlcnic/qlcnic_83xx_hw.c
drivers/net/ethernet/qlogic/qlcnic/qlcnic_83xx_init.c
drivers/net/ethernet/qlogic/qlcnic/qlcnic_ethtool.c
drivers/net/ethernet/qlogic/qlcnic/qlcnic_io.c
drivers/net/ethernet/qlogic/qlcnic/qlcnic_main.c

index df6c6f51c609bd04252968cf35b4066d0d5b6a62..09810ddd11ec3231bb34c6e79e3235c24bbcc546 100644 (file)
@@ -1654,6 +1654,7 @@ int qlcnic_83xx_loopback_test(struct net_device *netdev, u8 mode)
        struct qlcnic_adapter *adapter = netdev_priv(netdev);
        struct qlcnic_hardware_context *ahw = adapter->ahw;
        u8 drv_sds_rings = adapter->drv_sds_rings;
+       u8 drv_tx_rings = adapter->drv_tx_rings;
        int ret = 0, loop = 0;
 
        if (ahw->op_mode == QLCNIC_NON_PRIV_FUNC) {
@@ -1718,6 +1719,7 @@ free_diag_res:
 
 fail_diag_alloc:
        adapter->drv_sds_rings = drv_sds_rings;
+       adapter->drv_tx_rings = drv_tx_rings;
        qlcnic_release_diag_lock(adapter);
        return ret;
 }
@@ -3303,6 +3305,7 @@ int qlcnic_83xx_interrupt_test(struct net_device *netdev)
        struct qlcnic_hardware_context *ahw = adapter->ahw;
        struct qlcnic_cmd_args cmd;
        u8 val, drv_sds_rings = adapter->drv_sds_rings;
+       u8 drv_tx_rings = adapter->drv_tx_rings;
        u32 data;
        u16 intrpt_id, id;
        int ret;
@@ -3359,6 +3362,7 @@ done:
 
 fail_diag_irq:
        adapter->drv_sds_rings = drv_sds_rings;
+       adapter->drv_tx_rings = drv_tx_rings;
        qlcnic_release_diag_lock(adapter);
        return ret;
 }
index 5682a40eb8a7d06fb2f943dfb5e91676f71b0659..89208e5b25d6a1bc5c829a52ea2d79edcb5d110e 100644 (file)
@@ -2068,13 +2068,13 @@ int qlcnic_83xx_configure_opmode(struct qlcnic_adapter *adapter)
                        return -EIO;
 
                adapter->max_sds_rings = QLCNIC_MAX_VNIC_SDS_RINGS;
-               adapter->max_tx_rings = QLCNIC_SINGLE_RING;
+               adapter->max_tx_rings = QLCNIC_MAX_VNIC_TX_RINGS;
        } else if (ret == QLC_83XX_DEFAULT_OPMODE) {
                ahw->nic_mode = QLCNIC_DEFAULT_MODE;
                adapter->nic_ops->init_driver = qlcnic_83xx_init_default_driver;
                ahw->idc.state_entry = qlcnic_83xx_idc_ready_state_entry;
                adapter->max_sds_rings = ahw->max_rx_ques;
-               adapter->max_tx_rings = QLCNIC_SINGLE_RING;
+               adapter->max_tx_rings = ahw->max_tx_ques;
        } else {
                return -EIO;
        }
@@ -2179,16 +2179,20 @@ static int qlcnic_83xx_get_fw_info(struct qlcnic_adapter *adapter)
 
 static void qlcnic_83xx_init_rings(struct qlcnic_adapter *adapter)
 {
+       u8 rx_cnt = QLCNIC_DEF_SDS_RINGS;
+       u8 tx_cnt = QLCNIC_DEF_TX_RINGS;
+
        adapter->max_tx_rings = QLCNIC_MAX_TX_RINGS;
        adapter->max_sds_rings = QLCNIC_MAX_SDS_RINGS;
 
-       qlcnic_set_tx_ring_count(adapter, QLCNIC_SINGLE_RING);
+       if (!adapter->ahw->msix_supported) {
+               rx_cnt = QLCNIC_SINGLE_RING;
+               tx_cnt = QLCNIC_SINGLE_RING;
+       }
 
        /* compute and set drv sds rings */
-       if (adapter->ahw->msix_supported)
-               qlcnic_set_sds_ring_count(adapter, QLCNIC_DEF_SDS_RINGS);
-       else
-               qlcnic_set_sds_ring_count(adapter, QLCNIC_SINGLE_RING);
+       qlcnic_set_tx_ring_count(adapter, tx_cnt);
+       qlcnic_set_sds_ring_count(adapter, rx_cnt);
 }
 
 int qlcnic_83xx_init(struct qlcnic_adapter *adapter, int pci_using_dac)
index 225743cc82ebb573da6bb8af6db8498d646a1394..b36c02fafcfd1ebe6f6ce8da49e73f73364f64b5 100644 (file)
@@ -731,7 +731,7 @@ static int qlcnic_set_channels(struct net_device *dev,
                }
        }
 
-       if (qlcnic_82xx_check(adapter) && channel->tx_count) {
+       if (channel->tx_count) {
                err = qlcnic_validate_rings(adapter, channel->tx_count,
                                            QLCNIC_TX_QUEUE);
                if (err) {
index 1c07ec250f237827a09ea4ca98989cde27302493..0149c94953474e6ad0ffd56b93cc440c67e77687 100644 (file)
@@ -581,10 +581,7 @@ netdev_tx_t qlcnic_xmit_frame(struct sk_buff *skb, struct net_device *netdev)
                        goto drop_packet;
        }
 
-       if (qlcnic_check_multi_tx(adapter))
-               tx_ring = &adapter->tx_ring[skb_get_queue_mapping(skb)];
-       else
-               tx_ring = &adapter->tx_ring[0];
+       tx_ring = &adapter->tx_ring[skb_get_queue_mapping(skb)];
        num_txd = tx_ring->num_desc;
 
        frag_count = skb_shinfo(skb)->nr_frags + 1;
index 007b7df7351055377c13f86bca647f1805f047f7..05c1eef8df1325359ef1bf73df8344492a95876d 100644 (file)
@@ -3710,11 +3710,7 @@ int qlcnic_validate_rings(struct qlcnic_adapter *adapter, __u32 ring_cnt,
                cur_rings = adapter->drv_sds_rings;
                strcpy(buf, "SDS");
        } else if (queue_type == QLCNIC_TX_QUEUE) {
-               if (qlcnic_83xx_check(adapter))
-                       max_hw_rings = QLCNIC_SINGLE_RING;
-               else
-                       max_hw_rings = adapter->max_tx_rings;
-
+               max_hw_rings = adapter->max_tx_rings;
                cur_rings = adapter->drv_tx_rings;
                strcpy(buf, "Tx");
        }