vlib: make runtime_data handling thread-local
[vpp.git] / src / vnet / buffer.h
index 3de01f2..795bbd9 100644 (file)
@@ -73,7 +73,6 @@
 #define foreach_buffer_opaque_union_subtype     \
 _(ethernet)                                     \
 _(ip)                                           \
-_(mcast)                                        \
 _(swt)                                          \
 _(l2)                                           \
 _(l2t)                                          \
@@ -84,7 +83,8 @@ _(policer)                                      \
 _(ipsec)                                       \
 _(map)                                         \
 _(map_t)                                       \
-_(ip_frag)
+_(ip_frag)                                     \
+_(tcp)
 
 /*
  * vnet stack buffer opaque array overlay structure.
@@ -131,6 +131,9 @@ typedef struct
 
          /* Rewrite length */
          u32 save_rewrite_length;
+
+         /* MFIB RPF ID */
+         u32 rpf_id;
        };
 
        /* ICMP */
@@ -159,15 +162,6 @@ typedef struct
       u8 first;
     } mpls;
 
-    /* Multicast replication */
-    struct
-    {
-      u32 pad[3];
-      u32 mcast_group_index;
-      u32 mcast_current_index;
-      u32 original_free_list_index;
-    } mcast;
-
     /* ip4-in-ip6 softwire termination, only valid there */
     struct
     {
@@ -179,9 +173,10 @@ typedef struct
     struct
     {
       u32 feature_bitmap;
-      u16 bd_index;            // bridge-domain index
-      u8 l2_len;               // ethernet header length
-      u8 shg;                  // split-horizon group
+      u16 bd_index;            /* bridge-domain index */
+      u8 l2_len;               /* ethernet header length */
+      u8 shg;                  /* split-horizon group */
+      u16 l2fib_sn;            /* l2fib bd/int seq_num */
     } l2;
 
     /* l2tpv3 softwire encap, only valid there */
@@ -200,9 +195,13 @@ typedef struct
     /* L2 classify */
     struct
     {
-      u64 pad;
-      u32 table_index;
-      u32 opaque_index;
+      u64 pad;                 /* paddind for l2 */
+      u16 pad1;
+      union
+      {
+       u32 table_index;
+       u32 opaque_index;
+      };
       u64 hash;
     } l2_classify;
 
@@ -284,6 +283,9 @@ typedef struct
       u32 seq_number;
       u32 seq_end;
       u32 ack_number;
+      u16 hdr_offset;          /**< offset relative to ip hdr */
+      u16 data_offset;         /**< offset relative to ip hdr */
+      u16 data_len;            /**< data len */
       u8 flags;
     } tcp;
 
@@ -298,6 +300,11 @@ typedef struct
 STATIC_ASSERT (sizeof (vnet_buffer_opaque_t) <= STRUCT_SIZE_OF (vlib_buffer_t,
                                                                opaque),
               "VNET buffer meta-data too large for vlib_buffer");
+STATIC_ASSERT (STRUCT_OFFSET_OF
+              (vnet_buffer_opaque_t,
+               l2_classify.table_index) >=
+              STRUCT_SIZE_OF (vnet_buffer_opaque_t, l2),
+              "l2_classify padding smaller than l2");
 
 #define vnet_buffer(b) ((vnet_buffer_opaque_t *) (b)->opaque)