All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH net 0/3] qlcnic: Bug fixes
@ 2014-08-04 15:51 Rajesh Borundia
  2014-08-04 15:51 ` [PATCH net 1/3] qlcnic: Fix update of ethtool stats Rajesh Borundia
                   ` (3 more replies)
  0 siblings, 4 replies; 5+ messages in thread
From: Rajesh Borundia @ 2014-08-04 15:51 UTC (permalink / raw)
  To: davem; +Cc: netdev, Dept-HSGLinuxNICDev

The patch series contains following bug fixes.

* Aggregating tx stats in adapter variable was resulting
  in increase of stats when user runs ifconfig command
  and no traffic is running. Instead aggregate tx stats
  in local variable and then assign it to adapter struct
  variable.
* Set_driver_version was called after registering netdev
  which was resulting in a race between FLR in open
  handler and set_driver_version command as open handler
  can be called simulatneously on another cpu even if probe
  is not complete. So call this command before registering
  netdev.
* dcbnl_ops should be initialized before registering netdev
  as they are referenced in open handler.
   
Please apply this series to net.

Thanks,
Rajesh

Rajesh Borundia (3):
  qlcnic: Fix update of ethtool stats.
  qlcnic: Set driver version before registering netdev
  qlcnic: Initialize dcbnl_ops before register_netdev

 drivers/net/ethernet/qlogic/qlcnic/qlcnic_ctx.c    |    2 +-
 .../net/ethernet/qlogic/qlcnic/qlcnic_ethtool.c    |   18 +++++++++++++-----
 drivers/net/ethernet/qlogic/qlcnic/qlcnic_main.c   |   10 +++++-----
 3 files changed, 19 insertions(+), 11 deletions(-)

^ permalink raw reply	[flat|nested] 5+ messages in thread

* [PATCH net 1/3] qlcnic: Fix update of ethtool stats.
  2014-08-04 15:51 [PATCH net 0/3] qlcnic: Bug fixes Rajesh Borundia
@ 2014-08-04 15:51 ` Rajesh Borundia
  2014-08-04 15:51 ` [PATCH net 2/3] qlcnic: Set driver version before registering netdev Rajesh Borundia
                   ` (2 subsequent siblings)
  3 siblings, 0 replies; 5+ messages in thread
From: Rajesh Borundia @ 2014-08-04 15:51 UTC (permalink / raw)
  To: davem; +Cc: netdev, Dept-HSGLinuxNICDev

o Aggregating tx stats in adapter variable was resulting in
  an increase in stats even after no traffic was run and
  user runs ifconfig/ethtool command.
o qlcnic_update_stats used to accumulate stats in adapter
  struct at each function call, instead accumulate tx stats
  in local variable and then assign it to adapter structure.

Reported-by: Holger Kiehl <holger.kiehl@dwd.de>
Signed-off-by: Rajesh Borundia <rajesh.borundia@qlogic.com>
---
 .../net/ethernet/qlogic/qlcnic/qlcnic_ethtool.c    |   18 +++++++++++++-----
 1 files changed, 13 insertions(+), 5 deletions(-)

diff --git a/drivers/net/ethernet/qlogic/qlcnic/qlcnic_ethtool.c b/drivers/net/ethernet/qlogic/qlcnic/qlcnic_ethtool.c
index 1b7f3db..141f116 100644
--- a/drivers/net/ethernet/qlogic/qlcnic/qlcnic_ethtool.c
+++ b/drivers/net/ethernet/qlogic/qlcnic/qlcnic_ethtool.c
@@ -1290,17 +1290,25 @@ static u64 *qlcnic_fill_stats(u64 *data, void *stats, int type)
 
 void qlcnic_update_stats(struct qlcnic_adapter *adapter)
 {
+	struct qlcnic_tx_queue_stats tx_stats;
 	struct qlcnic_host_tx_ring *tx_ring;
 	int ring;
 
+	memset(&tx_stats, 0, sizeof(tx_stats));
 	for (ring = 0; ring < adapter->drv_tx_rings; ring++) {
 		tx_ring = &adapter->tx_ring[ring];
-		adapter->stats.xmit_on += tx_ring->tx_stats.xmit_on;
-		adapter->stats.xmit_off += tx_ring->tx_stats.xmit_off;
-		adapter->stats.xmitcalled += tx_ring->tx_stats.xmit_called;
-		adapter->stats.xmitfinished += tx_ring->tx_stats.xmit_finished;
-		adapter->stats.txbytes += tx_ring->tx_stats.tx_bytes;
+		tx_stats.xmit_on += tx_ring->tx_stats.xmit_on;
+		tx_stats.xmit_off += tx_ring->tx_stats.xmit_off;
+		tx_stats.xmit_called += tx_ring->tx_stats.xmit_called;
+		tx_stats.xmit_finished += tx_ring->tx_stats.xmit_finished;
+		tx_stats.tx_bytes += tx_ring->tx_stats.tx_bytes;
 	}
+
+	adapter->stats.xmit_on = tx_stats.xmit_on;
+	adapter->stats.xmit_off = tx_stats.xmit_off;
+	adapter->stats.xmitcalled = tx_stats.xmit_called;
+	adapter->stats.xmitfinished = tx_stats.xmit_finished;
+	adapter->stats.txbytes = tx_stats.tx_bytes;
 }
 
 static u64 *qlcnic_fill_tx_queue_stats(u64 *data, void *stats)
-- 
1.6.3.3

^ permalink raw reply related	[flat|nested] 5+ messages in thread

* [PATCH net 2/3] qlcnic: Set driver version before registering netdev
  2014-08-04 15:51 [PATCH net 0/3] qlcnic: Bug fixes Rajesh Borundia
  2014-08-04 15:51 ` [PATCH net 1/3] qlcnic: Fix update of ethtool stats Rajesh Borundia
