netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] sky2: Flow control frames recorded as dropped packets
@ 2010-02-03 16:56 Michael Breuer
  2010-02-03 17:10 ` Stephen Hemminger
  2010-02-03 18:31 ` Stephen Hemminger
  0 siblings, 2 replies; 3+ messages in thread
From: Michael Breuer @ 2010-02-03 16:56 UTC (permalink / raw)
  To: netdev; +Cc: Stephen Hemminger

When a flow control packet is received, sky2_receive resubmits the i/o. 
Upon exit, sky2_status_intr counts these as dropped packets.

This fix just skips the rx_dropped accounting in this one case. It 
didn't seem worthwhile to change sky2_receive to deal differently.

This is my first patch submission - comments more than welcome.

diff --git a/drivers/net/sky2.c b/drivers/net/sky2.c
index 95fd10f..bcb035c 100644
--- a/drivers/net/sky2.c
+++ b/drivers/net/sky2.c
@@ -2525,7 +2517,8 @@ static int sky2_status_intr(struct sky2_hw *hw, 
int to_do, u16 idx)
                         total_bytes[port] += length;
                         skb = sky2_receive(dev, length, status);
                         if (unlikely(!skb)) {
-                               dev->stats.rx_dropped++;
+                               if (!(status & GMR_FS_GOOD_FC) )
+                                       dev->stats.rx_dropped++;
                                 break;
                         }


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

* Re: [PATCH] sky2: Flow control frames recorded as dropped packets
  2010-02-03 16:56 [PATCH] sky2: Flow control frames recorded as dropped packets Michael Breuer
@ 2010-02-03 17:10 ` Stephen Hemminger
  2010-02-03 18:31 ` Stephen Hemminger
  1 sibling, 0 replies; 3+ messages in thread
From: Stephen Hemminger @ 2010-02-03 17:10 UTC (permalink / raw)
  To: Michael Breuer; +Cc: netdev

On Wed, 03 Feb 2010 11:56:09 -0500
Michael Breuer <mbreuer@majjas.com> wrote:

> When a flow control packet is received, sky2_receive resubmits the i/o. 
> Upon exit, sky2_status_intr counts these as dropped packets.
> 
> This fix just skips the rx_dropped accounting in this one case. It 
> didn't seem worthwhile to change sky2_receive to deal differently.
> 
> This is my first patch submission - comments more than welcome.
> 
> diff --git a/drivers/net/sky2.c b/drivers/net/sky2.c
> index 95fd10f..bcb035c 100644
> --- a/drivers/net/sky2.c
> +++ b/drivers/net/sky2.c
> @@ -2525,7 +2517,8 @@ static int sky2_status_intr(struct sky2_hw *hw, 
> int to_do, u16 idx)
>                          total_bytes[port] += length;
>                          skb = sky2_receive(dev, length, status);
>                          if (unlikely(!skb)) {
> -                               dev->stats.rx_dropped++;
> +                               if (!(status & GMR_FS_GOOD_FC) )
> +                                       dev->stats.rx_dropped++;
>                                  break;
>                          }
> 

Since FC should be absorbed by MAC, it would be better to never receive
send them up stream. I'll make a patch for that
-- 

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

* Re: [PATCH] sky2: Flow control frames recorded as dropped packets
  2010-02-03 16:56 [PATCH] sky2: Flow control frames recorded as dropped packets Michael Breuer
  2010-02-03 17:10 ` Stephen Hemminger
@ 2010-02-03 18:31 ` Stephen Hemminger
  1 sibling, 0 replies; 3+ messages in thread
From: Stephen Hemminger @ 2010-02-03 18:31 UTC (permalink / raw)
  To: Michael Breuer; +Cc: netdev

Thanks for your patch.  A more general solution would be to move the
rx_dropped up into sky2_receive.

Signed-off-by: Stephen Hemminger <shemminger@vyatta.com>

--- a/drivers/net/sky2.c	2010-02-03 09:10:27.863367226 -0800
+++ b/drivers/net/sky2.c	2010-02-03 09:17:01.602741445 -0800
@@ -2404,6 +2404,9 @@ okay:
 		skb = receive_copy(sky2, re, length);
 	else
 		skb = receive_new(sky2, re, length);
+
+	dev->stats.rx_dropped += (skb == NULL);
+
 resubmit:
 	sky2_rx_submit(sky2, re);
 
@@ -2515,11 +2518,10 @@ static int sky2_status_intr(struct sky2_
 		case OP_RXSTAT:
 			total_packets[port]++;
 			total_bytes[port] += length;
+
 			skb = sky2_receive(dev, length, status);
-			if (unlikely(!skb)) {
-				dev->stats.rx_dropped++;
+			if (!skb)
 				break;
-			}
 
 			/* This chip reports checksum status differently */
 			if (hw->flags & SKY2_HW_NEW_LE) {

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

end of thread, other threads:[~2010-02-03 18:31 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-02-03 16:56 [PATCH] sky2: Flow control frames recorded as dropped packets Michael Breuer
2010-02-03 17:10 ` Stephen Hemminger
2010-02-03 18:31 ` Stephen Hemminger

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).