Red Hat axp-list: Linux on Alpha (1995-2022)
 help / color / mirror / Atom feed
* various network drivers at Linux kernels (was: Miata Networking...)
  1998-10-11 13:13 Miata Networking nonexistent Jay.Estabrook
@ 1998-10-11 18:32 ` Matti Aarnio
  0 siblings, 0 replies; 3+ messages in thread
From: Matti Aarnio @ 1998-10-11 18:32 UTC (permalink / raw)
  To: axp-list; +Cc: linux-net

...
> > You can try to compile in the de4x5.c driver, and hardwire it to
> > 100Mbit/s.  Have a look in the de4x5.c source code -- one has to activate
> > a certain define with certain values; hereafter the card should always
> > come up in 100Mbit/s mode.
> 
> That workaround (hardwire the de4x5 driver to 100MBit) has worked well in
> the past. Also meeting with some success is using Donald Becker's latest
> tulip driver (0.89H?) and providing a media type argument on the boot
> command line, to perform the "hardwiring" at the last minute. Check his
> website for details (http://cesdis.gsfc.nasa.gov/linux/drivers/tulip.html).

  The current tulip.c driver at 2.1.124/125 kernel is about a year old
(eh, really??)  -- 10/19/97 wow.. but it nevertheless works fine at my
Miata (PWS 433a) against a cisco Catalyst 2924 (if I remember it right).

However against BayNet T350 10/100 switch it had problems at getting
speed negotiated to 100BaseT(fdx).  Or rather, switch considered the speed
to be 10Mbps, while my machine considered it to be 100Mbps, and then *both*
switched to other speed at about the same time.   Sigh...
Hardwiring the speed helped, of course.

> The builtin 21143 on the MIATA only seems to be a problem at 100Mbit, which,
> unfortunately, is becoming more widespread. The biggest problem is that
> neither driver writer has had decent access to a MIATA... :-\

Yeah, oddly the Tulip driver at 2.0.35 is from 4/7/98. (version 0.88)

The version of the Tulip driver at 2.1.124 contains various other
bugfixes, most important of which (I think) is SKB allocation out-of-memory
handling code, which Donald has not yet believed to be necessary for those
drivers which have rx_skbuff[] rings.  :-(

Speaking of which, a quick browse shows me that: 

tulip.c at 2.0.35 has this rx_skbuff[] ring problem.

3c59x.c (up to and including version 0.99G!) driver does blow up if that
ring can not be refilled successfully...

eepro100.c's code (at 2.1.124, v0.36) is rather unclear at what it does,
but it looks likely to be able to survive the situation.

de4x5.c (v0.542) driver will always alloc a new skb at an Alpha, and
then copy the data there.  If the alloc fails, it is skipped. (No kernel
crash from that...)  (But this isn't Donald's  rx_skbuff[]  beasts either..)

> --Jay++
> Jay A Estabrook                            Alpha Motherboards - LINUX Project
> Compaq Computer Corporation                (508) 841-3241 or (DTN) 237-3241
> 334 South Street, Shrewsbury, MA 01545     Jay.Estabrook@digital.com

/Matti Aarnio <matti.aarnio@sonera.fi>


^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: various network drivers at Linux kernels (was: Miata Networking...)
       [not found] <Pine.SUN.3.91.981011201906.10565C-100000@yukon>
@ 1998-10-12  4:31 ` Mr. James W. Laferriere
  1998-10-12 17:02 ` Matti Aarnio
  1 sibling, 0 replies; 3+ messages in thread
From: Mr. James W. Laferriere @ 1998-10-12  4:31 UTC (permalink / raw)
  To: Donald Becker; +Cc: Matti Aarnio, axp-list, linux-net


	Hello Donald,  Got v1.04 & am compiling up 2.0.35 + alan pre-14
	now ,  Will report back soon on the mii-diag necessity problem.
	Hth, JimL

On Sun, 11 Oct 1998, Donald Becker wrote:
> On Sun, 11 Oct 1998, Matti Aarnio wrote:
> > The version of the Tulip driver at 2.1.124 contains various other
> > bugfixes, most important of which (I think) is SKB allocation out-of-memory
> > handling code, which Donald has not yet believed to be necessary for those
> > drivers which have rx_skbuff[] rings.  :-(
> 
> Look again: the older versions of the tulip driver (and most other
> descriptor-based bus-master driver) used an drop-immediately scheme.  If
> they could not allocate a refill skbuff, they dropped the packet and kept
> the old skbuff on the receive ring.  This was to avoid having the chip ever
> shut down from lack of receive buffers.
> 
> This worked pretty well until there was a kernel version that tended to keep
> too little free memory around for interrupt handlers.  Even though there was
> plenty of physical memory, it was all being used for buffer cache.  This
> caused drivers to drop a lot of packets even though a few milliseconds later
> the kernel could come up with a whole bunch of free memory.
> 
> So I slowly changed all of my descriptor-based drivers to instead use a
> "buffer deficit" scheme, where the driver passes all  of the received
> packets to the queue layer in the first phase, and then refills the receive
> ring later.  If the machine runs temporarily short of memory the recieve
> ring will be refilled at the next Rx interrupt.  Only if it's persistently
> short of memory will the receive ring empty of buffers and drop packets.
> 
> This "buffer deficit" scheme has another beneficial effect: most new chips
> which implement hardware flow control can only trigger FC packets when
> running out of buffers, not in response to a driver-level request.  BTW,
> hardware flow control is unrelated to the misnamed code in the new kernel.
> That new code should be called "randomly drop packets when actually doing
> work".
> 
> > Speaking of which, a quick browse shows me that: 
> > 
> > tulip.c at 2.0.35 has this rx_skbuff[] ring problem.
> 
> See above -- it just has a different structure.
> 
> 
> > 3c59x.c (up to and including version 0.99G!) driver does blow up if that
> > ring can not be refilled successfully...
> 
> The 3c59x.c driver has a related bug: it has a limit check at the end of a
> loop instead of the beginning.  (A mistaken optimization on my part.)  If
> the receive ring cannot be filled and empties completely, there are
> obviously no packets to receive.  But with the limit check at the end of the
> loop, the driver will think that and old, already-processed packet is a new
> one.  Disaster occurs..  This same bug exists in the eepro100.c driver.
> (However the current tulip driver *does* have the check in the correct
> place.)
> 
> > eepro100.c's code (at 2.1.124, v0.36) is rather unclear at what it does,
> > but it looks likely to be able to survive the situation.
> 
> That old driver version has another low-memory receive bug, and a multicast
> list race condition.  The new driver, v1.04, supports newer board versions, is
> much more robust when rapidly changing large multicast filters (Appletalk
> environments!), cache aligns transmit descriptors, and enables hardware flow
> control on the i82558.
> 
> > de4x5.c (v0.542) driver will always alloc a new skb at an Alpha, and
> > then copy the data there.  If the alloc fails, it is skipped. (No kernel
> > crash from that...)  (But this isn't Donald's  rx_skbuff[]  beasts either..)
> 
> That's similar to what my drivers used to do.  It's a natural progression
> from the original driver model, which was "copy into a fresh skbuff", to the
> zero-copy "receive directly into an skbuff and refill the slot immediately".
> 
> An advantage to copying with the Alpha is that the Tulip must have
> word-aligned receive buffers.  With 14 byte Ethernet headers, the IP headers
> are always misaligned.  The Linux protocol code doesn't (didn't) have
> get_unaligned() calls for disassembling packets, so uncopied packets cause
> alignment traps.  When copying packets (or with a better chip) you can do
> skb_reserve(skb,2) to align the IP header.
> 
> Donald Becker					  becker@cesdis.gsfc.nasa.gov
> USRA-CESDIS, 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/people/becker/whoiam.html
> 
> -
> To unsubscribe from this list: send the line "unsubscribe linux-net" in
> the body of a message to majordomo@vger.rutgers.edu
> 

 				, JimL
+-----------------------------------------------------------------------+ 
|  James W. Laferriere  -  Network  Engineer  - babydr@baby-dragons.com |
|   System Techniques   -  25416  -  22nd S.  - Des-Moines, WA  98198   |
|     Give me VMS     -or-   Give me Linux   -but-   only on AXP        |
+-----------------------------------------------------------------------+


^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: various network drivers at Linux kernels (was: Miata Networking...)
       [not found] <Pine.SUN.3.91.981011201906.10565C-100000@yukon>
  1998-10-12  4:31 ` various network drivers at Linux kernels (was: Miata Networking...) Mr. James W. Laferriere
