All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 0/4] drivers/net: fix too big NAPI weights
@ 2013-08-21 16:49 Michal Schmidt
  2013-08-21 16:49 ` [PATCH 1/4] jme: lower NAPI weight Michal Schmidt
                   ` (3 more replies)
  0 siblings, 4 replies; 21+ messages in thread
From: Michal Schmidt @ 2013-08-21 16:49 UTC (permalink / raw)
  To: David Miller; +Cc: netdev, Eric Dumazet

Some drivers request too big NAPI weights and would trigger the error
message in netif_napi_add() added in commit 82dc3c63. Let's fix them.

Michal Schmidt (4):
  jme: lower NAPI weight
  netxen: lower NAPI weight
  ps3_gelic: lower NAPI weight
  qlcnic: use standard NAPI weights

 drivers/net/ethernet/jme.c                         |  2 +-
 drivers/net/ethernet/qlogic/netxen/netxen_nic.h    |  1 -
 .../net/ethernet/qlogic/netxen/netxen_nic_main.c   |  2 +-
 drivers/net/ethernet/qlogic/qlcnic/qlcnic.h        |  1 -
 drivers/net/ethernet/qlogic/qlcnic/qlcnic_io.c     | 25 +++++++++-------------
 drivers/net/ethernet/toshiba/ps3_gelic_net.c       |  3 +--
 drivers/net/ethernet/toshiba/ps3_gelic_net.h       |  1 -
 7 files changed, 13 insertions(+), 22 deletions(-)

-- 
1.8.3.1

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

* [PATCH 1/4] jme: lower NAPI weight
  2013-08-21 16:49 [PATCH 0/4] drivers/net: fix too big NAPI weights Michal Schmidt
@ 2013-08-21 16:49 ` Michal Schmidt
  2013-08-21 18:15   ` Sergei Shtylyov
  2013-08-21 16:49 ` [PATCH 2/4] netxen: " Michal Schmidt
                   ` (2 subsequent siblings)
  3 siblings, 1 reply; 21+ messages in thread
From: Michal Schmidt @ 2013-08-21 16:49 UTC (permalink / raw)
  To: David Miller; +Cc: netdev, Eric Dumazet, Guo-Fu Tseng

Since commit 82dc3c63 netif_napi_add() produces an error message if
a NAPI poll weight greater than 64 is requested.

jme requests a quarter of the rx ring size as the NAPI weight.
jme's rx ring size is 1 << 9 = 512.

Use the standard NAPI weight.

Signed-off-by: Michal Schmidt <mschmidt@redhat.com>
CC: Guo-Fu Tseng <cooldavid@cooldavid.org>
---
 drivers/net/ethernet/jme.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/net/ethernet/jme.c b/drivers/net/ethernet/jme.c
index 7fbe6ab..23de82a 100644
--- a/drivers/net/ethernet/jme.c
+++ b/drivers/net/ethernet/jme.c
@@ -3069,7 +3069,7 @@ jme_init_one(struct pci_dev *pdev,
 		jwrite32(jme, JME_APMC, apmc);
 	}
 
-	NETIF_NAPI_SET(netdev, &jme->napi, jme_poll, jme->rx_ring_size >> 2)
+	NETIF_NAPI_SET(netdev, &jme->napi, jme_poll, NAPI_POLL_WEIGHT)
 
 	spin_lock_init(&jme->phy_lock);
 	spin_lock_init(&jme->macaddr_lock);
-- 
1.8.3.1

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

