public inbox for netdev@vger.kernel.org
 help / color / mirror / Atom feed
From: Eric Dumazet <eric.dumazet@gmail.com>
To: Andrew Morton <akpm@linux-foundation.org>
Cc: netdev@vger.kernel.org, e1000-devel@lists.sourceforge.net,
	Andrea Merello <andrea.merello@gmail.com>
Subject: Re: Fw: [PATCH] e100: Fix inconsistency in bad frames handling
Date: Tue, 07 Jun 2011 07:11:30 +0200	[thread overview]
Message-ID: <1307423490.2642.61.camel@edumazet-laptop> (raw)
In-Reply-To: <20110606214454.4108aff4.akpm@linux-foundation.org>

Le lundi 06 juin 2011 à 21:44 -0700, Andrew Morton a écrit :
> 
> Begin forwarded message:
> 
> Date: Sun, 5 Jun 2011 03:14:49 +0200
> From: Andrea Merello <andrea.merello@gmail.com>
> To: linux-kernel@vger.kernel.org
> Subject: [PATCH] e100: Fix inconsistency in bad frames handling
> 
> 
> Hello!
> 
> In e100 driver it seems that the intention was to accept bad frames in
> promiscuous mode and loopback mode.
> I think this is evident because of the following code in the driver:
> 
> if (nic->flags & promiscuous || nic->loopback) {
>                config->rx_save_bad_frames = 0x1;       /* 1=save, 0=discard */
>                config->rx_discard_short_frames = 0x0;  /* 1=discard, 0=save */
>                config->promiscuous_mode = 0x1;         /* 1=on, 0=off */
>        }
> 
> 
> However this intention is not really realized because bad frames are
> discarded later by SW check.
> This patch finally honors the above intention, making the RX code to
> let bad frames to pass when the NIC is in promiscuous or loopback
> mode.
> 
> This helped me a lot to debug an FPGA ethernet core.
> Maybe it can be also useful to someone else..
> 
> Thanks
> Andrea
> 
>  --- drivers/net/e100_orig.c     2011-06-14 23:29:38.322267075 +0200
> +++ drivers/net/e100.c  2011-06-14 23:34:10.700791472 +0200
> @@ -1975,7 +1975,8 @@ static int e100_rx_indicate(struct nic *
>        skb_put(skb, actual_size);
>        skb->protocol = eth_type_trans(skb, nic->netdev);
> 
> -       if (unlikely(!(rfd_status & cb_ok))) {
> +       if (unlikely(!(nic->flags & promiscuous || nic->loopback) &&
> +           !(rfd_status & cb_ok))) {
>                /* Don't indicate if hardware indicates errors */
>                dev_kfree_skb_any(skb);
>        } else if (actual_size > ETH_DATA_LEN + VLAN_ETH_HLEN) {


Thanks Andrew, subject already opened on netdev :)

http://www.spinics.net/lists/netdev/msg166301.html

Lets close this thread and continue on previous one ?




      reply	other threads:[~2011-06-07  5:11 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-06-07  4:44 Fw: [PATCH] e100: Fix inconsistency in bad frames handling Andrew Morton
2011-06-07  5:11 ` Eric Dumazet [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1307423490.2642.61.camel@edumazet-laptop \
    --to=eric.dumazet@gmail.com \
    --cc=akpm@linux-foundation.org \
    --cc=andrea.merello@gmail.com \
    --cc=e1000-devel@lists.sourceforge.net \
    --cc=netdev@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox