diff options
author | Damjan Marion <damarion@cisco.com> | 2017-07-13 18:53:27 +0200 |
---|---|---|
committer | Dave Barach <openvpp@barachs.net> | 2017-07-14 15:39:24 +0000 |
commit | 072401e8096c648b91f958bd911f64ce24fecff9 (patch) | |
tree | 5ef774bbcf5e9c072b8795d39115b012015e05f1 /src/vnet/buffer.h | |
parent | 0f09b77778644577545235156a2ea2798ec9ee6c (diff) |
Introduce l{2,3,4}_hdr_offset fields in the buffer metadata
To save space in the first cacheline following is changed:
- total_length_not_including_first_buffer moved to the 2nd cacheline.
This field is used only when VLIB_BUFFER_TOTAL_LENGTH_VALID and
VLIB_BUFFER_NEXT_PRESENT are both set.
- free_list_index is now stored in 4bits inside flags, which
allows up to 16 free lists. In case we need more we can store index
in the 2nd cachelin
Change-Id: Ic8521350819391af470d31d3fa1013e67ecb7681
Signed-off-by: Damjan Marion <damarion@cisco.com>
Diffstat (limited to 'src/vnet/buffer.h')
-rw-r--r-- | src/vnet/buffer.h | 14 |
1 files changed, 3 insertions, 11 deletions
diff --git a/src/vnet/buffer.h b/src/vnet/buffer.h index 9aba34da930..8647db005f4 100644 --- a/src/vnet/buffer.h +++ b/src/vnet/buffer.h @@ -71,7 +71,6 @@ #define VNET_BUFFER_SPAN_CLONE (1 << LOG2_VNET_BUFFER_SPAN_CLONE) #define foreach_buffer_opaque_union_subtype \ -_(ethernet) \ _(ip) \ _(swt) \ _(l2) \ @@ -100,16 +99,12 @@ _(tcp) typedef struct { u32 sw_if_index[VLIB_N_RX_TX]; + i16 l2_hdr_offset; + i16 l3_hdr_offset; + i16 l4_hdr_offset; union { - /* Ethernet. */ - struct - { - /* Saved value of current header by ethernet-input. */ - i32 start_of_ethernet_header; - } ethernet; - /* IP4/6 buffer opaque. */ struct { @@ -143,9 +138,6 @@ typedef struct u8 code; u32 data; } icmp; - - /* IP header offset from vlib_buffer.data - saved by ip*_local nodes */ - i32 start_of_ip_header; }; } ip; |