summaryrefslogtreecommitdiffstats
path: root/freebsd/sys/sys/buf_ring.h
diff options
context:
space:
mode:
Diffstat (limited to 'freebsd/sys/sys/buf_ring.h')
-rw-r--r--freebsd/sys/sys/buf_ring.h10
1 files changed, 6 insertions, 4 deletions
diff --git a/freebsd/sys/sys/buf_ring.h b/freebsd/sys/sys/buf_ring.h
index 0b633238..e8c69341 100644
--- a/freebsd/sys/sys/buf_ring.h
+++ b/freebsd/sys/sys/buf_ring.h
@@ -34,10 +34,6 @@
#include <machine/cpu.h>
-#if defined(INVARIANTS) && !defined(DEBUG_BUFRING)
-#define DEBUG_BUFRING 1
-#endif
-
#ifdef DEBUG_BUFRING
#include <sys/lock.h>
#include <sys/mutex.h>
@@ -69,6 +65,12 @@ buf_ring_enqueue(struct buf_ring *br, void *buf)
uint32_t prod_head, prod_next, cons_tail;
#ifdef DEBUG_BUFRING
int i;
+
+ /*
+ * Note: It is possible to encounter an mbuf that was removed
+ * via drbr_peek(), and then re-added via drbr_putback() and
+ * trigger a spurious panic.
+ */
for (i = br->br_cons_head; i != br->br_prod_head;
i = ((i + 1) & br->br_cons_mask))
if(br->br_ring[i] == buf)