summaryrefslogtreecommitdiffstats
path: root/src/vnet/buffer.h
diff options
context:
space:
mode:
authorDave Barach <dave@barachs.net>2017-10-18 18:48:11 -0400
committerFlorin Coras <florin.coras@gmail.com>2017-10-19 04:35:54 +0000
commit7bee773e71b81a1e13a656030b0f7edae99c5e92 (patch)
tree86f615367c1b3bf29ecd2957c7dbea2d9e6ed0a6 /src/vnet/buffer.h
parent9c4b5b28b1c1df0c100b377a2f5bfc07bd9a0b2e (diff)
VPP-1024: rewrite buffer trajectory tracer
Use a proper u16 * vector to capture node indices, since vpp w/ plugins now exceeds 255 graph nodes Change-Id: Ic48cad676fa3a6116413ddf08c083dd9660783f1 Signed-off-by: Dave Barach <dave@barachs.net>
Diffstat (limited to 'src/vnet/buffer.h')
-rw-r--r--src/vnet/buffer.h17
1 files changed, 17 insertions, 0 deletions
diff --git a/src/vnet/buffer.h b/src/vnet/buffer.h
index 7567b875248..045328816cd 100644
--- a/src/vnet/buffer.h
+++ b/src/vnet/buffer.h
@@ -317,9 +317,26 @@ typedef struct
{
union
{
+#if VLIB_BUFFER_TRACE_TRAJECTORY > 0
+ /* buffer trajectory tracing */
+ struct
+ {
+ u16 *trajectory_trace;
+ };
+#endif
+ u32 unused[12];
};
} vnet_buffer_opaque2_t;
+#define vnet_buffer2(b) ((vnet_buffer_opaque2_t *) (b)->opaque2)
+
+/*
+ * The opaque2 field of the vlib_buffer_t is intepreted as a
+ * vnet_buffer_opaque2_t. Hence it should be big enough to accommodate one.
+ */
+STATIC_ASSERT (sizeof (vnet_buffer_opaque2_t) <=
+ STRUCT_SIZE_OF (vlib_buffer_t, opaque2),
+ "VNET buffer opaque2 meta-data too large for vlib_buffer");
#endif /* included_vnet_buffer_h */