netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] ethernet/arc/arc_emac - fix NAPI "work > weight" warning
@ 2013-08-13 13:04 Alexey Brodkin
  2013-08-14  0:01 ` David Miller
  0 siblings, 1 reply; 2+ messages in thread
From: Alexey Brodkin @ 2013-08-13 13:04 UTC (permalink / raw)
  To: netdev
  Cc: Alexey Brodkin, Vineet Gupta, Mischa Jonker, Arnd Bergmann,
	Grant Likely, Rob Herring, Paul Gortmaker, David S. Miller,
	linux-kernel

Initially I improperly set a boundary for maximum number of input
packets to process on NAPI poll ("work") so it might be more than
expected amount ("weight").

This was really harmless but seeing WARN_ON_ONCE on every device boot is
not nice. So trivial fix ("<" instead of "<=") is here.

Signed-off-by: Alexey Brodkin <abrodkin@synopsys.com>

Cc: Vineet Gupta <vgupta@synopsys.com>
Cc: Mischa Jonker <mjonker@synopsys.com>
Cc: Arnd Bergmann <arnd@arndb.de>
Cc: Grant Likely <grant.likely@linaro.org>
Cc: Rob Herring <rob.herring@calxeda.com>
Cc: Paul Gortmaker <paul.gortmaker@windriver.com>
Cc: "David S. Miller" <davem@davemloft.net>
Cc: linux-kernel@vger.kernel.org
---
 drivers/net/ethernet/arc/emac_main.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/net/ethernet/arc/emac_main.c b/drivers/net/ethernet/arc/emac_main.c
index f1b121e..55d79cb 100644
--- a/drivers/net/ethernet/arc/emac_main.c
+++ b/drivers/net/ethernet/arc/emac_main.c
@@ -199,7 +199,7 @@ static int arc_emac_rx(struct net_device *ndev, int budget)
 	struct arc_emac_priv *priv = netdev_priv(ndev);
 	unsigned int work_done;
 
-	for (work_done = 0; work_done <= budget; work_done++) {
+	for (work_done = 0; work_done < budget; work_done++) {
 		unsigned int *last_rx_bd = &priv->last_rx_bd;
 		struct net_device_stats *stats = &priv->stats;
 		struct buffer_state *rx_buff = &priv->rx_buff[*last_rx_bd];
-- 
1.8.1.2

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

* Re: [PATCH] ethernet/arc/arc_emac - fix NAPI "work > weight" warning
  2013-08-13 13:04 [PATCH] ethernet/arc/arc_emac - fix NAPI "work > weight" warning Alexey Brodkin
@ 2013-08-14  0:01 ` David Miller
  0 siblings, 0 replies; 2+ messages in thread
From: David Miller @ 2013-08-14  0:01 UTC (permalink / raw)
  To: Alexey.Brodkin
  Cc: netdev, Vineet.Gupta1, Mischa.Jonker, arnd, grant.likely,
	rob.herring, paul.gortmaker, linux-kernel

From: Alexey Brodkin <Alexey.Brodkin@synopsys.com>
Date: Tue, 13 Aug 2013 17:04:36 +0400

> Initially I improperly set a boundary for maximum number of input
> packets to process on NAPI poll ("work") so it might be more than
> expected amount ("weight").
> 
> This was really harmless but seeing WARN_ON_ONCE on every device boot is
> not nice. So trivial fix ("<" instead of "<=") is here.
> 
> Signed-off-by: Alexey Brodkin <abrodkin@synopsys.com>

Applied, thanks.

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

end of thread, other threads:[~2013-08-14  0:01 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-08-13 13:04 [PATCH] ethernet/arc/arc_emac - fix NAPI "work > weight" warning Alexey Brodkin
2013-08-14  0:01 ` 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).