Commit 18afc102 authored by Himanshu Madhani's avatar Himanshu Madhani Committed by David S. Miller

qlcnic: Enable multiple Tx queue support for 83xx/84xx Series adapters.

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: default avatarHimanshu Madhani <himanshu.madhani@qlogic.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 34e8c406
......@@ -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 @@ int qlcnic_83xx_loopback_test(struct net_device *netdev, u8 mode)
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 @@ int qlcnic_83xx_interrupt_test(struct net_device *netdev)
fail_diag_irq:
adapter->drv_sds_rings = drv_sds_rings;
adapter->drv_tx_rings = drv_tx_rings;
qlcnic_release_diag_lock(adapter);
return ret;
}
......
......@@ -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)
......
......@@ -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) {
......
......@@ -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];
num_txd = tx_ring->num_desc;
frag_count = skb_shinfo(skb)->nr_frags + 1;
......
......@@ -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;
cur_rings = adapter->drv_tx_rings;
strcpy(buf, "Tx");
}
......
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