Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id ; Thu, 19 Sep 2002 18:23:23 -0400 Received: (majordomo@vger.kernel.org) by vger.kernel.org id ; Thu, 19 Sep 2002 18:23:23 -0400 Received: from dsl093-058-082.blt1.dsl.speakeasy.net ([66.93.58.82]:31222 "EHLO beohost.scyld.com") by vger.kernel.org with ESMTP id ; Thu, 19 Sep 2002 18:23:22 -0400 Date: Thu, 19 Sep 2002 18:28:09 -0400 (EDT) From: Donald Becker To: Jason Lunz cc: Jeff Garzik , , Linux Kernel Mailing List , Richard Gooch , "Patrick R. McManus" , Subject: Re: PATCH: sundance #5 (variable per-interface MTU support) In-Reply-To: <20020919210348.GC17492@orr.falooley.org> Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Sender: linux-kernel-owner@vger.kernel.org X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1335 Lines: 35 On Thu, 19 Sep 2002, Jason Lunz wrote: > This is a straightforward merge of variable mtu from donald's driver. - np->rx_buf_sz = (dev->mtu <= 1500 ? PKT_BUF_SZ : dev->mtu + 32); + np->rx_buf_sz = (dev->mtu <= 1500 ? PKT_BUF_SZ : dev->mtu + 36); Errrmm, not quite right. Try np->rx_buf_sz = (dev->mtu <= 1520 ? PKT_BUF_SZ : dev->mtu + 16); The idea is that all ethernet-like drivers always allocate skbuffs of the same size, PKT_BUF_SZ (1536=3*512), unless a jumbo MTU forces a larger size. Specificially, using VLANs (+4 bytes on the frame size) on some interfaces should not result in a mix of allocation sizes. Most VLAN-like encapsulation should add fewer than (1536-1518 = 18) 18 extra bytes. BTW, always leave a few extra bytes at the end of the data buffer. You never know when some chip might decide to dribble an extra word or two, or include the CRC because someone frobbed the driver. -- Donald Becker becker@scyld.com Scyld Computing Corporation http://www.scyld.com 410 Severn Ave. Suite 210 Second Generation Beowulf Clusters Annapolis MD 21403 410-990-9993 - To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/