summaryrefslogtreecommitdiffstats
path: root/sys/dev/cp
diff options
context:
space:
mode:
Diffstat (limited to 'sys/dev/cp')
-rw-r--r--sys/dev/cp/if_cp.c14
1 files changed, 9 insertions, 5 deletions
diff --git a/sys/dev/cp/if_cp.c b/sys/dev/cp/if_cp.c
index dfb4a7e..728df80 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);
OpenPOWER on IntegriCloud