summaryrefslogtreecommitdiffstats
path: root/sys/netgraph/netgraph.h
diff options
context:
space:
mode:
authorglebius <glebius@FreeBSD.org>2005-11-02 14:27:24 +0000
committerglebius <glebius@FreeBSD.org>2005-11-02 14:27:24 +0000
commite33b2b4ba90dad37b7ab8df723d588907725f515 (patch)
tree4c9cac2606b3791b8697e594e1df9fe0407b70bf /sys/netgraph/netgraph.h
parent3e97a4d0bdd98b439908ccfdaaf8f082e1964318 (diff)
downloadFreeBSD-src-e33b2b4ba90dad37b7ab8df723d588907725f515.zip
FreeBSD-src-e33b2b4ba90dad37b7ab8df723d588907725f515.tar.gz
Rework the ng_item queueing on nodes:
- Introduce a new flags NGQF_QREADER and NGQF_QWRITER, which tell how the item should be actually applied, overriding NGQF_READER/NGQF_WRITER flags. - Do not differ between pending reader or writer. Use only one flag that is raised, when there are pending items. - Schedule netgraph ISR in ng_queue_rw(), so that callers do not need to do this job. - Fix several comments. Submitted by: julian
Diffstat (limited to 'sys/netgraph/netgraph.h')
-rw-r--r--sys/netgraph/netgraph.h15
1 files changed, 12 insertions, 3 deletions
diff --git a/sys/netgraph/netgraph.h b/sys/netgraph/netgraph.h
index d0dc8f5..bf026cf 100644
--- a/sys/netgraph/netgraph.h
+++ b/sys/netgraph/netgraph.h
@@ -618,9 +618,13 @@ struct ng_item {
#define NGQF_FN 0x02 /* the queue element is a function */
#define NGQF_UNDEF 0x03 /* UNDEFINED */
-#define NGQF_RW 0x04 /* MASK for queue entry read/write */
-#define NGQF_READER 0x04 /* queued as a reader */
-#define NGQF_WRITER 0x00 /* queued as a writer */
+#define NGQF_RW 0x04 /* MASK for wanted queue mode */
+#define NGQF_READER 0x04 /* wants to be a reader */
+#define NGQF_WRITER 0x00 /* wants to be a writer */
+
+#define NGQF_QMODE 0x08 /* MASK for how it was queued */
+#define NGQF_QREADER 0x08 /* was queued as a reader */
+#define NGQF_QWRITER 0x00 /* was queued as a writer */
/*
* Get the mbuf (etc) out of an item.
@@ -805,6 +809,11 @@ _ngi_hook(item_p item, char *file, int line)
_NGI_HOOK(i) = NULL; \
} while (0)
+#define NGI_SET_WRITER(i) ((i)->el_flags &= ~NGQF_QMODE)
+#define NGI_SET_READER(i) ((i)->el_flags |= NGQF_QREADER)
+
+#define NGI_QUEUED_READER(i) ((i)->el_flags & NGQF_QREADER)
+#define NGI_QUEUED_WRITER(i) (((i)->el_flags & NGQF_QMODE) == NGQF_QWRITER)
/**********************************************************************
* Data macros. Send, manipulate and free.
OpenPOWER on IntegriCloud