|
@@ -2206,6 +2206,31 @@ static void qlcnic_82xx_set_mac_filter_count(struct qlcnic_adapter *adapter)
|
|
ahw->max_uc_count = count;
|
|
ahw->max_uc_count = count;
|
|
}
|
|
}
|
|
|
|
|
|
|
|
+static int qlcnic_set_real_num_queues(struct qlcnic_adapter *adapter,
|
|
|
|
+ u8 tx_queues, u8 rx_queues)
|
|
|
|
+{
|
|
|
|
+ struct net_device *netdev = adapter->netdev;
|
|
|
|
+ int err = 0;
|
|
|
|
+
|
|
|
|
+ if (tx_queues) {
|
|
|
|
+ err = netif_set_real_num_tx_queues(netdev, tx_queues);
|
|
|
|
+ if (err) {
|
|
|
|
+ netdev_err(netdev, "failed to set %d Tx queues\n",
|
|
|
|
+ tx_queues);
|
|
|
|
+ return err;
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ if (rx_queues) {
|
|
|
|
+ err = netif_set_real_num_rx_queues(netdev, rx_queues);
|
|
|
|
+ if (err)
|
|
|
|
+ netdev_err(netdev, "failed to set %d Rx queues\n",
|
|
|
|
+ rx_queues);
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ return err;
|
|
|
|
+}
|
|
|
|
+
|
|
int
|
|
int
|
|
qlcnic_setup_netdev(struct qlcnic_adapter *adapter, struct net_device *netdev,
|
|
qlcnic_setup_netdev(struct qlcnic_adapter *adapter, struct net_device *netdev,
|
|
int pci_using_dac)
|
|
int pci_using_dac)
|
|
@@ -2269,7 +2294,8 @@ qlcnic_setup_netdev(struct qlcnic_adapter *adapter, struct net_device *netdev,
|
|
netdev->priv_flags |= IFF_UNICAST_FLT;
|
|
netdev->priv_flags |= IFF_UNICAST_FLT;
|
|
netdev->irq = adapter->msix_entries[0].vector;
|
|
netdev->irq = adapter->msix_entries[0].vector;
|
|
|
|
|
|
- err = qlcnic_set_real_num_queues(adapter, netdev);
|
|
|
|
|
|
+ err = qlcnic_set_real_num_queues(adapter, adapter->drv_tx_rings,
|
|
|
|
+ adapter->drv_sds_rings);
|
|
if (err)
|
|
if (err)
|
|
return err;
|
|
return err;
|
|
|
|
|
|
@@ -2943,9 +2969,13 @@ static void qlcnic_dump_tx_rings(struct qlcnic_adapter *adapter)
|
|
tx_ring->tx_stats.xmit_called,
|
|
tx_ring->tx_stats.xmit_called,
|
|
tx_ring->tx_stats.xmit_on,
|
|
tx_ring->tx_stats.xmit_on,
|
|
tx_ring->tx_stats.xmit_off);
|
|
tx_ring->tx_stats.xmit_off);
|
|
|
|
+
|
|
|
|
+ if (tx_ring->crb_intr_mask)
|
|
|
|
+ netdev_info(netdev, "crb_intr_mask=%d\n",
|
|
|
|
+ readl(tx_ring->crb_intr_mask));
|
|
|
|
+
|
|
netdev_info(netdev,
|
|
netdev_info(netdev,
|
|
- "crb_intr_mask=%d, hw_producer=%d, sw_producer=%d sw_consumer=%d, hw_consumer=%d\n",
|
|
|
|
- readl(tx_ring->crb_intr_mask),
|
|
|
|
|
|
+ "hw_producer=%d, sw_producer=%d sw_consumer=%d, hw_consumer=%d\n",
|
|
readl(tx_ring->crb_cmd_producer),
|
|
readl(tx_ring->crb_cmd_producer),
|
|
tx_ring->producer, tx_ring->sw_consumer,
|
|
tx_ring->producer, tx_ring->sw_consumer,
|
|
le32_to_cpu(*(tx_ring->hw_consumer)));
|
|
le32_to_cpu(*(tx_ring->hw_consumer)));
|
|
@@ -3978,12 +4008,21 @@ int qlcnic_validate_rings(struct qlcnic_adapter *adapter, __u32 ring_cnt,
|
|
int qlcnic_setup_rings(struct qlcnic_adapter *adapter)
|
|
int qlcnic_setup_rings(struct qlcnic_adapter *adapter)
|
|
{
|
|
{
|
|
struct net_device *netdev = adapter->netdev;
|
|
struct net_device *netdev = adapter->netdev;
|
|
|
|
+ u8 tx_rings, rx_rings;
|
|
int err;
|
|
int err;
|
|
|
|
|
|
if (test_bit(__QLCNIC_RESETTING, &adapter->state))
|
|
if (test_bit(__QLCNIC_RESETTING, &adapter->state))
|
|
return -EBUSY;
|
|
return -EBUSY;
|
|
|
|
|
|
|
|
+ tx_rings = adapter->drv_tss_rings;
|
|
|
|
+ rx_rings = adapter->drv_rss_rings;
|
|
|
|
+
|
|
netif_device_detach(netdev);
|
|
netif_device_detach(netdev);
|
|
|
|
+
|
|
|
|
+ err = qlcnic_set_real_num_queues(adapter, tx_rings, rx_rings);
|
|
|
|
+ if (err)
|
|
|
|
+ goto done;
|
|
|
|
+
|
|
if (netif_running(netdev))
|
|
if (netif_running(netdev))
|
|
__qlcnic_down(adapter, netdev);
|
|
__qlcnic_down(adapter, netdev);
|
|
|
|
|
|
@@ -4003,7 +4042,17 @@ int qlcnic_setup_rings(struct qlcnic_adapter *adapter)
|
|
return err;
|
|
return err;
|
|
}
|
|
}
|
|
|
|
|
|
- netif_set_real_num_tx_queues(netdev, adapter->drv_tx_rings);
|
|
|
|
|
|
+ /* Check if we need to update real_num_{tx|rx}_queues because
|
|
|
|
+ * qlcnic_setup_intr() may change Tx/Rx rings size
|
|
|
|
+ */
|
|
|
|
+ if ((tx_rings != adapter->drv_tx_rings) ||
|
|
|
|
+ (rx_rings != adapter->drv_sds_rings)) {
|
|
|
|
+ err = qlcnic_set_real_num_queues(adapter,
|
|
|
|
+ adapter->drv_tx_rings,
|
|
|
|
+ adapter->drv_sds_rings);
|
|
|
|
+ if (err)
|
|
|
|
+ goto done;
|
|
|
|
+ }
|
|
|
|
|
|
if (qlcnic_83xx_check(adapter)) {
|
|
if (qlcnic_83xx_check(adapter)) {
|
|
qlcnic_83xx_initialize_nic(adapter, 1);
|
|
qlcnic_83xx_initialize_nic(adapter, 1);
|