[746] in linux-net channel archive
Re: How about a lance driver that receives directly into skbs?
daemon@ATHENA.MIT.EDU (Donald Becker)
Fri Jul 21 08:16:11 1995
Date: Thu, 20 Jul 95 23:51:47 EDT
From: becker@cesdis1.gsfc.nasa.gov (Donald Becker)
To: ftom@netcom.com, linux-net@vger.rutgers.edu
>> 1. Always keeping max-size skbuffs for the device's Rx buffer ring, but
>> allocating a smaller skbuff and copying the data if we get a "small"
>> packet.
Tom May wrote
>is a decent compromise since the copy/csum is swamped by other
>overhead for small packets. It also has the advantage of quickly
>returning the skbuff to the rx ring (assuming the "loanout" stuff
>below is implemented) which is important for back-to-back small packet
>reception. Unfortunately, the divison between small and large is a
>system-dependent tuning thing.
I wasn't planning on using "driver loanouts". I was going to have the
driver just pass the full skbuff to the protocol layers and allocate a new
full-sized skbuff to replace it. A mostly-empty skbuff would have the data
copied+checksummed to a newly allocate small skbuff, and the driver would
retain the full-sized one.
The skbuff allocator should encapsulate the smarts to keep a handful of
full-sized skbuffs around. Although we should decide what "full-sized" is:
perhaps <sizeof skbuff header> + 1536 for ethernet. 1536 provides some
slop over a max-sized ethernet packet, and is 3*512.
>The non-Linux AMD79C960/965 driver I did owned the buffers, and filled
>in the rx ring if necessary as the buffers were freed. In addition,
>all the buffers were preallocated in the low 16MB of memory for the
>ISA version. Determining how many buffers to allocate was trial and
>error (queueing theorists may disagree :-)
I think loanouts are great if you have significant network traffic in a
controlled environment with only LANCE-like chips. (Sigh. I really envy
those people that only have to deal with LANCEs, or perhaps an occasional
82586.) But these are PCs with uncontrolled configurations, not
workstations. Relatively few network interfaces are LANCE-like, and the
other interfaces wouldn't benefit from loanouts.
Also some installations will only have very light network use and are low on
memory. Having a seperate skbuff allocator allows excess network buffers to
be returned to the system-wide buffer pool.
Donald Becker becker@cesdis.gsfc.nasa.gov
USRA Center of Excellence in Space Data and Information Sciences.
Code 930.5, Goddard Space Flight Center, Greenbelt, MD. 20771
301-286-0882 http://cesdis.gsfc.nasa.gov/pub/people/becker/whoiam.html