summaryrefslogtreecommitdiff
path: root/ring.h
diff options
context:
space:
mode:
Diffstat (limited to 'ring.h')
-rw-r--r--ring.h7
1 files changed, 7 insertions, 0 deletions
diff --git a/ring.h b/ring.h
index 5e47d37..f618a35 100644
--- a/ring.h
+++ b/ring.h
@@ -82,6 +82,13 @@ static inline unsigned int ring_frame_size(struct ring *ring)
return ring->layout.tp_frame_size;
}
+static inline void ring_verify_layout(struct ring *ring)
+{
+ bug_on(ring->layout.tp_block_size < ring->layout.tp_frame_size);
+ bug_on((ring->layout.tp_block_size % ring->layout.tp_frame_size) != 0);
+ bug_on((ring->layout.tp_block_size % getpagesize()) != 0);
+}
+
static inline void tpacket_hdr_clone(struct tpacket2_hdr *thdrd,
struct tpacket2_hdr *thdrs)
{