Patchwork sky2: Flow control frames recorded as dropped packets

login
register
mail settings
Submitter Michael Breuer
Date Feb. 3, 2010, 4:56 p.m.
Message ID <4B69AAA9.20505@majjas.com>
Download mbox | patch
Permalink /patch/44392/
State Changes Requested
Delegated to: David Miller
Headers show

Comments

Michael Breuer - Feb. 3, 2010, 4:56 p.m.
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.


--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
stephen hemminger - Feb. 3, 2010, 5:10 p.m.
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

Patch

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;
                         }