Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 19 Jun 2006 16:22:33 -0700 (PDT)
From:      John Polstra <jdp@polstra.com>
To:        John-Mark Gurney <gurney_j@resnet.uoregon.edu>
Cc:        freebsd-net@freebsd.org
Subject:   Re: IF_HANDOFF vs. IFQ_HANDOFF
Message-ID:  <XFMail.20060619162233.jdp@polstra.com>
In-Reply-To: <20060618194044.GC1142@funkthat.com>

next in thread | previous in thread | raw e-mail | index | archive | help
On 18-Jun-2006 John-Mark Gurney wrote:
> John Polstra wrote this message on Thu, Jun 15, 2006 at 09:18 -0700:
>> in the HW but have not yet completed.  When the completion interrupt
>> comes in, the driver is supposed to check the if_snd queue for more
>> mbufs and process them.  Only when the transmit side of the HW goes
>> totally idle should IFF_OACTIVE be cleared again.  Most of our drivers
>> set the flag only when they run out of transmit descriptors (i.e.,
>> practically never), which is just plain wrong.
> 
> But the problem is that for small packets, this can mean that there
> will be a delay in handling the ring if we wait to process packets
> once the tx ring is empty.. if we ever want to max out gige w/ 64byte
> packets, we have to clear OACTIVE whenever tx approches running out
> of packets before we can send this..

Yes, I see your point.

> In most cases we don't know how long that is (since we don't keep
> track of packet sizes, etc), so it's easiest/best to clear it
> whenever the tx ring is not full...

I guess it depends on when you get interrupts from the particular
network adapter.  If you're taking an interrupt on every transmit
completion, it's best to check the if_snd queue at that point, when
you've already entered the driver anyway.  In that case, you might as
well leave OACTIVE set until the adapter goes idle, to suppress the
redundant calls to if_start.  (The transmitter won't go idle if there
is enough traffic to max out the link capacity.)

But if you only get an interrupt when the transmitter has gone idle
then I agree, if_start needs to be called in order to keep the
descriptor ring full enough.

John



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?XFMail.20060619162233.jdp>