Commit 7fc1c5f3 authored by David S. Miller's avatar David S. Miller

Merge branch 'qlcnic_net'

Rajesh Borundia says:

====================
qlcnic: Bug fixes.

This patch series contain following bug fixes.

* Fix panic where driver was accessing un-initialized crb_intr_mask
  in non Multi-Tx queue mode while dumping TX queue.
* Do not set netdev->real_num_tx_queues directly from driver instead
  use kernel defined netif_set_real_num_tx_queues() API. Also notify
  stack about change in number of Rx queues.

Please apply this series to net.
====================
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parents 76a691d0 84d7ad2c
...@@ -1719,22 +1719,6 @@ static inline u32 qlcnic_tx_avail(struct qlcnic_host_tx_ring *tx_ring) ...@@ -1719,22 +1719,6 @@ static inline u32 qlcnic_tx_avail(struct qlcnic_host_tx_ring *tx_ring)
tx_ring->producer; tx_ring->producer;
} }
static inline int qlcnic_set_real_num_queues(struct qlcnic_adapter *adapter,
struct net_device *netdev)
{
int err;
netdev->num_tx_queues = adapter->drv_tx_rings;
netdev->real_num_tx_queues = adapter->drv_tx_rings;
err = netif_set_real_num_tx_queues(netdev, adapter->drv_tx_rings);
if (err)
netdev_err(netdev, "failed to set %d Tx queues\n",
adapter->drv_tx_rings);
return err;
}
struct qlcnic_nic_template { struct qlcnic_nic_template {
int (*config_bridged_mode) (struct qlcnic_adapter *, u32); int (*config_bridged_mode) (struct qlcnic_adapter *, u32);
int (*config_led) (struct qlcnic_adapter *, u32, u32); int (*config_led) (struct qlcnic_adapter *, u32, u32);
......
...@@ -2206,6 +2206,31 @@ static void qlcnic_82xx_set_mac_filter_count(struct qlcnic_adapter *adapter) ...@@ -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, ...@@ -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) ...@@ -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", "hw_producer=%d, sw_producer=%d sw_consumer=%d, hw_consumer=%d\n",
readl(tx_ring->crb_intr_mask),
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, ...@@ -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) ...@@ -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);
......
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