summaryrefslogtreecommitdiffstats
path: root/sys/dev/sr
diff options
context:
space:
mode:
authorjulian <julian@FreeBSD.org>2004-06-25 19:22:05 +0000
committerjulian <julian@FreeBSD.org>2004-06-25 19:22:05 +0000
commitdfb6d511956c2a209c86265e60dde6f108cf61b3 (patch)
treee6486f45de5c63b28a090942d8f046694d0329cb /sys/dev/sr
parentd754d951b906e8d0c99ea9917952cdfb8c5c9378 (diff)
downloadFreeBSD-src-dfb6d511956c2a209c86265e60dde6f108cf61b3.zip
FreeBSD-src-dfb6d511956c2a209c86265e60dde6f108cf61b3.tar.gz
Convert Netgraph to use mbuf tags to pass its meta information around.
Thanks to Sam for importing tags in a way that allowed this to be done. Submitted by: Gleb Smirnoff <glebius@cell.sick.ru> Also allow the sr and ar drivers to create netgraph versions of their modules. Document the change to the ksocket node.
Diffstat (limited to 'sys/dev/sr')
-rw-r--r--sys/dev/sr/if_sr.c11
1 files changed, 5 insertions, 6 deletions
diff --git a/sys/dev/sr/if_sr.c b/sys/dev/sr/if_sr.c
index 45eaf50..5f60aef 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);
}
OpenPOWER on IntegriCloud