summaryrefslogtreecommitdiffstats
path: root/sys/dev/ctau
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/ctau
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/ctau')
-rw-r--r--sys/dev/ctau/if_ct.c14
1 files changed, 9 insertions, 5 deletions
diff --git a/sys/dev/ctau/if_ct.c b/sys/dev/ctau/if_ct.c
index f4cf7b1..67eb83a 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);
OpenPOWER on IntegriCloud