summaryrefslogtreecommitdiffstats
path: root/sys/dev/netmap/netmap_mbq.h
diff options
context:
space:
mode:
authorluigi <luigi@FreeBSD.org>2014-06-09 15:24:45 +0000
committerluigi <luigi@FreeBSD.org>2014-06-09 15:24:45 +0000
commitebbf6b80b7c61883bee08d58e7291d274b4201a0 (patch)
treea448df913c38e0849c39af93fd624da3bf845225 /sys/dev/netmap/netmap_mbq.h
parent2472187c4f707df7b460212773ffae872c03d247 (diff)
downloadFreeBSD-src-ebbf6b80b7c61883bee08d58e7291d274b4201a0.zip
FreeBSD-src-ebbf6b80b7c61883bee08d58e7291d274b4201a0.tar.gz
sync netmap code with the version in HEAD:
- fix handling of tx mbufs in emulated netmap mode; - introduce mbq_lock() and mbq_unlock() - rate limit some error messages - many whitespace and comment fixes
Diffstat (limited to 'sys/dev/netmap/netmap_mbq.h')
-rw-r--r--sys/dev/netmap/netmap_mbq.h12
1 files changed, 11 insertions, 1 deletions
diff --git a/sys/dev/netmap/netmap_mbq.h b/sys/dev/netmap/netmap_mbq.h
index d273d8a..a011c4c 100644
--- a/sys/dev/netmap/netmap_mbq.h
+++ b/sys/dev/netmap/netmap_mbq.h
@@ -62,7 +62,17 @@ void mbq_enqueue(struct mbq *q, struct mbuf *m);
struct mbuf *mbq_dequeue(struct mbq *q);
void mbq_purge(struct mbq *q);
-/* XXX missing mbq_lock() and mbq_unlock */
+static inline void
+mbq_lock(struct mbq *q)
+{
+ mtx_lock_spin(&q->lock);
+}
+
+static inline void
+mbq_unlock(struct mbq *q)
+{
+ mtx_unlock_spin(&q->lock);
+}
void mbq_safe_init(struct mbq *q);
void mbq_safe_destroy(struct mbq *q);
OpenPOWER on IntegriCloud