* [PATCH net 0/2] Bug fixes.
@ 2014-05-06 7:46 Rajesh Borundia
2014-05-06 7:46 ` [PATCH net 1/2] qlcnic: Fix panic while dumping TX queues on TX timeout Rajesh Borundia
` (2 more replies)
0 siblings, 3 replies; 4+ messages in thread
From: Rajesh Borundia @ 2014-05-06 7:46 UTC (permalink / raw)
To: davem; +Cc: netdev, Dept-HSGLinuxNICDev
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.
Thanks,
Rajesh
Manish Chopra (1):
qlcnic: Fix panic while dumping TX queues on TX timeout
Shahed Shaikh (1):
qlcnic: Set real_num_{tx|rx}_queues properly
drivers/net/ethernet/qlogic/qlcnic/qlcnic.h | 16 ------
drivers/net/ethernet/qlogic/qlcnic/qlcnic_main.c | 57 ++++++++++++++++++++--
2 files changed, 53 insertions(+), 20 deletions(-)
^ permalink raw reply [flat|nested] 4+ messages in thread
* [PATCH net 1/2] qlcnic: Fix panic while dumping TX queues on TX timeout
2014-05-06 7:46 [PATCH net 0/2] Bug fixes Rajesh Borundia
@ 2014-05-06 7:46 ` Rajesh Borundia
2014-05-06 7:46 ` [PATCH net 2/2] qlcnic: Set real_num_{tx|rx}_queues properly Rajesh Borundia
2014-05-07 20:53 ` [PATCH net 0/2] Bug fixes David Miller
2 siblings, 0 replies; 4+ messages in thread
From: Rajesh Borundia @ 2014-05-06 7:46 UTC (permalink / raw)
To: davem; +Cc: netdev, Dept-HSGLinuxNICDev, Manish Chopra
From: Manish Chopra <manish.chopra@qlogic.com>
o In case of non-multi TX queue mode driver does not initialize "crb_intr_mask" pointer
and driver was accessing that un-initialized pointer while dumping TX queue.
So dump "crb_intr_mask" only when it is initilaized.
Signed-off-by: Manish Chopra <manish.chopra@qlogic.com>
---
drivers/net/ethernet/qlogic/qlcnic/qlcnic_main.c | 8 ++++++--
1 files changed, 6 insertions(+), 2 deletions(-)
diff --git a/drivers/net/ethernet/qlogic/qlcnic/qlcnic_main.c b/drivers/net/ethernet/qlogic/qlcnic/qlcnic_main.c
index 0bc9148..be78951 100644
--- a/drivers/net/ethernet/qlogic/qlcnic/qlcnic_main.c
+++ b/drivers/net/ethernet/qlogic/qlcnic/qlcnic_main.c
@@ -2943,9 +2943,13 @@ static void qlcnic_dump_tx_rings(struct qlcnic_adapter *adapter)
tx_ring->tx_stats.xmit_called,
tx_ring->tx_stats.xmit_on,
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,
- "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),
tx_ring->producer, tx_ring->sw_consumer,
le32_to_cpu(*(tx_ring->hw_consumer)));
--
1.6.3.3
^ permalink raw reply related [flat|nested] 4+ messages in thread
* [PATCH net 2/2] qlcnic: Set real_num_{tx|rx}_queues properly
2014-05-06 7:46 [PATCH net 0/2] Bug fixes Rajesh Borundia
2014-05-06 7:46 ` [PATCH net 1/2] qlcnic: Fix panic while dumping TX queues on TX timeout Rajesh Borundia
@ 2014-05-06 7:46 ` Rajesh Borundia
2014-05-07 20:53 ` [PATCH net 0/2] Bug fixes David Miller
2 siblings, 0 replies; 4+ messages in thread
From: Rajesh Borundia @ 2014-05-06 7:46 UTC (permalink / raw)
To: davem; +Cc: netdev, Dept-HSGLinuxNICDev, Shahed Shaikh
From: Shahed Shaikh <shahed.shaikh@qlogic.com>
Do not set netdev->real_num_tx_queues directly,
let netif_set_real_num_tx_queues() take care of it.
Do not overwrite netdev->num_tx_queues everytime when driver
changes its Tx ring size through ethtool -L and also notify
stack to update number of Rx queues.
Signed-off-by: Shahed Shaikh <shahed.shaikh@qlogic.com>
---
drivers/net/ethernet/qlogic/qlcnic/qlcnic.h | 16 -------
drivers/net/ethernet/qlogic/qlcnic/qlcnic_main.c | 49 +++++++++++++++++++++-
2 files changed, 47 insertions(+), 18 deletions(-)
diff --git a/drivers/net/ethernet/qlogic/qlcnic/qlcnic.h b/drivers/net/ethernet/qlogic/qlcnic/qlcnic.h
index 7b52a88..f785d01 100644
--- a/drivers/net/ethernet/qlogic/qlcnic/qlcnic.h
+++ b/drivers/net/ethernet/qlogic/qlcnic/qlcnic.h
@@ -1719,22 +1719,6 @@ static inline u32 qlcnic_tx_avail(struct qlcnic_host_tx_ring *tx_ring)
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 {
int (*config_bridged_mode) (struct qlcnic_adapter *, u32);
int (*config_led) (struct qlcnic_adapter *, u32, u32);
diff --git a/drivers/net/ethernet/qlogic/qlcnic/qlcnic_main.c b/drivers/net/ethernet/qlogic/qlcnic/qlcnic_main.c
index be78951..7e55e88 100644
--- a/drivers/net/ethernet/qlogic/qlcnic/qlcnic_main.c
+++ b/drivers/net/ethernet/qlogic/qlcnic/qlcnic_main.c
@@ -2206,6 +2206,31 @@ static void qlcnic_82xx_set_mac_filter_count(struct qlcnic_adapter *adapter)
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
qlcnic_setup_netdev(struct qlcnic_adapter *adapter, struct net_device *netdev,
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->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)
return err;
@@ -3982,12 +4008,21 @@ int qlcnic_validate_rings(struct qlcnic_adapter *adapter, __u32 ring_cnt,
int qlcnic_setup_rings(struct qlcnic_adapter *adapter)
{
struct net_device *netdev = adapter->netdev;
+ u8 tx_rings, rx_rings;
int err;
if (test_bit(__QLCNIC_RESETTING, &adapter->state))
return -EBUSY;
+ tx_rings = adapter->drv_tss_rings;
+ rx_rings = adapter->drv_rss_rings;
+
netif_device_detach(netdev);
+
+ err = qlcnic_set_real_num_queues(adapter, tx_rings, rx_rings);
+ if (err)
+ goto done;
+
if (netif_running(netdev))
__qlcnic_down(adapter, netdev);
@@ -4007,7 +4042,17 @@ int qlcnic_setup_rings(struct qlcnic_adapter *adapter)
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)) {
qlcnic_83xx_initialize_nic(adapter, 1);
--
1.6.3.3
^ permalink raw reply related [flat|nested] 4+ messages in thread
* Re: [PATCH net 0/2] Bug fixes.
2014-05-06 7:46 [PATCH net 0/2] Bug fixes Rajesh Borundia
2014-05-06 7:46 ` [PATCH net 1/2] qlcnic: Fix panic while dumping TX queues on TX timeout Rajesh Borundia
2014-05-06 7:46 ` [PATCH net 2/2] qlcnic: Set real_num_{tx|rx}_queues properly Rajesh Borundia
@ 2014-05-07 20:53 ` David Miller
2 siblings, 0 replies; 4+ messages in thread
From: David Miller @ 2014-05-07 20:53 UTC (permalink / raw)
To: rajesh.borundia; +Cc: netdev, Dept-HSGLinuxNICDev
From: Rajesh Borundia <rajesh.borundia@qlogic.com>
Date: Tue, 6 May 2014 03:46:47 -0400
> 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.
Series applied, thanks Rajesh.
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2014-05-07 20:53 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-05-06 7:46 [PATCH net 0/2] Bug fixes Rajesh Borundia
2014-05-06 7:46 ` [PATCH net 1/2] qlcnic: Fix panic while dumping TX queues on TX timeout Rajesh Borundia
2014-05-06 7:46 ` [PATCH net 2/2] qlcnic: Set real_num_{tx|rx}_queues properly Rajesh Borundia
2014-05-07 20:53 ` [PATCH net 0/2] Bug fixes David Miller
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).