* [PATCH 2/4] netxen: lower NAPI weight
  2013-08-21 16:49 [PATCH 0/4] drivers/net: fix too big NAPI weights Michal Schmidt
  2013-08-21 16:49 ` [PATCH 1/4] jme: lower NAPI weight Michal Schmidt
@ 2013-08-21 16:49 ` Michal Schmidt
  2013-08-21 18:16   ` Sergei Shtylyov
  2013-08-21 16:49 ` [PATCH 3/4] ps3_gelic: " Michal Schmidt
  2013-08-21 16:49 ` [PATCH 4/4] qlcnic: use standard NAPI weights Michal Schmidt
  3 siblings, 1 reply; 21+ messages in thread
From: Michal Schmidt @ 2013-08-21 16:49 UTC (permalink / raw)
  To: David Miller
  Cc: netdev, Eric Dumazet, Manish Chopra, Sony Chacko, Rajesh Borundia

Since commit 82dc3c63 netif_napi_add() produces an error message if
a NAPI poll weight greater than 64 is requested.

Use the standard NAPI weight.

Signed-off-by: Michal Schmidt <mschmidt@redhat.com>
CC: Manish Chopra <manish.chopra@qlogic.com>
CC: Sony Chacko <sony.chacko@qlogic.com>
CC: Rajesh Borundia <rajesh.borundia@qlogic.com>
---
 drivers/net/ethernet/qlogic/netxen/netxen_nic.h      | 1 -
 drivers/net/ethernet/qlogic/netxen/netxen_nic_main.c | 2 +-
 2 files changed, 1 insertion(+), 2 deletions(-)

diff --git a/drivers/net/ethernet/qlogic/netxen/netxen_nic.h b/drivers/net/ethernet/qlogic/netxen/netxen_nic.h
index 3fe09ab..32675e1 100644
--- a/drivers/net/ethernet/qlogic/netxen/netxen_nic.h
+++ b/drivers/net/ethernet/qlogic/netxen/netxen_nic.h
@@ -1171,7 +1171,6 @@ typedef struct {
 
 #define NETXEN_DB_MAPSIZE_BYTES    	0x1000
 
-#define NETXEN_NETDEV_WEIGHT 128
 #define NETXEN_ADAPTER_UP_MAGIC 777
 #define NETXEN_NIC_PEG_TUNE 0
 
diff --git a/drivers/net/ethernet/qlogic/netxen/netxen_nic_main.c b/drivers/net/ethernet/qlogic/netxen/netxen_nic_main.c
index 1046e94..cbd75f9 100644
--- a/drivers/net/ethernet/qlogic/netxen/netxen_nic_main.c
+++ b/drivers/net/ethernet/qlogic/netxen/netxen_nic_main.c
@@ -197,7 +197,7 @@ netxen_napi_add(struct netxen_adapter *adapter, struct net_device *netdev)
 	for (ring = 0; ring < adapter->max_sds_rings; ring++) {
 		sds_ring = &recv_ctx->sds_rings[ring];
 		netif_napi_add(netdev, &sds_ring->napi,
-				netxen_nic_poll, NETXEN_NETDEV_WEIGHT);
+				netxen_nic_poll, NAPI_POLL_WEIGHT);
 	}
 
 	return 0;
-- 
1.8.3.1

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

* [PATCH 3/4] ps3_gelic: lower NAPI weight
  2013-08-21 16:49 [PATCH 0/4] drivers/net: fix too big NAPI weights Michal Schmidt
  2013-08-21 16:49 ` [PATCH 1/4] jme: lower NAPI weight Michal Schmidt
  2013-08-21 16:49 ` [PATCH 2/4] netxen: " Michal Schmidt
@ 2013-08-21 16:49 ` Michal Schmidt
  2013-08-21 18:17   ` Sergei Shtylyov
  2013-08-21 21:03   ` Geoff Levand
  2013-08-21 16:49 ` [PATCH 4/4] qlcnic: use standard NAPI weights Michal Schmidt
  3 siblings, 2 replies; 21+ messages in thread
From: Michal Schmidt @ 2013-08-21 16:49 UTC (permalink / raw)
  To: David Miller; +Cc: netdev, Eric Dumazet, Geoff Levand

Since commit 82dc3c63 netif_napi_add() produces an error message if
a NAPI poll weight greater than 64 is requested.

GELIC_NET_NAPI_WEIGHT is defined to GELIC_NET_RX_DESCRIPTORS,
which is 128.

Use the standard NAPI weight.

Signed-off-by: Michal Schmidt <mschmidt@redhat.com>
CC: Geoff Levand <geoff@infradead.org>
---
 drivers/net/ethernet/toshiba/ps3_gelic_net.c | 3 +--
 drivers/net/ethernet/toshiba/ps3_gelic_net.h | 1 -
 2 files changed, 1 insertion(+), 3 deletions(-)

diff --git a/drivers/net/ethernet/toshiba/ps3_gelic_net.c b/drivers/net/ethernet/toshiba/ps3_gelic_net.c
index ad32af6..9c805e0 100644
--- a/drivers/net/ethernet/toshiba/ps3_gelic_net.c
+++ b/drivers/net/ethernet/toshiba/ps3_gelic_net.c
@@ -1466,8 +1466,7 @@ static void gelic_ether_setup_netdev_ops(struct net_device *netdev,
 {
 	netdev->watchdog_timeo = GELIC_NET_WATCHDOG_TIMEOUT;
 	/* NAPI */
-	netif_napi_add(netdev, napi,
-		       gelic_net_poll, GELIC_NET_NAPI_WEIGHT);
+	netif_napi_add(netdev, napi, gelic_net_poll, NAPI_POLL_WEIGHT);
 	netdev->ethtool_ops = &gelic_ether_ethtool_ops;
 	netdev->netdev_ops = &gelic_netdevice_ops;
 }
diff --git a/drivers/net/ethernet/toshiba/ps3_gelic_net.h b/drivers/net/ethernet/toshiba/ps3_gelic_net.h
index a93df6a..309abb4 100644
--- a/drivers/net/ethernet/toshiba/ps3_gelic_net.h
+++ b/drivers/net/ethernet/toshiba/ps3_gelic_net.h
@@ -37,7 +37,6 @@
 #define GELIC_NET_RXBUF_ALIGN           128
 #define GELIC_CARD_RX_CSUM_DEFAULT      1 /* hw chksum */
 #define GELIC_NET_WATCHDOG_TIMEOUT      5*HZ
-#define GELIC_NET_NAPI_WEIGHT           (GELIC_NET_RX_DESCRIPTORS)
 #define GELIC_NET_BROADCAST_ADDR        0xffffffffffffL
 
 #define GELIC_NET_MC_COUNT_MAX          32 /* multicast address list */
-- 
1.8.3.1

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

* [PATCH 4/4] qlcnic: use standard NAPI weights
  2013-08-21 16:49 [PATCH 0/4] drivers/net: fix too big NAPI weights Michal Schmidt
                   ` (2 preceding siblings ...)
  2013-08-21 16:49 ` [PATCH 3/4] ps3_gelic: " Michal Schmidt
@ 2013-08-21 16:49 ` Michal Schmidt
  2013-08-21 18:19   ` Sergei Shtylyov
  2013-08-22  6:51   ` Himanshu Madhani
  3 siblings, 2 replies; 21+ messages in thread
From: Michal Schmidt @ 2013-08-21 16:49 UTC (permalink / raw)
  To: David Miller
  Cc: netdev, Eric Dumazet, Himanshu Madhani, Rajesh Borundia,
	Shahed Shaikh, Jitendra Kalsaria, Sony Chacko,
	Sucheta Chakraborty, linux-driver

Since commit 82dc3c63 netif_napi_add() produces an error message if
a NAPI poll weight greater than 64 is requested.

qlcnic requests the weight as large as 256 for some of its rings, and
smaller values for other rings. For instance in qlcnic_82xx_napi_add()
I think the intention was to give the tx+rx ring a bigger weight than
to rx-only rings, but it's actually doing the opposite. So I'm assuming
the weights do not really matter much.

Just use the standard NAPI weights for all rings.

Signed-off-by: Michal Schmidt <mschmidt@redhat.com>
CC: Himanshu Madhani <himanshu.madhani@qlogic.com>
CC: Rajesh Borundia <rajesh.borundia@qlogic.com>
CC: Shahed Shaikh <shahed.shaikh@qlogic.com>
CC: Jitendra Kalsaria <jitendra.kalsaria@qlogic.com>
CC: Sony Chacko <sony.chacko@qlogic.com>
CC: Sucheta Chakraborty <sucheta.chakraborty@qlogic.com>
CC: linux-driver@qlogic.com
---
 drivers/net/ethernet/qlogic/qlcnic/qlcnic.h    |  1 -
 drivers/net/ethernet/qlogic/qlcnic/qlcnic_io.c | 25 ++++++++++---------------
 2 files changed, 10 insertions(+), 16 deletions(-)