@ 2014-08-04 15:51 ` Rajesh Borundia
  2014-08-04 15:51 ` [PATCH net 3/3] qlcnic: Initialize dcbnl_ops before register_netdev Rajesh Borundia
  2014-08-05 23:24 ` [PATCH net 0/3] qlcnic: Bug fixes David Miller
  3 siblings, 0 replies; 5+ messages in thread
From: Rajesh Borundia @ 2014-08-04 15:51 UTC (permalink / raw)
  To: davem; +Cc: netdev, Dept-HSGLinuxNICDev

o Earlier, set_drv_version was getting called after register_netdev.
  This was resulting in a race between set_drv_version and FLR called
  from open(). Moving set_drv_version before register_netdev avoids
  the race.

o Log response code in error message on CDRP failure.

Signed-off-by: Rajesh Borundia <rajesh.borundia@qlogic.com>
---
 drivers/net/ethernet/qlogic/qlcnic/qlcnic_ctx.c  |    2 +-
 drivers/net/ethernet/qlogic/qlcnic/qlcnic_main.c |    6 +++---
 2 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/drivers/net/ethernet/qlogic/qlcnic/qlcnic_ctx.c b/drivers/net/ethernet/qlogic/qlcnic/qlcnic_ctx.c
index 304e247..ffbae29 100644
--- a/drivers/net/ethernet/qlogic/qlcnic/qlcnic_ctx.c
+++ b/drivers/net/ethernet/qlogic/qlcnic/qlcnic_ctx.c
@@ -136,7 +136,7 @@ int qlcnic_82xx_issue_cmd(struct qlcnic_adapter *adapter,
 	rsp = qlcnic_poll_rsp(adapter);
 
 	if (rsp == QLCNIC_CDRP_RSP_TIMEOUT) {
-		dev_err(&pdev->dev, "card response timeout.\n");
+		dev_err(&pdev->dev, "command timeout, response = 0x%x\n", rsp);
 		cmd->rsp.arg[0] = QLCNIC_RCODE_TIMEOUT;
 	} else if (rsp == QLCNIC_CDRP_RSP_FAIL) {
 		cmd->rsp.arg[0] = QLCRD32(adapter, QLCNIC_CDRP_ARG(1), &err);
diff --git a/drivers/net/ethernet/qlogic/qlcnic/qlcnic_main.c b/drivers/net/ethernet/qlogic/qlcnic/qlcnic_main.c
index 4fc1867..158e1d9 100644
--- a/drivers/net/ethernet/qlogic/qlcnic/qlcnic_main.c
+++ b/drivers/net/ethernet/qlogic/qlcnic/qlcnic_main.c
@@ -2623,13 +2623,13 @@ qlcnic_probe(struct pci_dev *pdev, const struct pci_device_id *ent)
 	if (err)
 		goto err_out_disable_mbx_intr;
 
+	if (adapter->portnum == 0)
+		qlcnic_set_drv_version(adapter);
+
 	err = qlcnic_setup_netdev(adapter, netdev, pci_using_dac);
 	if (err)
 		goto err_out_disable_mbx_intr;
 
-	if (adapter->portnum == 0)
-		qlcnic_set_drv_version(adapter);
-
 	pci_set_drvdata(pdev, adapter);
 
 	if (qlcnic_82xx_check(adapter))
-- 
1.6.3.3

^ permalink raw reply related	[flat|nested] 5+ messages in thread

* [PATCH net 3/3] qlcnic: Initialize dcbnl_ops before register_netdev
  2014-08-04 15:51 [PATCH net 0/3] qlcnic: Bug fixes Rajesh Borundia
  2014-08-04 15:51 ` [PATCH net 1/3] qlcnic: Fix update of ethtool stats Rajesh Borundia
  2014-08-04 15:51 ` [PATCH net 2/3] qlcnic: Set driver version before registering netdev Rajesh Borundia
@ 2014-08-04 15:51 ` Rajesh Borundia
  2014-08-05 23:24 ` [PATCH net 0/3] qlcnic: Bug fixes David Miller
  3 siblings, 0 replies; 5+ messages in thread
From: Rajesh Borundia @ 2014-08-04 15:51 UTC (permalink / raw)
  To: davem; +Cc: netdev, Dept-HSGLinuxNICDev

o Initialization of dcbnl_ops after register netdev may result in
  dcbnl_ops not getting set before it is being accessed from open.
  So, moving it before register_netdev.

Signed-off-by: Rajesh Borundia <rajesh.borundia@qlogic.com>
---
 drivers/net/ethernet/qlogic/qlcnic/qlcnic_main.c |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/net/ethernet/qlogic/qlcnic/qlcnic_main.c b/drivers/net/ethernet/qlogic/qlcnic/qlcnic_main.c
index 158e1d9..3187bc0 100644
--- a/drivers/net/ethernet/qlogic/qlcnic/qlcnic_main.c
+++ b/drivers/net/ethernet/qlogic/qlcnic/qlcnic_main.c
@@ -2323,14 +2323,14 @@ qlcnic_setup_netdev(struct qlcnic_adapter *adapter, struct net_device *netdev,
 	if (err)
 		return err;
 
+	qlcnic_dcb_init_dcbnl_ops(adapter->dcb);
+
 	err = register_netdev(netdev);
 	if (err) {
 		dev_err(&pdev->dev, "failed to register net device\n");
 		return err;
 	}
 
-	qlcnic_dcb_init_dcbnl_ops(adapter->dcb);
-
 	return 0;
 }
 
-- 
1.6.3.3

^ permalink raw reply related	[flat|nested] 5+ messages in thread

* Re: [PATCH net 0/3] qlcnic: Bug fixes
  2014-08-04 15:51 [PATCH net 0/3] qlcnic: Bug fixes Rajesh Borundia
                   ` (2 preceding siblings ...)
  2014-08-04 15:51 ` [PATCH net 3/3] qlcnic: Initialize dcbnl_ops before register_netdev Rajesh Borundia
@ 2014-08-05 23:24 ` David Miller
  3 siblings, 0 replies; 5+ messages in thread
