All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Amit D. Chaudhary" <amitc@brocade.com>
To: David Ashley <dash@xdr.com>
Cc: linuxppc-embedded@lists.linuxppc.org
Subject: Re: Bugfix in arch/ppc/8260_io/fcc_enet.c linux-2.4.17
Date: Fri, 08 Mar 2002 16:26:34 -0800	[thread overview]
Message-ID: <3C8956BA.7000609@brocade.com> (raw)
In-Reply-To: 200203081939.g28JdCP28936@xdr.com


David,

Is there an impact of your change on the board doing a netboot and
loading the rootfs from a nfs mount?

Thanks
Amit

David Ashley wrote:
> I found a bug which was manifest when linux boots and lots of ethernet
> packets are coming in. I think the problem is because the fcc_enet.c
> adds the network device in very early during the boot, and the driver is
> happily calling netif_rx() on the received packets even though the interface
> isn't officially "up". Linux appears not to like this, and would crash
> sporadically, or predictibly if I have a program on another computer running
> just blasting packets at the first one.
>
> The fix is to just put an if around this section in fcc_enet_rx:
> 		skb = dev_alloc_skb(pkt_len-4);
>
> 		if (skb == NULL) {
> 			printk("%s: Memory squeeze, dropping packet.\n", dev->name);
> 			cep->stats.rx_dropped++;
> 		}
> 		else {
> 			skb->dev = dev;
> 			skb_put(skb,pkt_len-4);	/* Make room */
> 			eth_copy_and_sum(skb,
> 				(unsigned char *)__va(bdp->cbd_bufaddr),
> 				pkt_len-4, 0);
> 			skb->protocol=eth_type_trans(skb,dev);
> 			netif_rx(skb);
> 		}
>
> So it becomes:
> 		if(dev->flags & IFF_UP) { /* only do if iface is up */
> 	                skb = dev_alloc_skb(pkt_len-4);
>
> 	                if (skb == NULL) {
> 	                        printk("%s: Memory squeeze, dropping packet.\n", dev->name);
> 	                        cep->stats.rx_dropped++;
> 	                }
> 	                else {
> 	                        skb->dev = dev;
> 	                        skb_put(skb,pkt_len-4); /* Make room */
> 	                        eth_copy_and_sum(skb,
> 	                                (unsigned char *)__va(bdp->cbd_bufaddr),
> 	                                pkt_len-4, 0);
> 	                        skb->protocol=eth_type_trans(skb,dev);
> 	                        netif_rx(skb);
> 	                }
> 		}
>
> This fixes the crash bug.
>
> -Dave
>
>
>
>
>


** Sent via the linuxppc-embedded mail list. See http://lists.linuxppc.org/

  reply	other threads:[~2002-03-09  0:26 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2002-03-08 19:39 Bugfix in arch/ppc/8260_io/fcc_enet.c linux-2.4.17 David Ashley
2002-03-09  0:26 ` Amit D. Chaudhary [this message]
  -- strict thread matches above, loose matches on Subject: below --
2002-03-09  4:19 David Ashley

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=3C8956BA.7000609@brocade.com \
    --to=amitc@brocade.com \
    --cc=dash@xdr.com \
    --cc=linuxppc-embedded@lists.linuxppc.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 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.