netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Manuel Arostegui Ramirez <manuel@todo-linux.com>
To: Herbert Xu <herbert@gondor.apana.org.au>,
	kernel@nn7.de (Soeren Sonnenburg)
Cc: linux-kernel@vger.kernel.org, davem@redhat.com,
	benh@kernel.crashing.org, netdev@oss.sgi.com, jgarzik@pobox.com
Subject: Re: sungem - ifconfig eth0 mtu 1300 -> oops
Date: Mon, 21 Jun 2004 15:56:20 +0200	[thread overview]
Message-ID: <200406211556.20020.manuel@todo-linux.com> (raw)
In-Reply-To: <E1BcNzi-0000eh-00@gondolin.me.apana.org.au>

El Lunes 21 Junio 2004 14:33, Herbert Xu escribió:
> Soeren Sonnenburg <kernel@nn7.de> wrote:
> > When I have some ethernet connection and then do:
> >
> > ifconfig eth0 mtu 1300
> >
> > I get an immediate kernel panic (kernel 2.6.6) on a powerbook g4 15"
> > 1ghz.
> >
> > xmon trace (jpeg) is here: http://www.nn7.de/kernel/mtu1300.jpg  (use a
> > webbrowser to view it as it is a redirect)
> >
> > this is 100% reproducable here so I hope it is more easy to fix.
>
> Does this patch fix your problems?
>
> Cheers,
> >
> >===== drivers/net/sungem.c 1.56 vs edited =====
> >--- 1.56/drivers/net/sungem.c   2004-06-19 17:16:13 +10:00
> >+++ edited/drivers/net/sungem.c 2004-06-21 22:28:40 +10:00
> >@@ -33,6 +33,7 @@
> > #include <linux/crc32.h>
> > #include <linux/random.h>
> > #include <linux/workqueue.h>
> >+#include <linux/if_vlan.h>
> > 
> > #include <asm/system.h>
> > #include <asm/bitops.h>
> >@@ -742,7 +743,7 @@
> >                                       PCI_DMA_FROMDEVICE);
> >                        gp->rx_skbs[entry] = new_skb;
 > >                       new_skb->dev = gp->dev;
> >-                       skb_put(new_skb, (ETH_FRAME_LEN + RX_OFFSET));
> >+                       skb_put(new_skb, (VLAN_ETH_FRAME_LEN + RX_OFFSET));
> >                        rxd->buffer = cpu_to_le64(pci_map_page(gp->pdev,
> >                                                               > 
>virt_to_page(new_skb->data),
> >                                                               > 
>offset_in_page(new_skb->data),
> >@@ -1482,6 +1483,9 @@
> > 
> >        gem_clean_rings(gp);
> > 
> >+       gp->rx_buf_sz = min(dev->mtu + ETH_HLEN + VLAN_HLEN,
> >+                           (unsigned)VLAN_ETH_FRAME_LEN);
> >+
> >        for (i = 0; i < RX_RING_SIZE; i++) {
> >                struct sk_buff *skb;
> >                struct gem_rxd *rxd = &gb->rxd[i];
> >@@ -1495,7 +1499,7 @@
> > 
 > >               gp->rx_skbs[i] = skb;
 > >               skb->dev = dev;
> >-               skb_put(skb, (ETH_FRAME_LEN + RX_OFFSET));
> >+               skb_put(skb, (VLAN_ETH_FRAME_LEN + RX_OFFSET));
> >                dma_addr = pci_map_page(gp->pdev,
> >                                        virt_to_page(skb->data),
> >                                        offset_in_page(skb->data),
> >===== drivers/net/sungem.h 1.14 vs edited =====
> >--- 1.14/drivers/net/sungem.h   2004-01-26 18:03:59 +11:00
> >+++ edited/drivers/net/sungem.h 2004-06-21 22:24:46 +10:00
> >@@ -911,7 +911,7 @@
> >          (GP)->tx_old - (GP)->tx_new - 1)
 
> > #define RX_OFFSET          2
> >-#define RX_BUF_ALLOC_SIZE(gp)  ((gp)->dev->mtu + 46 + RX_OFFSET + 64)
> >+#define RX_BUF_ALLOC_SIZE(gp)  ((gp)->rx_buf_sz + 32 + RX_OFFSET + 64)
> > 
> > #define RX_COPY_THRESHOLD  256
> > 
> >@@ -979,6 +979,7 @@
> >        int                     rx_fifo_sz;
> >        int                     rx_pause_off;
> >        int                     rx_pause_on;
> >+       int                     rx_buf_sz;
 > >       int                     mii_phy_addr;
 > >
> >        u32                     mac_rx_cfg;

I've had the same problem, like Soeren, but if i put MTU=1200 there is not 
kernel panic.
I'm going to patch my 2.6.6 with this patch, thanks Herbert.

Best regards

      parent reply	other threads:[~2004-06-21 13:56 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <1087568322.4455.22.camel@localhost>
2004-06-21 12:33 ` sungem - ifconfig eth0 mtu 1300 -> oops Herbert Xu
2004-06-21 13:03   ` Herbert Xu
2004-06-21 20:24     ` Soeren Sonnenburg
2004-06-21 21:11     ` David S. Miller
2004-06-22 14:53       ` Chris Friesen
2004-06-22 15:04         ` Jeff Garzik
2004-06-22 16:03           ` Benjamin Herrenschmidt
2004-06-22 19:35         ` David S. Miller
2004-06-21 13:56   ` Manuel Arostegui Ramirez [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=200406211556.20020.manuel@todo-linux.com \
    --to=manuel@todo-linux.com \
    --cc=benh@kernel.crashing.org \
    --cc=davem@redhat.com \
    --cc=herbert@gondor.apana.org.au \
    --cc=jgarzik@pobox.com \
    --cc=kernel@nn7.de \
    --cc=linux-kernel@vger.kernel.org \
    --cc=netdev@oss.sgi.com \
    /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;
as well as URLs for NNTP newsgroup(s).