From: David Miller @ 2014-08-05 23:24 UTC (permalink / raw)
  To: rajesh.borundia; +Cc: netdev, Dept-HSGLinuxNICDev

From: Rajesh Borundia <rajesh.borundia@qlogic.com>
Date: Mon, 4 Aug 2014 11:51:15 -0400

> The patch series contains following bug fixes.
> 
> * Aggregating tx stats in adapter variable was resulting
>   in increase of stats when user runs ifconfig command
>   and no traffic is running. Instead aggregate tx stats
>   in local variable and then assign it to adapter struct
>   variable.
> * Set_driver_version was called after registering netdev
>   which was resulting in a race between FLR in open
>   handler and set_driver_version command as open handler
>   can be called simulatneously on another cpu even if probe
>   is not complete. So call this command before registering
>   netdev.
> * dcbnl_ops should be initialized before registering netdev
>   as they are referenced in open handler.
>    
> Please apply this series to net.

Series applied, thanks.

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2014-08-05 23:24 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-08-04 15:51 [PATCH net 0/3] qlcnic: Bug fixes Rajesh Borundia
2014-08-04 15:51 ` [PATCH net 1/3] qlcnic: Fix update of ethtool stats Rajesh Borundia
2014-08-04 15:51 ` [PATCH net 2/3] qlcnic: Set driver version before registering netdev Rajesh Borundia
2014-08-04 15:51 ` [PATCH net 3/3] qlcnic: Initialize dcbnl_ops before register_netdev Rajesh Borundia
2014-08-05 23:24 ` [PATCH net 0/3] qlcnic: Bug fixes David Miller

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.