Subject: Re: NetBSD and large pps
To: None <tech-net@netbsd.org>
From: Jed Davis <jdev@panix.com>
List: tech-net
Date: 12/03/2004 13:09:55
--=-=-=

Thor Lancelot Simon <tls@rek.tjls.com> writes:

> On Fri, Dec 03, 2004 at 11:02:22AM +0200, Mihai CHELARU wrote:
>
>> NAPI means RX polling, meaning that not for every packet received there 
>> is an IRQ generated. Don't know more, this is what I understood from 
>
> This is a perfect example of why it's a really bad idea to use marketing
> terms in technical discussion.  By invoking the amorphous "NAPI", you
> have confused two different techniques, interrupt pacing (a.k.a. interrupt
> "coalescing") and strict polling.  Both trade latency for throughput; the
> latter requires moderately painful support in the kernel but will work with
> any network card, the former requires hardware support in the interface
> card but little support in the kernel.

I've gathered from Google that "NAPI" (for "New API") refers to
Linux's implementation of polling; it goes something like this:

* Interfaces start out with receive interrupts enabled.

* When a frame is received in the normal way, that interface is put
  into polling mode; interrupts from it are disabled.

* When an interface is polled and has no more frames to offer, it's
  put back into interrupt mode.

 (Source: http://limnos.csrd.uiuc.edu/notes/linux-networking/core.html
  (among others that were uglier and/or PDF))

In contrast, FreeBSD's polling, which they call "polling", appears to
be all polling, all the time --- with the addition that polls can also
be done during idle time and/or during trap handling (enabled with
sysctls), in addition to being triggered by a timer.

 (Source: http://info.iet.unipi.it/~luigi/polling/ )

So they're both polling, but with rather different ways of trying to
mitigate the latency.


-- 
(let ((C call-with-current-continuation)) (apply (lambda (x y) (x y)) (map
((lambda (r) ((C C) (lambda (s) (r (lambda l (apply (s s) l))))))  (lambda
(f) (lambda (l) (if (null? l) C (lambda (k) (display (car l)) ((f (cdr l))
(C k)))))))    '((#\J #\d #\D #\v #\s) (#\e #\space #\a #\i #\newline)))))

--=-=-=
Content-Type: application/pgp-signature

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.6 (NetBSD)

iD8DBQBBsKv4vweAfvM2WfkRAiLAAKCMrt0fHp0QrhJR/Who4shWwHtu7QCgmFJp
98iYCNbswVcQw4cBUV393lA=
=9r5x
-----END PGP SIGNATURE-----
--=-=-=--