@ 1998-10-12 17:02 ` Matti Aarnio
  1 sibling, 0 replies; 3+ messages in thread
From: Matti Aarnio @ 1998-10-12 17:02 UTC (permalink / raw)
  To: Donald Becker; +Cc: matti.aarnio, axp-list, linux-net

Donald Becker <becker@cesdis1.gsfc.nasa.gov> replies to me:
... 
> This "buffer deficit" scheme has another beneficial effect: most new chips
> which implement hardware flow control can only trigger FC packets when
> running out of buffers, not in response to a driver-level request.  BTW,
> hardware flow control is unrelated to the misnamed code in the new kernel.
> That new code should be called "randomly drop packets when actually doing
> work".
> 
> > Speaking of which, a quick browse shows me that: 
> > tulip.c at 2.0.35 has this rx_skbuff[] ring problem.
>
> See above -- it just has a different structure.

 Eh ?  Ok, I take your word on it.

> > 3c59x.c (up to and including version 0.99G!) driver does blow up if that
> > ring can not be refilled successfully...
> 
> The 3c59x.c driver has a related bug: it has a limit check at the end of a
> loop instead of the beginning.  (A mistaken optimization on my part.)  If
> the receive ring cannot be filled and empties completely, there are
> obviously no packets to receive.  But with the limit check at the end of the
> loop, the driver will think that and old, already-processed packet is a new
> one.  Disaster occurs..  This same bug exists in the eepro100.c driver.
> (However the current tulip driver *does* have the check in the correct
> place.)

	When can I have the fixed 3c59x.c ?
	Could it be worth pushing to Linus too ?

...
> > de4x5.c (v0.542) driver will always alloc a new skb at an Alpha, and
> > then copy the data there.  If the alloc fails, it is skipped. (No kernel
> > crash from that...)  (But this isn't Donald's  rx_skbuff[]  beasts either..)
> 
> That's similar to what my drivers used to do.  It's a natural progression
> from the original driver model, which was "copy into a fresh skbuff", to the
> zero-copy "receive directly into an skbuff and refill the slot immediately".
> 
> An advantage to copying with the Alpha is that the Tulip must have
> word-aligned receive buffers.  With 14 byte Ethernet headers, the IP headers
> are always misaligned.  The Linux protocol code doesn't (didn't) have
> get_unaligned() calls for disassembling packets, so uncopied packets cause
> alignment traps.  When copying packets (or with a better chip) you can do
> skb_reserve(skb,2) to align the IP header.

	I puzzled this a bit, and then pulled 21143HRM (Hardware Reference
	Manual) from Intel's site. 

	The chip supports having two buffers per ring descriptor entry,
	but there the rule of 'buffer size must be multiple of 4 bytes'
	does seem to block a possibly interesting way to split the frame
	into two parts with nice alignments...  ("Copy the first 14 octets
	into buffer 1, then continue into buffer2 for the rest. Create the
	buffer1 to be 16 bytes before buffer2, and copy the initial 14
	bytes into proper alignment after the reception.")

	Of course the manual does not say, what will happen in this case
	the receive buffer1 size is 14, would the chip just store 14 real
	input bytes, and two nonsense ones into the buffer area, or would
	it completely refuse to store the bytes, or would it store 16 bytes,
	and then continue with buffer2 ?

> Donald Becker					  becker@cesdis.gsfc.nasa.gov
> 301-286-0882	     http://cesdis.gsfc.nasa.gov/people/becker/whoiam.html

/Matti Aarnio <matti.aarnio@sonera.fi>


^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~1998-10-12 17:11 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
     [not found] <Pine.SUN.3.91.981011201906.10565C-100000@yukon>
1998-10-12  4:31 ` various network drivers at Linux kernels (was: Miata Networking...) Mr. James W. Laferriere
1998-10-12 17:02 ` Matti Aarnio
1998-10-11 13:13 Miata Networking nonexistent Jay.Estabrook
1998-10-11 18:32 ` various network drivers at Linux kernels (was: Miata Networking...) Matti Aarnio

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox