diff options
| author | Julian Elischer <julian@FreeBSD.org> | 2004-06-25 19:22:05 +0000 |
|---|---|---|
| committer | Julian Elischer <julian@FreeBSD.org> | 2004-06-25 19:22:05 +0000 |
| commit | 327b288e5ce5515e6914ef443418cf2401384fe7 (patch) | |
| tree | e6486f45de5c63b28a090942d8f046694d0329cb /sys/dev | |
| parent | 865897c9f1191913bae430d5d7ec86ad6c7d782b (diff) | |
Notes
Diffstat (limited to 'sys/dev')
| -rw-r--r-- | sys/dev/ar/if_ar.c | 11 | ||||
| -rw-r--r-- | sys/dev/cp/if_cp.c | 14 | ||||
| -rw-r--r-- | sys/dev/ctau/if_ct.c | 14 | ||||
| -rw-r--r-- | sys/dev/cx/if_cx.c | 14 | ||||
| -rw-r--r-- | sys/dev/sr/if_sr.c | 11 | ||||
| -rw-r--r-- | sys/dev/usb/udbp.c | 12 |
6 files changed, 43 insertions, 33 deletions
diff --git a/sys/dev/ar/if_ar.c b/sys/dev/ar/if_ar.c index 0ac2af4ed17b..0b98b7a6b565 100644 --- a/sys/dev/ar/if_ar.c +++ b/sys/dev/ar/if_ar.c @@ -2228,10 +2228,9 @@ ngar_rcvdata(hook_p hook, item_p item) struct ar_softc * sc = NG_NODE_PRIVATE(NG_HOOK_NODE(hook)); struct ifqueue *xmitq_p; struct mbuf *m; - meta_p meta; + struct ng_tag_prio *ptag; NGI_GET_M(item, m); - NGI_GET_META(item, meta); NG_FREE_ITEM(item); /* * data doesn't come in from just anywhere (e.g control hook) @@ -2244,11 +2243,12 @@ ngar_rcvdata(hook_p hook, item_p item) /* * Now queue the data for when it can be sent */ - if (meta && meta->priority > 0) { + if ((ptag = (struct ng_tag_prio *)m_tag_locate(m, NGM_GENERIC_COOKIE, + NG_TAG_PRIO, NULL)) != NULL && (ptag->priority > NG_PRIO_CUTOFF) ) xmitq_p = (&sc->xmitq_hipri); - } else { + else xmitq_p = (&sc->xmitq); - } + s = splimp(); IF_LOCK(xmitq_p); if (_IF_QFULL(xmitq_p)) { @@ -2270,7 +2270,6 @@ bad: * check if we need to free the mbuf, and then return the error */ NG_FREE_M(m); - NG_FREE_META(meta); return (error); } diff --git a/sys/dev/cp/if_cp.c b/sys/dev/cp/if_cp.c index dfb4a7e662d7..728df8026bd4 100644 --- a/sys/dev/cp/if_cp.c +++ b/sys/dev/cp/if_cp.c @@ -2261,7 +2261,7 @@ static int ng_cp_rcvdata (hook_p hook, item_p item) { drv_t *d = NG_NODE_PRIVATE (NG_HOOK_NODE(hook)); struct mbuf *m; - meta_p meta; + struct ng_tag_prio *ptag; #else static int ng_cp_rcvdata (hook_p hook, struct mbuf *m, meta_p meta) { @@ -2273,18 +2273,23 @@ static int ng_cp_rcvdata (hook_p hook, struct mbuf *m, meta_p meta) CP_DEBUG2 (d, ("Rcvdata\n")); #if __FreeBSD_version >= 500000 NGI_GET_M (item, m); - NGI_GET_META (item, meta); NG_FREE_ITEM (item); if (! NG_HOOK_PRIVATE (hook) || ! d) { NG_FREE_M (m); - NG_FREE_META (meta); #else if (! hook->private || ! d) { NG_FREE_DATA (m,meta); #endif return ENETDOWN; } - q = (meta && meta->priority > 0) ? &d->hi_queue : &d->queue; + + /* Check for high priority data */ + if ((ptag = (struct ng_tag_prio *)m_tag_locate(m, NGM_GENERIC_COOKIE, + NG_TAG_PRIO, NULL)) != NULL && (ptag->priority > NG_PRIO_CUTOFF) ) + q = &d->hi_queue; + else + q = &d->queue; + s = splimp (); #if __FreeBSD_version >= 500000 IF_LOCK (q); @@ -2293,7 +2298,6 @@ static int ng_cp_rcvdata (hook_p hook, struct mbuf *m, meta_p meta) IF_UNLOCK (q); splx (s); NG_FREE_M (m); - NG_FREE_META (meta); return ENOBUFS; } _IF_ENQUEUE (q, m); diff --git a/sys/dev/ctau/if_ct.c b/sys/dev/ctau/if_ct.c index f4cf7b1e6a7c..67eb83a3b1d0 100644 --- a/sys/dev/ctau/if_ct.c +++ b/sys/dev/ctau/if_ct.c @@ -2187,7 +2187,7 @@ static int ng_ct_rcvdata (hook_p hook, item_p item) { drv_t *d = NG_NODE_PRIVATE (NG_HOOK_NODE(hook)); struct mbuf *m; - meta_p meta; + struct ng_tag_prio *ptag; #else static int ng_ct_rcvdata (hook_p hook, struct mbuf *m, meta_p meta) { @@ -2201,18 +2201,23 @@ static int ng_ct_rcvdata (hook_p hook, struct mbuf *m, meta_p meta) #if __FreeBSD_version >= 500000 NGI_GET_M (item, m); - NGI_GET_META (item, meta); NG_FREE_ITEM (item); if (! NG_HOOK_PRIVATE (hook) || ! d) { NG_FREE_M (m); - NG_FREE_META (meta); #else if (! hook->private || ! d) { NG_FREE_DATA (m,meta); #endif return ENETDOWN; } - q = (meta && meta->priority > 0) ? &d->hi_queue : &d->queue; + + /* Check for high priority data */ + if ((ptag = (struct ng_tag_prio *)m_tag_locate(m, NGM_GENERIC_COOKIE, + NG_TAG_PRIO, NULL)) != NULL && (ptag->priority > NG_PRIO_CUTOFF) ) + q = &d->hi_queue; + else + q = &d->queue; + s = splimp (); #if __FreeBSD_version >= 500000 IF_LOCK (q); @@ -2221,7 +2226,6 @@ static int ng_ct_rcvdata (hook_p hook, struct mbuf *m, meta_p meta) IF_UNLOCK (q); splx (s); NG_FREE_M (m); - NG_FREE_META (meta); return ENOBUFS; } _IF_ENQUEUE (q, m); diff --git a/sys/dev/cx/if_cx.c b/sys/dev/cx/if_cx.c index f7e57fa4b8d5..7354bc233082 100644 --- a/sys/dev/cx/if_cx.c +++ b/sys/dev/cx/if_cx.c @@ -2705,7 +2705,7 @@ static int ng_cx_rcvdata (hook_p hook, item_p item) { drv_t *d = NG_NODE_PRIVATE (NG_HOOK_NODE(hook)); struct mbuf *m; - meta_p meta; + struct ng_tag_prio *ptag; #else static int ng_cx_rcvdata (hook_p hook, struct mbuf *m, meta_p meta) { @@ -2716,18 +2716,23 @@ static int ng_cx_rcvdata (hook_p hook, struct mbuf *m, meta_p meta) #if __FreeBSD_version >= 500000 NGI_GET_M (item, m); - NGI_GET_META (item, meta); NG_FREE_ITEM (item); if (! NG_HOOK_PRIVATE (hook) || ! d) { NG_FREE_M (m); - NG_FREE_META (meta); #else if (! hook->private || ! d) { NG_FREE_DATA (m,meta); #endif return ENETDOWN; } - q = (meta && meta->priority > 0) ? &d->hi_queue : &d->lo_queue; + + /* Check for high priority data */ + if ((ptag = (struct ng_tag_prio *)m_tag_locate(m, NGM_GENERIC_COOKIE, + NG_TAG_PRIO, NULL)) != NULL && (ptag->priority > NG_PRIO_CUTOFF) ) + q = &d->hi_queue; + else + q = &d->lo_queue; + s = splhigh (); #if __FreeBSD_version >= 500000 IF_LOCK (q); @@ -2736,7 +2741,6 @@ static int ng_cx_rcvdata (hook_p hook, struct mbuf *m, meta_p meta) IF_UNLOCK (q); splx (s); NG_FREE_M (m); - NG_FREE_META (meta); return ENOBUFS; } _IF_ENQUEUE (q, m); diff --git a/sys/dev/sr/if_sr.c b/sys/dev/sr/if_sr.c index 45eaf5060050..5f60aef31eb4 100644 --- a/sys/dev/sr/if_sr.c +++ b/sys/dev/sr/if_sr.c @@ -2830,10 +2830,9 @@ ngsr_rcvdata(hook_p hook, item_p item) struct sr_softc * sc = NG_NODE_PRIVATE(NG_HOOK_NODE(hook)); struct ifqueue *xmitq_p; struct mbuf *m; - meta_p meta; + struct ng_tag_prio *ptag; NGI_GET_M(item, m); - NGI_GET_META(item, meta); NG_FREE_ITEM(item); /* * data doesn't come in from just anywhere (e.g control hook) @@ -2846,11 +2845,12 @@ ngsr_rcvdata(hook_p hook, item_p item) /* * Now queue the data for when it can be sent */ - if (meta && meta->priority > 0) { + if ((ptag = (struct ng_tag_prio *)m_tag_locate(m, NGM_GENERIC_COOKIE, + NG_TAG_PRIO, NULL)) != NULL && (ptag->priority > NG_PRIO_CUTOFF) ) xmitq_p = (&sc->xmitq_hipri); - } else { + else xmitq_p = (&sc->xmitq); - } + s = splimp(); IF_LOCK(xmitq_p); if (_IF_QFULL(xmitq_p)) { @@ -2872,7 +2872,6 @@ bad: * check if we need to free the mbuf, and then return the error */ NG_FREE_M(m); - NG_FREE_META(meta); return (error); } diff --git a/sys/dev/usb/udbp.c b/sys/dev/usb/udbp.c index 533a799f484d..1a126ec1a03c 100644 --- a/sys/dev/usb/udbp.c +++ b/sys/dev/usb/udbp.c @@ -729,19 +729,20 @@ ng_udbp_rcvdata(hook_p hook, item_p item) struct ifqueue *xmitq_p; int s; struct mbuf *m; - meta_p meta; + struct ng_tag_prio *ptag; NGI_GET_M(item, m); - NGI_GET_META(item, meta); NG_FREE_ITEM(item); + /* * Now queue the data for when it can be sent */ - if (meta && meta->priority > 0) { + if ((ptag = (struct ng_tag_prio *)m_tag_locate(m, NGM_GENERIC_COOKIE, + NG_TAG_PRIO, NULL)) != NULL && (ptag->priority > NG_PRIO_CUTOFF) ) xmitq_p = (&sc->xmitq_hipri); - } else { + else xmitq_p = (&sc->xmitq); - } + s = splusb(); IF_LOCK(xmitq_p); if (_IF_QFULL(xmitq_p)) { @@ -763,7 +764,6 @@ bad: /* * check if we need to free the mbuf, and then return the error */ NG_FREE_M(m); - NG_FREE_META(meta); return (error); } |
