Subject: Re: if_iqdrops deprecated?
To: Kevin Lahey <>
From: Jonathan Stone <jonathan@DSG.Stanford.EDU>
List: tech-net
Date: 05/17/2000 15:25:30
In message <200005172152.OAA16999@Gregorio.Stanford.EDU>"Kevin Lahey" writes
>In message <>,
>"Castor Fu" writes:
>>Is the use of if_iqdrops to keep track of dropped input packets

Weird. Just yesterday I ran into what looks like a bug in someone's
TCP, possibly related to input queue overflows in NetBSD.  I needed to
check per-interface drops and realized I coudln't coudln't find
anything from it...

Interfaces only have output-side queues (if_snd).  When an interface
driver pulls a packet off an interface, most interfaces call a generic
MAC function (e.g., ether_input(), fddi_input(), etc.).  The input
function demultiplexes the packet to a protocol input queue.
Call that protocol queue "inq"

The input routine does if (IF_QFULL(inq)) IF_DROP(inq) and frees the
mbuf chain.  But there' no per-interface statistics on input drops.

There is an ifi_iqdrop field, but that desn't seem to be used by the
"generic" input handlers.

>Doesn't "netstat -q" report that?

You mean netstat -p? I couldn't find input drops under netstat -p ip.

Once I get my current deadline met, I'd like to add a netstat option
which (with -w <n>) that shows packet *and* byte counts from a single
interface.  : theres no point showing in/out totals if you're only
showing one interface, and that should leave enough to show
packet/bypte rates, collisions, errors and output drops.

>>Most netbsd drivers seem not to use it.
>It looks like this is taken care of in the IF_DROP macro,
>isn't it?  It looks like the link-layer handling stuff
>in /sys/net/if_{ppp,ether,hippi,whatever}.c takes care of
>most of this...

Sort of.  A cursory look didnt pull up any references to a struct
ifqueue in ipintrq, which is where IP input drops would be counted.

Castor: If you're asking, why don't ether_input(), fddi_input(),
etc. update the if_qdrops field, that seems like a good question.