[vortex-bug] Tx int. mitigation

Donald Becker becker@scyld.com
Fri, 15 Dec 2000 12:44:12 -0500 (EST)


On Fri, 15 Dec 2000, Bogdan Costescu wrote:
> On Thu, 14 Dec 2000, Donald Becker wrote:
> 
> > > > You should be calculating the Tx gap the other way.
> 
> Sorry, I wanted to ask this before, but I forgot... The original question
> was about time that downloaded skbuffs can be kept before free-ing. What I
> have proposed (full ring, max sized packets, 10 Mbit/s) was to prove that
> packets can be kept in the driver's Tx ring for aprox. 20 ms in a normal
> situation; why don't the upper levels protest about this ?

The upper levels care if the packets have been transmitted.
At 10Mbps the packets have not been transmitted, and the upper levels notice
this and don't schedule that data for retransmission.  (This is a
oversimplification, but a good mental model when writing a driver.)

At 100Mbps the packets have actually been transmitted, and the transmitter
is now idle.  Yet the skbuffs are locked and charged against the socket's
memory allocation so it won't try to transmit again.  (Again, an
oversimplification, but a good mental model.)

> > > Exactly, which means that the upper layer will call start_xmit() again and
> > > you can free the tail of the queue at that moment.
> >
> > But the upper layer won't call it with dev->tbusy set.
> 
> That's the same statement that you have made in the older thread about
> tbusy and tx_full. I don't understand: if you are sure that the upper
> levels don't call when tbusy is set, why do you check for it at the
> beginning of start_xmit() before returning or calling tx_timeout() ?
> I understood that using tbusy as a flag for the upper levels was the
> original ideea, but what it is _now_ in the kernel (2.2) ?

The upper layers on older kernels will occasionally call start xmit with
dev->tbusy set.  But this only happens with packet retransmissions, not with
normal-path packets.  Retransmissions occur on the order of seconds or even
minutes, not microseconds.

This "feature" of the queue layer was used as a transmit watchdog long ago
before there were dynamically allocated timers.  The semantics of
retransmission matched this need exactly.

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