svn commit: r191344 - head/sys/dev/xl

Pyun YongHyeon pyunyh at gmail.com
Wed Apr 22 01:25:04 UTC 2009


On Tue, Apr 21, 2009 at 10:24:07AM +0100, Robert Watson wrote:
> 
> On Tue, 21 Apr 2009, Pyun YongHyeon wrote:
> 
> > Clear IFF_DRV_OACTIVE flag if one of queued packets was transmitted.
> > Previously it used to clear the flag only when the transmit queue
> > is empty which may slow down Tx performance.
> > While I'm here check whether driver is running and whether we can
> > queue more packets in if_start handler. This fixes occasional
> > watchdog timeouts.
> 
> Historically, IFF_DRV_OACTIVE was present to allow the driver to prevent 
> calls to if_start when the driver was already in the transmit steady state 
> (i.e., interrupt-driven transmit).  When the transmit interrupt saw it was 
> out of queued packets and interrupt-driven transmission was ending, it 
> would clear the flag so that future enqueues to the now-empty queue would 
> generate an if_start to trigger interrupt-driven transmission again.  With 
> that in mind -- are you sure this is the right change?  Shouldn't the 

Yes.

> descriptor ring be refilled when an interrupt comes in from the device 
> after an appropriate interval?
> 

Since interrupt handler knows that hardware can queue more packets
if it reclaimed transmitted frames, clearing IFF_DRV_OACTIVE would
make if_start called again. It's also possible this may be waste of
time due to lack of free Tx descriptors when sending a highly
fragmented frame but most cases it will refill Tx descriptor full.
Keeping Tx queue full seems to be one of key factor to get best
performance from the hardware. The Tx descriptor counter for xl(4)
is 256 which I think somewhat large value for fast-ethernet
controllers. I didn't benchmark performance differences after the
change but 128 would be enough after my change.


More information about the svn-src-all mailing list