Lines Matching +full:a +full:- +full:m

19 .\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
43 .Fn IFQ_ENQUEUE "struct ifaltq *ifq" "struct mbuf *m" "int error"
44 .Fn IFQ_HANDOFF "struct ifnet *ifp" "struct mbuf *m" "int error"
46 .Fa "struct ifnet *ifp" "struct mbuf *m" "int adjust" "int error"
50 .Fn IFQ_DEQUEUE "struct ifaltq *ifq" "struct mbuf *m"
51 .Fn IFQ_POLL_NOLOCK "struct ifaltq *ifq" "struct mbuf *m"
56 .Fn IFQ_DRV_DEQUEUE "struct ifaltq *ifq" "struct mbuf *m"
57 .Fn IFQ_DRV_PREPEND "struct ifaltq *ifq" "struct mbuf *m"
70 system is a framework to manage queuing disciplines on network
86 enqueue a packet
87 .Fa m
97 .Fa m
100 .Fa m
110 dequeues a packet from the queue.
112 .Fa m ,
114 .Fa m
119 .Fa m
120 since a non-empty queue could return
122 under rate-limiting.
128 in order to guarantee that a subsequent call to
141 The purge operation is needed since a non-work conserving queue cannot be
142 emptied by a dequeue loop.
150 if the queuing discipline is non-work conserving.
154 .Fa ifq->ifq_drv_maxlen
158 .Fa m .
161 .Fa m
164 even for a non-empty queue.
173 for a given queue sets
184 Note that a driver must not mix
192 .Fa m
234 sets a flag to indicate that a driver was converted to use the new macros.
249 .Bd -literal
250 ##old-style## ##new-style##
268 .Bd -literal
269 ##old-style## ##new-style##
283 .Bd -literal
284 #define IFQ_DEQUEUE(ifq, m) \e
286 ALTQ_DEQUEUE((ifq), (m)); \e
288 IF_DEQUEUE((ifq), (m));
297 .Bd -literal
298 #define IFQ_ENQUEUE(ifq, m, error) \e
301 m_freem((m)); \e
305 IF_ENQUEUE((ifq), (m)); \e
314 .Bl -hyphen -compact
316 queue a packet,
318 drop (and free) a packet if the enqueue operation fails.
326 .Fa m
348 .Bd -literal
349 ##old-style## ##new-style##
356 | mflags = m->m_flags;
357 | len = m->m_pkthdr.len;
359 if (IF_QFULL(&ifp->if_snd)) { | IFQ_ENQUEUE(&ifp->if_snd, m,
361 IF_DROP(&ifp->if_snd); | if (error != 0) {
365 IF_ENQUEUE(&ifp->if_snd, m); |
366 ifp->if_obytes += | ifp->if_obytes += len;
367 m->m_pkthdr.len; |
368 if (m->m_flags & M_MCAST) | if (mflags & M_MCAST)
369 ifp->if_omcasts++; | ifp->if_omcasts++;
371 if ((ifp->if_flags & IFF_OACTIVE) | if ((ifp->if_flags & IFF_OACTIVE)
373 (*ifp->if_start)(ifp); | (*ifp->if_start)(ifp);
378 if (m) | if (m)
379 m_freem(m); | m_freem(m);
399 .Bd -literal
400 ##old-style## ##new-style##
402 if (ifp->if_snd.ifq_head != NULL) | if (!IFQ_IS_EMPTY(&ifp->if_snd))
414 if the queue is under rate-limiting.
430 due to rate-limiting.
431 .Bd -literal
432 ##old-style## ##new-style##
434 IF_DEQUEUE(&ifp->if_snd, m); | IFQ_DEQUEUE(&ifp->if_snd, m);
435 | if (m == NULL)
439 A driver is supposed to call
442 .Ss Poll-and-dequeue operation
448 .Bd -literal
449 ##old-style## ##new-style##
451 | IFQ_LOCK(&ifp->if_snd);
452 m = ifp->if_snd.ifq_head; | IFQ_POLL_NOLOCK(&ifp->if_snd, m);
453 if (m != NULL) { | if (m != NULL) {
455 /* use m to get resources */ | /* use m to get resources */
457 | IFQ_UNLOCK(&ifp->if_snd);
460 IF_DEQUEUE(&ifp->if_snd, m); | IFQ_DEQUEUE_NOLOCK(&ifp->if_snd, m);
461 | IFQ_UNLOCK(&ifp->if_snd);
469 under the same lock as a previous
477 you have to eliminate it unless you can use a
481 as a substitute.
482 A common usage of
485 You have to convert the logic into poll-and-dequeue.
486 .Bd -literal
487 ##old-style## ##new-style##
489 | IFQ_LOCK(&ifp->if_snd);
490 IF_DEQUEUE(&ifp->if_snd, m); | IFQ_POLL_NOLOCK(&ifp->if_snd, m);
491 if (m != NULL) { | if (m != NULL) {
494 IF_PREPEND(&ifp->if_snd, m); | IFQ_UNLOCK(&ifp->if_snd);
502 | IFQ_DEQUEUE_NOLOCK(&ifp->if_snd, m);
503 | IFQ_UNLOCK(&ifp->if_snd);
513 Note that a non-work conserving queue cannot be emptied by a dequeue loop.
514 .Bd -literal
515 ##old-style## ##new-style##
517 while (ifp->if_snd.ifq_head != NULL) {| IFQ_PURGE(&ifp->if_snd);
518 IF_DEQUEUE(&ifp->if_snd, m); |
519 m_freem(m); |
523 .Ss Conversion using a driver managed queue
531 .Bd -literal
532 ##old-style## ##new-style##
534 if (ifp->if_snd.ifq_head != NULL) | if (!IFQ_DRV_IS_EMPTY(&ifp->if_snd))
542 are protected with a mutex of some kind.
552 with a sensible value if you plan to use the
558 (This is used to distinguish new-style drivers.)
559 .Bd -literal
560 ##old-style## ##new-style##
562 ifp->if_snd.ifq_maxlen = qsize; | IFQ_SET_MAXLEN(&ifp->if_snd, qsize);
563 | ifp->if_snd.ifq_drv_maxlen = qsize;
564 | IFQ_SET_READY(&ifp->if_snd);
570 .Bd -literal
571 ##old-style## ##new-style##
573 IF_DROP(&ifp->if_snd); | IFQ_INC_DROPS(&ifp->if_snd);
575 ifp->if_snd.ifq_len++; | IFQ_INC_LEN(&ifp->if_snd);
577 ifp->if_snd.ifq_len--; | IFQ_DEC_LEN(&ifp->if_snd);