diff --git a/drivers/net/ethernet/qlogic/qlcnic/qlcnic.h b/drivers/net/ethernet/qlogic/qlcnic/qlcnic.h
index 3dcc666..47876a5 100644
--- a/drivers/net/ethernet/qlogic/qlcnic/qlcnic.h
+++ b/drivers/net/ethernet/qlogic/qlcnic/qlcnic.h
@@ -926,7 +926,6 @@ struct qlcnic_ipaddr {
 #define QLCNIC_PCI_REG_MSIX_TBL 	0x44
 #define QLCNIC_MSIX_TBL_PGSIZE		4096
 
-#define QLCNIC_NETDEV_WEIGHT	128
 #define QLCNIC_ADAPTER_UP_MAGIC 777
 
 #define __QLCNIC_FW_ATTACHED		0
diff --git a/drivers/net/ethernet/qlogic/qlcnic/qlcnic_io.c b/drivers/net/ethernet/qlogic/qlcnic/qlcnic_io.c
index cec0908..1a5915d 100644
--- a/drivers/net/ethernet/qlogic/qlcnic/qlcnic_io.c
+++ b/drivers/net/ethernet/qlogic/qlcnic/qlcnic_io.c
@@ -1408,23 +1408,21 @@ void qlcnic_82xx_process_rcv_ring_diag(struct qlcnic_host_sds_ring *sds_ring)
 int qlcnic_82xx_napi_add(struct qlcnic_adapter *adapter,
 			 struct net_device *netdev)
 {
-	int ring, max_sds_rings;
+	int ring;
 	struct qlcnic_host_sds_ring *sds_ring;
 	struct qlcnic_recv_context *recv_ctx = adapter->recv_ctx;
 
 	if (qlcnic_alloc_sds_rings(recv_ctx, adapter->max_sds_rings))
 		return -ENOMEM;
 
-	max_sds_rings = adapter->max_sds_rings;
-
 	for (ring = 0; ring < adapter->max_sds_rings; ring++) {
 		sds_ring = &recv_ctx->sds_rings[ring];
 		if (ring == adapter->max_sds_rings - 1)
 			netif_napi_add(netdev, &sds_ring->napi, qlcnic_poll,
-				       QLCNIC_NETDEV_WEIGHT / max_sds_rings);
+				       NAPI_POLL_WEIGHT);
 		else
 			netif_napi_add(netdev, &sds_ring->napi, qlcnic_rx_poll,
-				       QLCNIC_NETDEV_WEIGHT*2);
+				       NAPI_POLL_WEIGHT);
 	}
 
 	if (qlcnic_alloc_tx_rings(adapter, netdev)) {
@@ -1861,7 +1859,7 @@ void qlcnic_83xx_napi_disable(struct qlcnic_adapter *adapter)
 int qlcnic_83xx_napi_add(struct qlcnic_adapter *adapter,
 			 struct net_device *netdev)
 {
-	int ring, max_sds_rings, temp;
+	int ring;
 	struct qlcnic_host_sds_ring *sds_ring;
 	struct qlcnic_host_tx_ring *tx_ring;
 	struct qlcnic_recv_context *recv_ctx = adapter->recv_ctx;
@@ -1869,25 +1867,22 @@ int qlcnic_83xx_napi_add(struct qlcnic_adapter *adapter,
 	if (qlcnic_alloc_sds_rings(recv_ctx, adapter->max_sds_rings))
 		return -ENOMEM;
 
-	max_sds_rings = adapter->max_sds_rings;
 	for (ring = 0; ring < adapter->max_sds_rings; ring++) {
 		sds_ring = &recv_ctx->sds_rings[ring];
 		if (adapter->flags & QLCNIC_MSIX_ENABLED) {
-			if (!(adapter->flags & QLCNIC_TX_INTR_SHARED)) {
+			if (!(adapter->flags & QLCNIC_TX_INTR_SHARED))
 				netif_napi_add(netdev, &sds_ring->napi,
 					       qlcnic_83xx_rx_poll,
-					       QLCNIC_NETDEV_WEIGHT * 2);
-			} else {
-				temp = QLCNIC_NETDEV_WEIGHT / max_sds_rings;
+					       NAPI_POLL_WEIGHT);
+			else
 				netif_napi_add(netdev, &sds_ring->napi,
 					       qlcnic_83xx_msix_sriov_vf_poll,
-					       temp);
-			}
+					       NAPI_POLL_WEIGHT);
 
 		} else {
 			netif_napi_add(netdev, &sds_ring->napi,
 				       qlcnic_83xx_poll,
-				       QLCNIC_NETDEV_WEIGHT / max_sds_rings);
+				       NAPI_POLL_WEIGHT);
 		}
 	}
 
@@ -1902,7 +1897,7 @@ int qlcnic_83xx_napi_add(struct qlcnic_adapter *adapter,
 			tx_ring = &adapter->tx_ring[ring];
 			netif_napi_add(netdev, &tx_ring->napi,
 				       qlcnic_83xx_msix_tx_poll,
-				       QLCNIC_NETDEV_WEIGHT);
+				       NAPI_POLL_WEIGHT);
 		}
 	}
 
-- 
1.8.3.1

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

* Re: [PATCH 1/4] jme: lower NAPI weight
  2013-08-21 16:49 ` [PATCH 1/4] jme: lower NAPI weight Michal Schmidt
@ 2013-08-21 18:15   ` Sergei Shtylyov
  2013-08-23 13:40     ` [PATCH v2 " Michal Schmidt
  0 siblings, 1 reply; 21+ messages in thread
From: Sergei Shtylyov @ 2013-08-21 18:15 UTC (permalink / raw)
  To: Michal Schmidt; +Cc: David Miller, netdev, Eric Dumazet, Guo-Fu Tseng

Hello.

On 08/21/2013 08:49 PM, Michal Schmidt wrote:

> Since commit 82dc3c63 netif_napi_add() produces an error message if

    Please also specify that commit's summary line in parens.

> a NAPI poll weight greater than 64 is requested.

> jme requests a quarter of the rx ring size as the NAPI weight.
> jme's rx ring size is 1 << 9 = 512.

> Use the standard NAPI weight.

> Signed-off-by: Michal Schmidt <mschmidt@redhat.com>
> CC: Guo-Fu Tseng <cooldavid@cooldavid.org>

WBR, Sergei

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

* Re: [PATCH 2/4] netxen: lower NAPI weight
  2013-08-21 16:49 ` [PATCH 2/4] netxen: " Michal Schmidt
