summaryrefslogtreecommitdiffstats
path: root/src/vnet/ip/ip6_neighbor.c
diff options
context:
space:
mode:
authorDamjan Marion <damarion@cisco.com>2017-07-13 18:53:27 +0200
committerDave Barach <openvpp@barachs.net>2017-07-14 15:39:24 +0000
commit072401e8096c648b91f958bd911f64ce24fecff9 (patch)
tree5ef774bbcf5e9c072b8795d39115b012015e05f1 /src/vnet/ip/ip6_neighbor.c
parent0f09b77778644577545235156a2ea2798ec9ee6c (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/ip/ip6_neighbor.c')
-rw-r--r--src/vnet/ip/ip6_neighbor.c19
1 files changed, 8 insertions, 11 deletions
diff --git a/src/vnet/ip/ip6_neighbor.c b/src/vnet/ip/ip6_neighbor.c
index b8f6f9b10e7..68a8cbbc8d0 100644
--- a/src/vnet/ip/ip6_neighbor.c
+++ b/src/vnet/ip/ip6_neighbor.c
@@ -1479,9 +1479,8 @@ icmp6_router_solicitation (vlib_main_t * vm,
sizeof (icmp6_router_advertisement_header_t);
vlib_buffer_add_data (vm,
- p0->free_list_index,
- bi0,
- (void *) &rh,
+ vlib_buffer_get_free_list_index
+ (p0), bi0, (void *) &rh,
sizeof
(icmp6_router_advertisement_header_t));
@@ -1499,9 +1498,8 @@ icmp6_router_solicitation (vlib_main_t * vm,
eth_if0->address, 6);
vlib_buffer_add_data (vm,
- p0->free_list_index,
- bi0,
- (void *) &h,
+ vlib_buffer_get_free_list_index
+ (p0), bi0, (void *) &h,
sizeof
(icmp6_neighbor_discovery_ethernet_link_layer_address_option_t));
@@ -1525,9 +1523,8 @@ icmp6_router_solicitation (vlib_main_t * vm,
sizeof (icmp6_neighbor_discovery_mtu_option_t);
vlib_buffer_add_data (vm,
- p0->free_list_index,
- bi0,
- (void *) &h,
+ vlib_buffer_get_free_list_index
+ (p0), bi0, (void *) &h,
sizeof
(icmp6_neighbor_discovery_mtu_option_t));
}
@@ -1579,7 +1576,7 @@ icmp6_router_solicitation (vlib_main_t * vm,
payload_length += sizeof( icmp6_neighbor_discovery_prefix_information_option_t);
vlib_buffer_add_data (vm,
- p0->free_list_index,
+ vlib_buffer_get_free_list_index (p0),
bi0,
(void *)&h, sizeof(icmp6_neighbor_discovery_prefix_information_option_t));
@@ -2326,7 +2323,7 @@ ip6_neighbor_send_mldpv2_report (u32 sw_if_index)
num_addr_records++;
vlib_buffer_add_data
- (vm, b0->free_list_index, bo0,
+ (vm, vlib_buffer_get_free_list_index (b0), bo0,
(void *)&rr, sizeof(icmp6_multicast_address_record_t));
payload_length += sizeof( icmp6_multicast_address_record_t);