[vortex] newbie q. about 3c59x.c (16Aug2000 version)

Andrew Morton andrewm@uow.edu.au
Wed, 04 Oct 2000 00:59:26 +1100


Asgharifard Massoud wrote:
> 
> Hi,
> 
> I was studying the 3c59x.c (whose version string is
> static char version[] =
> "3c59x.c 16Aug00 Donald Becker and others
> http://www.scyld.com/network/vortex.html\n";)
> 
> I have a few questions, and would be very grateful if
> someone kindly answers them.
> 
> 1- At boomerang_rx(), when driver refills the
> rx_ring[]
> why sends a UpUnStall at the end of EACH skb
> allocation? Isn't it a Better idea (tm?) to send the
> UpUnStall to NIC after all skb's has been allocated?

Yes, this is expensive.  The cost of this will be significantly lowered
if the driver uses memory-mapped I/O on the PCI bus.  That driver
doesn't, but Donald's does.

It will in fact be very rare for the upload engine to be in a stalled
state (we ran out of Rx buffers and may even have experienced an overrun
if we also ran out of on-chip FIFO).

But if the Rx engine _is_ stalled then yes, we'll need to unstall it
each time we add a new buffer, if we're being really paranoid.

Given that it's very unlikely for the Rx engine to stall it's probably
better to just do the UpUnstall once, after we've finished filling the
Rx ring.

Using the 3c905C's upload polling mechanism may be even smarter,
although I haven't made my mind up about whether the whole
bus-mastering-poll idea is a good one...

But you make a good point and this is an area which needs thinking
about.

> 2- At the end of boomerang_interrupt(), when driver
> wants to acknowledge the interrupts (and after line
> outw(AckIntr | IntReq | IntLatch, ioaddr + EL3_CMD); )
> 
> why the driver doesn't wait a little to let the driver
> get this and set the InterruptLatch to zero?

It's possible that some of the interrupt acks in that loop can be
optimised or collapsed together.  But what makes you think that a delay
is needed??