@ 2013-08-21 18:16   ` Sergei Shtylyov
  2013-08-23 13:41     ` [PATCH v2 " Michal Schmidt
  0 siblings, 1 reply; 21+ messages in thread
From: Sergei Shtylyov @ 2013-08-21 18:16 UTC (permalink / raw)
  To: Michal Schmidt
  Cc: David Miller, netdev, Eric Dumazet, Manish Chopra, Sony Chacko,
	Rajesh Borundia

On 08/21/2013 08:49 PM, Michal Schmidt wrote:

> Since commit 82dc3c63 netif_napi_add() produces an error message if

    Likewise, need summary line in parens.

> a NAPI poll weight greater than 64 is requested.

> Use the standard NAPI weight.

> Signed-off-by: Michal Schmidt <mschmidt@redhat.com>
> CC: Manish Chopra <manish.chopra@qlogic.com>
> CC: Sony Chacko <sony.chacko@qlogic.com>
> CC: Rajesh Borundia <rajesh.borundia@qlogic.com>

WBR, Sergei

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

* Re: [PATCH 3/4] ps3_gelic: lower NAPI weight
  2013-08-21 16:49 ` [PATCH 3/4] ps3_gelic: " Michal Schmidt
@ 2013-08-21 18:17   ` Sergei Shtylyov
  2013-08-21 21:03   ` Geoff Levand
  1 sibling, 0 replies; 21+ messages in thread
From: Sergei Shtylyov @ 2013-08-21 18:17 UTC (permalink / raw)
  To: Michal Schmidt; +Cc: David Miller, netdev, Eric Dumazet, Geoff Levand

On 08/21/2013 08:49 PM, Michal Schmidt wrote:

> Since commit 82dc3c63 netif_napi_add() produces an error message if

    Likewise, need a summary line.

> a NAPI poll weight greater than 64 is requested.

> GELIC_NET_NAPI_WEIGHT is defined to GELIC_NET_RX_DESCRIPTORS,
> which is 128.

> Use the standard NAPI weight.

> Signed-off-by: Michal Schmidt <mschmidt@redhat.com>
> CC: Geoff Levand <geoff@infradead.org>

WBR, Sergei

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

* Re: [PATCH 4/4] qlcnic: use standard NAPI weights
  2013-08-21 16:49 ` [PATCH 4/4] qlcnic: use standard NAPI weights Michal Schmidt
@ 2013-08-21 18:19   ` Sergei Shtylyov
  2013-08-22  6:51   ` Himanshu Madhani
  1 sibling, 0 replies; 21+ messages in thread
From: Sergei Shtylyov @ 2013-08-21 18:19 UTC (permalink / raw)
  To: Michal Schmidt
  Cc: David Miller, netdev, Eric Dumazet, Himanshu Madhani,
	Rajesh Borundia, Shahed Shaikh, Jitendra Kalsaria, Sony Chacko,
	Sucheta Chakraborty, linux-driver

On 08/21/2013 08:49 PM, Michal Schmidt wrote:

> Since commit 82dc3c63 netif_napi_add() produces an error message if

    Likewise, summary line is needed.

> a NAPI poll weight greater than 64 is requested.

> qlcnic requests the weight as large as 256 for some of its rings, and
> smaller values for other rings. For instance in qlcnic_82xx_napi_add()
> I think the intention was to give the tx+rx ring a bigger weight than
> to rx-only rings, but it's actually doing the opposite. So I'm assuming
> the weights do not really matter much.

> Just use the standard NAPI weights for all rings.

> Signed-off-by: Michal Schmidt <mschmidt@redhat.com>
> CC: Himanshu Madhani <himanshu.madhani@qlogic.com>
> CC: Rajesh Borundia <rajesh.borundia@qlogic.com>
> CC: Shahed Shaikh <shahed.shaikh@qlogic.com>
> CC: Jitendra Kalsaria <jitendra.kalsaria@qlogic.com>
> CC: Sony Chacko <sony.chacko@qlogic.com>
> CC: Sucheta Chakraborty <sucheta.chakraborty@qlogic.com>
> CC: linux-driver@qlogic.com

WBR, Sergei

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

* Re: [PATCH 3/4] ps3_gelic: lower NAPI weight
  2013-08-21 16:49 ` [PATCH 3/4] ps3_gelic: " Michal Schmidt
  2013-08-21 18:17   ` Sergei Shtylyov
@ 2013-08-21 21:03   ` Geoff Levand
  2013-08-23 13:41     ` [PATCH v2 " Michal Schmidt
  1 sibling, 1 reply; 21+ messages in thread
From: Geoff Levand @ 2013-08-21 21:03 UTC (permalink / raw)
  To: Michal Schmidt; +Cc: David Miller, netdev, Eric Dumazet

On Wed, 2013-08-21 at 18:49 +0200, Michal Schmidt wrote:
> Since commit 82dc3c63 netif_napi_add() produces an error message if
> a NAPI poll weight greater than 64 is requested.
> 
> GELIC_NET_NAPI_WEIGHT is defined to GELIC_NET_RX_DESCRIPTORS,
> which is 128.
> 
> Use the standard NAPI weight.
> 
> Signed-off-by: Michal Schmidt <mschmidt@redhat.com>
> CC: Geoff Levand <geoff@infradead.org>
> ---
>  drivers/net/ethernet/toshiba/ps3_gelic_net.c | 3 +--
>  drivers/net/ethernet/toshiba/ps3_gelic_net.h | 1 -
>  2 files changed, 1 insertion(+), 3 deletions(-)

Change looks fine.  Please correct comment as Sergei
suggested.

Acked-by: Geoff Levand <geoff@infradead.org>

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

* RE: [PATCH 4/4] qlcnic: use standard NAPI weights
  2013-08-21 16:49 ` [PATCH 4/4] qlcnic: use standard NAPI weights Michal Schmidt
  2013-08-21 18:19   ` Sergei Shtylyov
@ 2013-08-22  6:51   ` Himanshu Madhani
  2013-08-23 13:45     ` Michal Schmidt
  1 sibling, 1 reply; 21+ messages in thread
From: Himanshu Madhani @ 2013-08-22  6:51 UTC (permalink / raw)
  To: Michal Schmidt, David Miller
  Cc: netdev, Eric Dumazet, Rajesh Borundia, Shahed Shaikh,
	Jitendra Kalsaria, Sony Chacko, Sucheta Chakraborty,
	Dept-Eng Linux Driver

________________________________________
From: Michal Schmidt [mschmidt@redhat.com]
Sent: Wednesday, August 21, 2013 9:49 AM
To: David Miller
Cc: netdev; Eric Dumazet; Himanshu Madhani; Rajesh Borundia; Shahed Shaikh; Jitendra Kalsaria; Sony Chacko; Sucheta Chakraborty; Dept-Eng Linux Driver
Subject: [PATCH 4/4] qlcnic: use standard NAPI weights

Since commit 82dc3c63 netif_napi_add() produces an error message if
a NAPI poll weight greater than 64 is requested.

qlcnic requests the weight as large as 256 for some of its rings, and
smaller values for other rings. For instance in qlcnic_82xx_napi_add()
I think the intention was to give the tx+rx ring a bigger weight than
to rx-only rings, but it's actually doing the opposite. So I'm assuming
the weights do not really matter much.

Just use the standard NAPI weights for all rings.

Signed-off-by: Michal Schmidt <mschmidt@redhat.com>
CC: Himanshu Madhani <himanshu.madhani@qlogic.com>
CC: Rajesh Borundia <rajesh.borundia@qlogic.com>
CC: Shahed Shaikh <shahed.shaikh@qlogic.com>
CC: Jitendra Kalsaria <jitendra.kalsaria@qlogic.com>
CC: Sony Chacko <sony.chacko@qlogic.com>
CC: Sucheta Chakraborty <sucheta.chakraborty@qlogic.com>
CC: linux-driver@qlogic.com
---
 drivers/net/ethernet/qlogic/qlcnic/qlcnic.h    |  1 -
 drivers/net/ethernet/qlogic/qlcnic/qlcnic_io.c | 25 ++++++++++---------------
 2 files changed, 10 insertions(+), 16 deletions(-)

diff --git a/drivers/net/ethernet/qlogic/qlcnic/qlcnic.h b/drivers/net/ethernet/qlogic/qlcnic/qlcnic.h
index 3dcc666..47876a5 100644
--- a/drivers/net/ethernet/qlogic/qlcnic/qlcnic.h
+++ b/drivers/net/ethernet/qlogic/qlcnic/qlcnic.h
@@ -926,7 +926,6 @@ struct qlcnic_ipaddr {
 #define QLCNIC_PCI_REG_MSIX_TBL        0x44
 #define QLCNIC_MSIX_TBL_PGSIZE         4096

-#define QLCNIC_NETDEV_WEIGHT   128
 #define QLCNIC_ADAPTER_UP_MAGIC 777

 #define __QLCNIC_FW_ATTACHED           0
diff --git a/drivers/net/ethernet/qlogic/qlcnic/qlcnic_io.c b/drivers/net/ethernet/qlogic/qlcnic/qlcnic_io.c
index cec0908..1a5915d 100644
--- a/drivers/net/ethernet/qlogic/qlcnic/qlcnic_io.c
+++ b/drivers/net/ethernet/qlogic/qlcnic/qlcnic_io.c
@@ -1408,23 +1408,21 @@ void qlcnic_82xx_process_rcv_ring_diag(struct qlcnic_host_sds_ring *sds_ring)
 int qlcnic_82xx_napi_add(struct qlcnic_adapter *adapter,
                         struct net_device *netdev)
 {
-       int ring, max_sds_rings;
+       int ring;
        struct qlcnic_host_sds_ring *sds_ring;
        struct qlcnic_recv_context *recv_ctx = adapter->recv_ctx;

        if (qlcnic_alloc_sds_rings(recv_ctx, adapter->max_sds_rings))
                return -ENOMEM;

-       max_sds_rings = adapter->max_sds_rings;
-
        for (ring = 0; ring < adapter->max_sds_rings; ring++) {
                sds_ring = &recv_ctx->sds_rings[ring];
                if (ring == adapter->max_sds_rings - 1)
                        netif_napi_add(netdev, &sds_ring->napi, qlcnic_poll,
-                                      QLCNIC_NETDEV_WEIGHT / max_sds_rings);
+                                      NAPI_POLL_WEIGHT);
                else
                        netif_napi_add(netdev, &sds_ring->napi, qlcnic_rx_poll,
-                                      QLCNIC_NETDEV_WEIGHT*2);
+                                      NAPI_POLL_WEIGHT);
        }

        if (qlcnic_alloc_tx_rings(adapter, netdev)) {
@@ -1861,7 +1859,7 @@ void qlcnic_83xx_napi_disable(struct qlcnic_adapter *adapter)
 int qlcnic_83xx_napi_add(struct qlcnic_adapter *adapter,
                         struct net_device *netdev)
 {
-       int ring, max_sds_rings, temp;
+       int ring;
        struct qlcnic_host_sds_ring *sds_ring;
        struct qlcnic_host_tx_ring *tx_ring;
        struct qlcnic_recv_context *recv_ctx = adapter->recv_ctx;
@@ -1869,25 +1867,22 @@ int qlcnic_83xx_napi_add(struct qlcnic_adapter *adapter,
        if (qlcnic_alloc_sds_rings(recv_ctx, adapter->max_sds_rings))
                return -ENOMEM;

-       max_sds_rings = adapter->max_sds_rings;
        for (ring = 0; ring < adapter->max_sds_rings; ring++) {
                sds_ring = &recv_ctx->sds_rings[ring];
                if (adapter->flags & QLCNIC_MSIX_ENABLED) {
-                       if (!(adapter->flags & QLCNIC_TX_INTR_SHARED)) {
+                       if (!(adapter->flags & QLCNIC_TX_INTR_SHARED))
                                netif_napi_add(netdev, &sds_ring->napi,
                                               qlcnic_83xx_rx_poll,
-                                              QLCNIC_NETDEV_WEIGHT * 2);
-                       } else {
-                               temp = QLCNIC_NETDEV_WEIGHT / max_sds_rings;
+                                              NAPI_POLL_WEIGHT);
+                       else
                                netif_napi_add(netdev, &sds_ring->napi,
                                               qlcnic_83xx_msix_sriov_vf_poll,
-                                              temp);
-                       }
+                                              NAPI_POLL_WEIGHT);

                } else {
                        netif_napi_add(netdev, &sds_ring->napi,
                                       qlcnic_83xx_poll,
-                                      QLCNIC_NETDEV_WEIGHT / max_sds_rings);
+                                      NAPI_POLL_WEIGHT);
                }
        }

@@ -1902,7 +1897,7 @@ int qlcnic_83xx_napi_add(struct qlcnic_adapter *adapter,
                        tx_ring = &adapter->tx_ring[ring];
                        netif_napi_add(netdev, &tx_ring->napi,
                                       qlcnic_83xx_msix_tx_poll,
-                                      QLCNIC_NETDEV_WEIGHT);
+                                      NAPI_POLL_WEIGHT);
                }
        }

We are in process of running performance numbers with these changes.  I will respond once I have the performance data with the proposed changes.

Thanks,
Himanshu
--
1.8.3.1

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

* [PATCH v2 1/4] jme: lower NAPI weight
  2013-08-21 18:15   ` Sergei Shtylyov
@ 2013-08-23 13:40     ` Michal Schmidt
  2013-08-27 19:00       ` David Miller
  0 siblings, 1 reply; 21+ messages in thread
From: Michal Schmidt @ 2013-08-23 13:40 UTC (permalink / raw)
  To: David Miller; +Cc: Sergei Shtylyov, netdev, Eric Dumazet, Guo-Fu Tseng

Since commit 82dc3c63 ("net: introduce NAPI_POLL_WEIGHT")
netif_napi_add() produces an error message if a NAPI poll weight
greater than 64 is requested.

jme requests a quarter of the rx ring size as the NAPI weight.
jme's rx ring size is 1 << 9 = 512.

Use the standard NAPI weight.

v2: proper reference to the related commit

Signed-off-by: Michal Schmidt <mschmidt@redhat.com>
---
 drivers/net/ethernet/jme.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/net/ethernet/jme.c b/drivers/net/ethernet/jme.c
index 7fbe6ab..23de82a 100644
--- a/drivers/net/ethernet/jme.c
+++ b/drivers/net/ethernet/jme.c
@@ -3069,7 +3069,7 @@ jme_init_one(struct pci_dev *pdev,
 		jwrite32(jme, JME_APMC, apmc);
 	}
 
-	NETIF_NAPI_SET(netdev, &jme->napi, jme_poll, jme->rx_ring_size >> 2)
+	NETIF_NAPI_SET(netdev, &jme->napi, jme_poll, NAPI_POLL_WEIGHT)
 
 	spin_lock_init(&jme->phy_lock);
 	spin_lock_init(&jme->macaddr_lock);
-- 
1.8.3.1

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

* [PATCH v2 2/4] netxen: lower NAPI weight
  2013-08-21 18:16   ` Sergei Shtylyov
@ 2013-08-23 13:41     ` Michal Schmidt
  2013-08-27 19:00       ` David Miller
  0 siblings, 1 reply; 21+ messages in thread
From: Michal Schmidt @ 2013-08-23 13:41 UTC (permalink / raw)
  To: David Miller
  Cc: Sergei Shtylyov, netdev, Eric Dumazet, Manish Chopra,
	Sony Chacko, Rajesh Borundia

Since commit 82dc3c63 ("net: introduce NAPI_POLL_WEIGHT")
netif_napi_add() produces an error message if a NAPI poll weight
greater than 64 is requested.

Use the standard NAPI weight.

v2: proper reference to the related commit

Signed-off-by: Michal Schmidt <mschmidt@redhat.com>
---
 drivers/net/ethernet/qlogic/netxen/netxen_nic.h      | 1 -
 drivers/net/ethernet/qlogic/netxen/netxen_nic_main.c | 2 +-
 2 files changed, 1 insertion(+), 2 deletions(-)

diff --git a/drivers/net/ethernet/qlogic/netxen/netxen_nic.h b/drivers/net/ethernet/qlogic/netxen/netxen_nic.h
index 3fe09ab..32675e1 100644
--- a/drivers/net/ethernet/qlogic/netxen/netxen_nic.h
+++ b/drivers/net/ethernet/qlogic/netxen/netxen_nic.h
@@ -1171,7 +1171,6 @@ typedef struct {
 
 #define NETXEN_DB_MAPSIZE_BYTES    	0x1000
 
-#define NETXEN_NETDEV_WEIGHT 128
 #define NETXEN_ADAPTER_UP_MAGIC 777
 #define NETXEN_NIC_PEG_TUNE 0
 
diff --git a/drivers/net/ethernet/qlogic/netxen/netxen_nic_main.c b/drivers/net/ethernet/qlogic/netxen/netxen_nic_main.c
index 1046e94..cbd75f9 100644
--- a/drivers/net/ethernet/qlogic/netxen/netxen_nic_main.c
+++ b/drivers/net/ethernet/qlogic/netxen/netxen_nic_main.c
@@ -197,7 +197,7 @@ netxen_napi_add(struct netxen_adapter *adapter, struct net_device *netdev)
 	for (ring = 0; ring < adapter->max_sds_rings; ring++) {
 		sds_ring = &recv_ctx->sds_rings[ring];
 		netif_napi_add(netdev, &sds_ring->napi,
-				netxen_nic_poll, NETXEN_NETDEV_WEIGHT);
+				netxen_nic_poll, NAPI_POLL_WEIGHT);
 	}
 
 	return 0;
-- 
1.8.3.1

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

* [PATCH v2 3/4] ps3_gelic: lower NAPI weight
  2013-08-21 21:03   ` Geoff Levand
@ 2013-08-23 13:41     ` Michal Schmidt
  2013-08-27 19:00       ` David Miller
  0 siblings, 1 reply; 21+ messages in thread
From: Michal Schmidt @ 2013-08-23 13:41 UTC (permalink / raw)
  To: David Miller; +Cc: Geoff Levand, netdev, Eric Dumazet, Sergei Shtylyov

Since commit 82dc3c63 ("net: introduce NAPI_POLL_WEIGHT")
netif_napi_add() produces an error message if a NAPI poll weight
greater than 64 is requested.

GELIC_NET_NAPI_WEIGHT is defined to GELIC_NET_RX_DESCRIPTORS,
which is 128.

Use the standard NAPI weight.

v2: proper reference to the related commit

Signed-off-by: Michal Schmidt <mschmidt@redhat.com>
Acked-by: Geoff Levand <geoff@infradead.org>
---
 drivers/net/ethernet/toshiba/ps3_gelic_net.c | 3 +--
 drivers/net/ethernet/toshiba/ps3_gelic_net.h | 1 -
 2 files changed, 1 insertion(+), 3 deletions(-)

diff --git a/drivers/net/ethernet/toshiba/ps3_gelic_net.c b/drivers/net/ethernet/toshiba/ps3_gelic_net.c
index ad32af6..9c805e0 100644
--- a/drivers/net/ethernet/toshiba/ps3_gelic_net.c
+++ b/drivers/net/ethernet/toshiba/ps3_gelic_net.c
@@ -1466,8 +1466,7 @@ static void gelic_ether_setup_netdev_ops(struct net_device *netdev,
 {
 	netdev->watchdog_timeo = GELIC_NET_WATCHDOG_TIMEOUT;
 	/* NAPI */
-	netif_napi_add(netdev, napi,
-		       gelic_net_poll, GELIC_NET_NAPI_WEIGHT);
+	netif_napi_add(netdev, napi, gelic_net_poll, NAPI_POLL_WEIGHT);
 	netdev->ethtool_ops = &gelic_ether_ethtool_ops;
 	netdev->netdev_ops = &gelic_netdevice_ops;
 }
diff --git a/drivers/net/ethernet/toshiba/ps3_gelic_net.h b/drivers/net/ethernet/toshiba/ps3_gelic_net.h
index a93df6a..309abb4 100644
--- a/drivers/net/ethernet/toshiba/ps3_gelic_net.h
+++ b/drivers/net/ethernet/toshiba/ps3_gelic_net.h
@@ -37,7 +37,6 @@
 #define GELIC_NET_RXBUF_ALIGN           128
 #define GELIC_CARD_RX_CSUM_DEFAULT      1 /* hw chksum */
 #define GELIC_NET_WATCHDOG_TIMEOUT      5*HZ
-#define GELIC_NET_NAPI_WEIGHT           (GELIC_NET_RX_DESCRIPTORS)
 #define GELIC_NET_BROADCAST_ADDR        0xffffffffffffL
 
 #define GELIC_NET_MC_COUNT_MAX          32 /* multicast address list */
-- 
1.8.3.1

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

* Re: [PATCH 4/4] qlcnic: use standard NAPI weights
  2013-08-22  6:51   ` Himanshu Madhani
@ 2013-08-23 13:45     ` Michal Schmidt
  2013-08-30 19:21       ` Himanshu Madhani
  0 siblings, 1 reply; 21+ messages in thread
From: Michal Schmidt @ 2013-08-23 13:45 UTC (permalink / raw)
  To: Himanshu Madhani
  Cc: David Miller, netdev, Eric Dumazet, Rajesh Borundia,
	Shahed Shaikh, Jitendra Kalsaria, Sony Chacko,
	Sucheta Chakraborty, Dept-Eng Linux Driver

On 08/22/2013 08:51 AM, Himanshu Madhani wrote:
> We are in process of running performance numbers with these changes.
> I will respond once I have the performance data with the proposed
> changes.

OK. I will post a rebased patch 4/4 later if you find no performance
loss.

Thanks,
Michal

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

* Re: [PATCH v2 1/4] jme: lower NAPI weight
  2013-08-23 13:40     ` [PATCH v2 " Michal Schmidt
@ 2013-08-27 19:00       ` David Miller
  0 siblings, 0 replies; 21+ messages in thread
From: David Miller @ 2013-08-27 19:00 UTC (permalink / raw)
  To: mschmidt; +Cc: sergei.shtylyov, netdev, edumazet, cooldavid

From: Michal Schmidt <mschmidt@redhat.com>
Date: Fri, 23 Aug 2013 15:40:53 +0200

> Since commit 82dc3c63 ("net: introduce NAPI_POLL_WEIGHT")
> netif_napi_add() produces an error message if a NAPI poll weight
> greater than 64 is requested.
> 
> jme requests a quarter of the rx ring size as the NAPI weight.
> jme's rx ring size is 1 << 9 = 512.
> 
> Use the standard NAPI weight.
> 
> v2: proper reference to the related commit
> 
> Signed-off-by: Michal Schmidt <mschmidt@redhat.com>

Applied.

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

* Re: [PATCH v2 2/4] netxen: lower NAPI weight
  2013-08-23 13:41     ` [PATCH v2 " Michal Schmidt
@ 2013-08-27 19:00       ` David Miller
  0 siblings, 0 replies; 21+ messages in thread
From: David Miller @ 2013-08-27 19:00 UTC (permalink / raw)
  To: mschmidt
  Cc: sergei.shtylyov, netdev, edumazet, manish.chopra, sony.chacko,
	rajesh.borundia

