dispatch-trace: move dispatch trace pcap code to plugin
[vpp.git] / src / vnet / buffer.h
index fb734d5..37db413 100644 (file)
@@ -520,12 +520,24 @@ STATIC_ASSERT (sizeof (vnet_buffer_opaque2_t) <=
 
 format_function_t format_vnet_buffer;
 format_function_t format_vnet_buffer_offload;
+format_function_t format_vnet_buffer_flags;
+format_function_t format_vnet_buffer_opaque;
+format_function_t format_vnet_buffer_opaque2;
 
 static_always_inline void
 vnet_buffer_offload_flags_set (vlib_buffer_t *b, u32 oflags)
 {
-  vnet_buffer2 (b)->oflags |= oflags;
-  b->flags |= VNET_BUFFER_F_OFFLOAD;
+  if (b->flags & VNET_BUFFER_F_OFFLOAD)
+    {
+      /* add a flag to existing offload */
+      vnet_buffer2 (b)->oflags |= oflags;
+    }
+  else
+    {
+      /* no offload yet: reset offload flags to new value */
+      vnet_buffer2 (b)->oflags = oflags;
+      b->flags |= VNET_BUFFER_F_OFFLOAD;
+    }
 }
 
 static_always_inline void