[netdrivers] VLAN patch for natsemi?

Michael Gellman m.gellman at imperial.ac.uk
Wed Aug 10 10:30:20 PDT 2005


Joe:

I looked at the places the patch is modifying, at it appears that the
new driver in debian kernel 2.6.8 has taken this VLAN issue into
account:

        np->rx_config = RxMxdma_256 | RX_DRTH_VAL; 
        /* if receive ring now has bigger buffers than normal, enable
jumbo */
        if (np->rx_buf_sz > NATSEMI_LONGPKT)
                np->rx_config |= RxAcceptLong;

        writel(np->rx_config, ioaddr + RxConfig);

It will enable the RxAcceptLong flag if rx_buf_sz is > 1518, where
rx_buf_sz is set here:

static void set_bufsize(struct net_device *dev)
{
        struct netdev_private *np = netdev_priv(dev);
        if (dev->mtu <= ETH_DATA_LEN)
                np->rx_buf_sz = ETH_DATA_LEN + NATSEMI_HEADERS;
        else
                np->rx_buf_sz = dev->mtu + NATSEMI_HEADERS;
}

NATSEMI_HEADERS is 22, so worst case, the rx_buf_sz is set to 1522,
which is enough to always set RxAcceptLong in the initialization code
above.

To me, it doesn't look like those patches are necessary. One thing you
could try is setting your MTU a bit higher (maybe 1504?) to see if that
changes things, but other than that, I don't know.

--michael

On Wed, 2005-08-10 at 10:31 -0600, Joe Nelson wrote:
> Michael,
> 
> Thanks for the reply.  I've tried two different patches:
> 
> http://centerclick.org/net4801/2.4.27/natsemi_vlan.patch
> http://www.candelatech.com/~greear/vlan/howto.html#natsemi
> 
> The first one looked the most promising but it failed on the second
> two chunks of the patch.  The second one failed completely.  I'm using
> kernel 2.6.8 but I may upgrade to 2.6.11 or .12 if it ends up being
> easy enough.
> 
> On 8/10/05, Michael Gellman <m.gellman at imperial.ac.uk> wrote:
> > I'm not familiar with the board, or with the exact problem, but I have
> > been doing a bit of porting kernel code from 2.4 to 2.6.
> > 
> > Can you give a few links to the patches that you're looking to port to
> > 2.6? Have you actually just tried applying them to a 2.6 kernel, and
> > seen what the result was?
> > 
> > --Michael Gellman
> > 
> > On Mon, 2005-08-08 at 18:47 -0600, Joe Nelson wrote:
> > > I hope this is the right list for this type of question.  After hours
> > > of searching Google and a lot of trial and error, I'm hoping someone
> > > will be able to point me in the right direction.
> > >
> > > I have a Soekris net4501 board with natsemi ethernet onboard.  I'm
> > > running Debian with a 2.6.8 kernel.  I'd like to enable VLANs on this
> > > device.  There's an issue where the current driver doesn't support
> > > packets larger than 1500 bytes.  The VLAN adds 4 bytes to that and
> > > things generally go haywire when that happens.
> > >
> > > I've found a number of patches for the 2.4.X kernels.  I haven't been
> > > able to find any patches for the 2.6.8 kernel.  Here are the
> > > questions:
> > >
> > > 1.  Does a patch exist for th 2.6.8 kernel?
> > > 2.  If not, how easy/hard would it be to modify one of the 2.4 patches to work?
> > >
> > > Thanks in advance.
> > >
> > 
> > _______________________________________________
> > netdrivers mailing list
> > netdrivers at scyld.com
> > http://www.scyld.com/mailman/listinfo/netdrivers
> > 
> 
> 



More information about the netdrivers mailing list