From: Michal Schmidt <mschmidt@redhat.com>
Date: Fri, 23 Aug 2013 15:41:09 +0200

> Since commit 82dc3c63 ("net: introduce NAPI_POLL_WEIGHT")
> netif_napi_add() produces an error message if a NAPI poll weight
> greater than 64 is requested.
> 
> Use the standard NAPI weight.
> 
> v2: proper reference to the related commit
> 
> Signed-off-by: Michal Schmidt <mschmidt@redhat.com>

Applied.

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

* Re: [PATCH v2 3/4] ps3_gelic: lower NAPI weight
  2013-08-23 13:41     ` [PATCH v2 " Michal Schmidt
@ 2013-08-27 19:00       ` David Miller
  0 siblings, 0 replies; 21+ messages in thread
From: David Miller @ 2013-08-27 19:00 UTC (permalink / raw)
  To: mschmidt; +Cc: geoff, netdev, edumazet, sergei.shtylyov

From: Michal Schmidt <mschmidt@redhat.com>
Date: Fri, 23 Aug 2013 15:41:19 +0200

> Since commit 82dc3c63 ("net: introduce NAPI_POLL_WEIGHT")
> netif_napi_add() produces an error message if a NAPI poll weight
> greater than 64 is requested.
> 
> GELIC_NET_NAPI_WEIGHT is defined to GELIC_NET_RX_DESCRIPTORS,
> which is 128.
> 
> Use the standard NAPI weight.
> 
> v2: proper reference to the related commit
> 
> Signed-off-by: Michal Schmidt <mschmidt@redhat.com>
> Acked-by: Geoff Levand <geoff@infradead.org>

Applied.

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

* RE: [PATCH 4/4] qlcnic: use standard NAPI weights
  2013-08-23 13:45     ` Michal Schmidt
@ 2013-08-30 19:21       ` Himanshu Madhani
  2013-09-04 13:03         ` [PATCH net-next v2] " Michal Schmidt
  0 siblings, 1 reply; 21+ messages in thread
From: Himanshu Madhani @ 2013-08-30 19:21 UTC (permalink / raw)
  To: Michal Schmidt
  Cc: David Miller, netdev, Eric Dumazet, Rajesh Borundia,
	Shahed Shaikh, Jitendra Kalsaria, Sony Chacko,
	Sucheta Chakraborty, Dept-Eng Linux Driver

> -----Original Message-----
> From: Michal Schmidt [mailto:mschmidt@redhat.com]
> Sent: Friday, August 23, 2013 6:45 AM
> To: Himanshu Madhani
> Cc: David Miller; netdev; Eric Dumazet; Rajesh Borundia; Shahed Shaikh;
> Jitendra Kalsaria; Sony Chacko; Sucheta Chakraborty; Dept-Eng Linux Driver
> Subject: Re: [PATCH 4/4] qlcnic: use standard NAPI weights
> 
> On 08/22/2013 08:51 AM, Himanshu Madhani wrote:
> > We are in process of running performance numbers with these changes.
> > I will respond once I have the performance data with the proposed
> > changes.
> 
> OK. I will post a rebased patch 4/4 later if you find no performance loss.
> 
> Thanks,
> Michal

The changes are okay. Please resubmit your rebased patch

Acked-by: Himanshu Madhani <himanshu.madhani@qlogic.com>

Thanks,
Himanshu

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

* [PATCH net-next v2] qlcnic: use standard NAPI weights
  2013-08-30 19:21       ` Himanshu Madhani
@ 2013-09-04 13:03         ` Michal Schmidt
  2013-09-05 16:46           ` David Miller
  0 siblings, 1 reply; 21+ messages in thread
From: Michal Schmidt @ 2013-09-04 13:03 UTC (permalink / raw)
  To: David Miller
  Cc: Himanshu Madhani, netdev, Eric Dumazet, Rajesh Borundia,
	Shahed Shaikh, Jitendra Kalsaria, Sony Chacko,
	Sucheta Chakraborty, Dept-Eng Linux Driver

Since commit 82dc3c63 ("net: introduce NAPI_POLL_WEIGHT")
netif_napi_add() produces an error message if a NAPI poll weight
greater than 64 is requested.

qlcnic requests the weight as large as 256 for some of its rings, and
smaller values for other rings. For instance in qlcnic_82xx_napi_add()
I think the intention was to give the tx+rx ring a bigger weight than
to rx-only rings, but it's actually doing the opposite. So I'm assuming
the weights do not really matter much.

Just use the standard NAPI weights for all rings.

Signed-off-by: Michal Schmidt <mschmidt@redhat.com>
Acked-by: Himanshu Madhani <himanshu.madhani@qlogic.com>
---

v2: Rebased on top of the current qlcnic in net-next.

 drivers/net/ethernet/qlogic/qlcnic/qlcnic.h    |  1 -
 drivers/net/ethernet/qlogic/qlcnic/qlcnic_io.c | 30 +++++++++++---------------
 2 files changed, 12 insertions(+), 19 deletions(-)

diff --git a/drivers/net/ethernet/qlogic/qlcnic/qlcnic.h b/drivers/net/ethernet/qlogic/qlcnic/qlcnic.h
index 4615960..88349b8 100644
--- a/drivers/net/ethernet/qlogic/qlcnic/qlcnic.h
+++ b/drivers/net/ethernet/qlogic/qlcnic/qlcnic.h
@@ -946,7 +946,6 @@ struct qlcnic_ipaddr {
 #define QLCNIC_PCI_REG_MSIX_TBL 	0x44
 #define QLCNIC_MSIX_TBL_PGSIZE		4096
 
-#define QLCNIC_NETDEV_WEIGHT	128
 #define QLCNIC_ADAPTER_UP_MAGIC 777
 
 #define __QLCNIC_FW_ATTACHED		0
diff --git a/drivers/net/ethernet/qlogic/qlcnic/qlcnic_io.c b/drivers/net/ethernet/qlogic/qlcnic/qlcnic_io.c
index 8d06f88..b7b245b 100644
--- a/drivers/net/ethernet/qlogic/qlcnic/qlcnic_io.c
+++ b/drivers/net/ethernet/qlogic/qlcnic/qlcnic_io.c
@@ -1458,7 +1458,7 @@ void qlcnic_82xx_process_rcv_ring_diag(struct qlcnic_host_sds_ring *sds_ring)
 int qlcnic_82xx_napi_add(struct qlcnic_adapter *adapter,
 			 struct net_device *netdev)
 {
-	int ring, max_sds_rings;
+	int ring;
 	struct qlcnic_host_sds_ring *sds_ring;
 	struct qlcnic_recv_context *recv_ctx = adapter->recv_ctx;
 	struct qlcnic_host_tx_ring *tx_ring;
@@ -1466,25 +1466,22 @@ int qlcnic_82xx_napi_add(struct qlcnic_adapter *adapter,
 	if (qlcnic_alloc_sds_rings(recv_ctx, adapter->max_sds_rings))
 		return -ENOMEM;
 
-	max_sds_rings = adapter->max_sds_rings;
-
 	for (ring = 0; ring < adapter->max_sds_rings; ring++) {
 		sds_ring = &recv_ctx->sds_rings[ring];
 		if (qlcnic_check_multi_tx(adapter) &&
 		    !adapter->ahw->diag_test &&
 		    (adapter->max_drv_tx_rings > 1)) {
 			netif_napi_add(netdev, &sds_ring->napi, qlcnic_rx_poll,
-					QLCNIC_NETDEV_WEIGHT * 2);
+				       NAPI_POLL_WEIGHT);
 		} else {
 			if (ring == (adapter->max_sds_rings - 1))
 				netif_napi_add(netdev, &sds_ring->napi,
 					       qlcnic_poll,
-					       QLCNIC_NETDEV_WEIGHT /
-					       max_sds_rings);
+					       NAPI_POLL_WEIGHT);
 			else
 				netif_napi_add(netdev, &sds_ring->napi,
 					       qlcnic_rx_poll,
-					       QLCNIC_NETDEV_WEIGHT * 2);
+					       NAPI_POLL_WEIGHT);
 		}
 	}
 
