Code Review
/
vpp.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
review
|
tree
raw
|
inline
| side by side
avf: add avf flow framework
[vpp.git]
/
src
/
vlib
/
buffer.h
diff --git
a/src/vlib/buffer.h
b/src/vlib/buffer.h
index
cfe7d64
..
297240d
100644
(file)
--- a/
src/vlib/buffer.h
+++ b/
src/vlib/buffer.h
@@
-155,8
+155,8
@@
typedef union
/** part of buffer metadata which is initialized on alloc ends here. */
STRUCT_MARK (template_end);
/** part of buffer metadata which is initialized on alloc ends here. */
STRUCT_MARK (template_end);
- /** start of 2nd
cache line
*/
- CLIB_
CACHE_LINE_ALIGN_MARK (cacheline1
);
+ /** start of 2nd
half (2nd cacheline on systems where cacheline size is 64)
*/
+ CLIB_
ALIGN_MARK (second_half, 64
);
/** Specifies trace buffer handle if VLIB_PACKET_IS_TRACED flag is
* set. */
/** Specifies trace buffer handle if VLIB_PACKET_IS_TRACED flag is
* set. */
@@
-169,8
+169,8
@@
typedef union
/**< More opaque data, see ../vnet/vnet/buffer.h */
u32 opaque2[14];
/**< More opaque data, see ../vnet/vnet/buffer.h */
u32 opaque2[14];
- /** start of
third cache line
*/
- CLIB_
CACHE_LINE_ALIGN_MARK (cacheline2
);
+ /** start of
buffer headroom
*/
+ CLIB_
ALIGN_MARK (headroom, 64
);
/** Space for inserting data before buffer start. Packet rewrite string
* will be rewritten backwards and may extend back before
/** Space for inserting data before buffer start. Packet rewrite string
* will be rewritten backwards and may extend back before
@@
-178,7
+178,7
@@
typedef union
u8 pre_data[VLIB_BUFFER_PRE_DATA_SIZE];
/** Packet data */
u8 pre_data[VLIB_BUFFER_PRE_DATA_SIZE];
/** Packet data */
- u8 data[
0
];
+ u8 data[];
};
#ifdef CLIB_HAVE_VEC128
u8x16 as_u8x16[4];
};
#ifdef CLIB_HAVE_VEC128
u8x16 as_u8x16[4];
@@
-191,6
+191,10
@@
typedef union
#endif
} vlib_buffer_t;
#endif
} vlib_buffer_t;
+STATIC_ASSERT_SIZEOF (vlib_buffer_t, 128 + VLIB_BUFFER_PRE_DATA_SIZE);
+STATIC_ASSERT (VLIB_BUFFER_PRE_DATA_SIZE % CLIB_CACHE_LINE_BYTES == 0,
+ "VLIB_BUFFER_PRE_DATA_SIZE must be divisible by cache line size");
+
#define VLIB_BUFFER_HDR_SIZE (sizeof(vlib_buffer_t) - VLIB_BUFFER_PRE_DATA_SIZE)
/** \brief Prefetch buffer metadata.
#define VLIB_BUFFER_HDR_SIZE (sizeof(vlib_buffer_t) - VLIB_BUFFER_PRE_DATA_SIZE)
/** \brief Prefetch buffer metadata.
@@
-465,6
+469,7
@@
typedef struct
u32 buffers_per_numa;
u16 ext_hdr_size;
u32 default_data_size;
u32 buffers_per_numa;
u16 ext_hdr_size;
u32 default_data_size;
+ clib_mem_page_sz_t log2_page_size;
/* logging */
vlib_log_class_t log_default;
/* logging */
vlib_log_class_t log_default;