12.07.2015 Views

INTRO (9) NetBSD Kernel Developer's Manual INTRO (9) NAME ...

INTRO (9) NetBSD Kernel Developer's Manual INTRO (9) NAME ...

INTRO (9) NetBSD Kernel Developer's Manual INTRO (9) NAME ...

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

ALTQ (9) <strong>NetBSD</strong> <strong>Kernel</strong> Developer’s <strong>Manual</strong> ALTQ (9)if (something_goes_wrong) { | if (something_goes_wrong) {IF_PREPEND(&ifp->if_snd, m); |return; | return;} | }|| /∗ at this point, the driver| ∗ is committed to send this| ∗ packet.| ∗/| IFQ_DEQUEUE(&ifp->if_snd, m);|/∗ kick the hardware ∗/ | /∗ kick the hardware ∗/} | }|Purge operationUse IFQ_PURGE() to empty the queue. Note that a non-work conserving queue cannot be emptied by adequeue loop.##old-style##|while (ifp->if_snd.ifq_head != NULL) {|IF_DEQUEUE(&ifp->if_snd, m); |m_freem(m); |} ||##new-style##IFQ_PURGE(&ifp->if_snd);Attach routineUse IFQ_SET_MAXLEN() to set ifq_maxlen to len. Add IFQ_SET_READY() to show this driver isconverted to the new style. (This is used to distinguish new-style drivers.)##old-style##ifp->if_snd.ifq_maxlen = qsize;if_attach(ifp);Other issuesThe new macros for statistics:##new-style##|| IFQ_SET_MAXLEN(&ifp->if_snd, qsize);| IFQ_SET_READY(&ifp->if_snd);| if_attach(ifp);|##old-style####new-style##|IF_DROP(&ifp->if_snd);| IFQ_INC_DROPS(&ifp->if_snd);|ifp->if_snd.ifq_len++;| IFQ_INC_LEN(&ifp->if_snd);|ifp->if_snd.ifq_len--;| IFQ_DEC_LEN(&ifp->if_snd);|Some drivers instruct the hardware to invoke transmission complete interrupts only when it thinks necessary.Rate-limiting breaks its assumption.<strong>NetBSD</strong> 3.0 October 12, 2006 6

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!