@@ -1497,7 +1494,7 @@ int qlcnic_82xx_napi_add(struct qlcnic_adapter *adapter,
 		for (ring = 0; ring < adapter->max_drv_tx_rings; ring++) {
 			tx_ring = &adapter->tx_ring[ring];
 			netif_napi_add(netdev, &tx_ring->napi, qlcnic_tx_poll,
-				       QLCNIC_NETDEV_WEIGHT);
+				       NAPI_POLL_WEIGHT);
 		}
 	}
 
@@ -1963,7 +1960,7 @@ void qlcnic_83xx_napi_disable(struct qlcnic_adapter *adapter)
 int qlcnic_83xx_napi_add(struct qlcnic_adapter *adapter,
 			 struct net_device *netdev)
 {
-	int ring, max_sds_rings, temp;
+	int ring;
 	struct qlcnic_host_sds_ring *sds_ring;
 	struct qlcnic_host_tx_ring *tx_ring;
 	struct qlcnic_recv_context *recv_ctx = adapter->recv_ctx;
@@ -1971,25 +1968,22 @@ int qlcnic_83xx_napi_add(struct qlcnic_adapter *adapter,
 	if (qlcnic_alloc_sds_rings(recv_ctx, adapter->max_sds_rings))
 		return -ENOMEM;
 
-	max_sds_rings = adapter->max_sds_rings;
 	for (ring = 0; ring < adapter->max_sds_rings; ring++) {
 		sds_ring = &recv_ctx->sds_rings[ring];
 		if (adapter->flags & QLCNIC_MSIX_ENABLED) {
-			if (!(adapter->flags & QLCNIC_TX_INTR_SHARED)) {
+			if (!(adapter->flags & QLCNIC_TX_INTR_SHARED))
 				netif_napi_add(netdev, &sds_ring->napi,
 					       qlcnic_83xx_rx_poll,
-					       QLCNIC_NETDEV_WEIGHT * 2);
-			} else {
-				temp = QLCNIC_NETDEV_WEIGHT / max_sds_rings;
+					       NAPI_POLL_WEIGHT);
+			else
 				netif_napi_add(netdev, &sds_ring->napi,
 					       qlcnic_83xx_msix_sriov_vf_poll,
-					       temp);
-			}
+					       NAPI_POLL_WEIGHT);
 
 		} else {
 			netif_napi_add(netdev, &sds_ring->napi,
 				       qlcnic_83xx_poll,
-				       QLCNIC_NETDEV_WEIGHT / max_sds_rings);
+				       NAPI_POLL_WEIGHT);
 		}
 	}
 
@@ -2004,7 +1998,7 @@ int qlcnic_83xx_napi_add(struct qlcnic_adapter *adapter,
 			tx_ring = &adapter->tx_ring[ring];
 			netif_napi_add(netdev, &tx_ring->napi,
 				       qlcnic_83xx_msix_tx_poll,
-				       QLCNIC_NETDEV_WEIGHT);
+				       NAPI_POLL_WEIGHT);
 		}
 	}
 
-- 
1.8.3.1

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

* Re: [PATCH net-next v2] qlcnic: use standard NAPI weights
  2013-09-04 13:03         ` [PATCH net-next v2] " Michal Schmidt
@ 2013-09-05 16:46           ` David Miller
  0 siblings, 0 replies; 21+ messages in thread
From: David Miller @ 2013-09-05 16:46 UTC (permalink / raw)
  To: mschmidt
  Cc: himanshu.madhani, netdev, edumazet, rajesh.borundia,
	shahed.shaikh, jitendra.kalsaria, sony.chacko,
	sucheta.chakraborty, Linux-Driver

From: Michal Schmidt <mschmidt@redhat.com>
Date: Wed, 04 Sep 2013 15:03:05 +0200

> Since commit 82dc3c63 ("net: introduce NAPI_POLL_WEIGHT")
> netif_napi_add() produces an error message if a NAPI poll weight
> greater than 64 is requested.
> 
> qlcnic requests the weight as large as 256 for some of its rings, and
> smaller values for other rings. For instance in qlcnic_82xx_napi_add()
> I think the intention was to give the tx+rx ring a bigger weight than
> to rx-only rings, but it's actually doing the opposite. So I'm assuming
> the weights do not really matter much.
> 
> Just use the standard NAPI weights for all rings.
> 
> Signed-off-by: Michal Schmidt <mschmidt@redhat.com>
> Acked-by: Himanshu Madhani <himanshu.madhani@qlogic.com>

Applied.

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

end of thread, other threads:[~2013-09-05 16:46 UTC | newest]

Thread overview: 21+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2013-08-21 16:49 [PATCH 0/4] drivers/net: fix too big NAPI weights Michal Schmidt
2013-08-21 16:49 ` [PATCH 1/4] jme: lower NAPI weight Michal Schmidt
2013-08-21 18:15   ` Sergei Shtylyov
2013-08-23 13:40     ` [PATCH v2 " Michal Schmidt
2013-08-27 19:00       ` David Miller
2013-08-21 16:49 ` [PATCH 2/4] netxen: " Michal Schmidt
2013-08-21 18:16   ` Sergei Shtylyov
2013-08-23 13:41     ` [PATCH v2 " Michal Schmidt
2013-08-27 19:00       ` David Miller
2013-08-21 16:49 ` [PATCH 3/4] ps3_gelic: " Michal Schmidt
2013-08-21 18:17   ` Sergei Shtylyov
2013-08-21 21:03   ` Geoff Levand
2013-08-23 13:41     ` [PATCH v2 " Michal Schmidt
2013-08-27 19:00       ` David Miller
2013-08-21 16:49 ` [PATCH 4/4] qlcnic: use standard NAPI weights Michal Schmidt
2013-08-21 18:19   ` Sergei Shtylyov
2013-08-22  6:51   ` Himanshu Madhani
2013-08-23 13:45     ` Michal Schmidt
2013-08-30 19:21       ` Himanshu Madhani
2013-09-04 13:03         ` [PATCH net-next v2] " Michal Schmidt
2013-09-05 16:46           ` 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.