buffers: don't init metadata, as it is already initialized
Change-Id: Ia083050389853c25b069f0f8286d50d3f4aef527
Signed-off-by: Damjan Marion <damarion@cisco.com>
diff --git a/src/vnet/bfd/bfd_main.c b/src/vnet/bfd/bfd_main.c
index ea58413..0cc7d72 100644
--- a/src/vnet/bfd/bfd_main.c
+++ b/src/vnet/bfd/bfd_main.c
@@ -908,7 +908,6 @@
}
vlib_buffer_t *b = vlib_get_buffer (vm, bi);
ASSERT (b->current_data == 0);
- clib_memset (vnet_buffer (b), 0, sizeof (*vnet_buffer (b)));
VLIB_BUFFER_TRACE_TRAJECTORY_INIT (b);
bfd_echo_pkt_t *pkt = vlib_buffer_get_current (b);
clib_memset (pkt, 0, sizeof (*pkt));
@@ -982,7 +981,6 @@
}
vlib_buffer_t *b = vlib_get_buffer (vm, bi);
ASSERT (b->current_data == 0);
- clib_memset (vnet_buffer (b), 0, sizeof (*vnet_buffer (b)));
VLIB_BUFFER_TRACE_TRAJECTORY_INIT (b);
bfd_init_control_frame (bm, bs, b);
switch (bs->poll_state)
diff --git a/src/vnet/bfd/bfd_udp.c b/src/vnet/bfd/bfd_udp.c
index d35c6de..041e584 100644
--- a/src/vnet/bfd/bfd_udp.c
+++ b/src/vnet/bfd/bfd_udp.c
@@ -1239,7 +1239,6 @@
{
b0->current_data = 0;
b0->current_length = 0;
- clib_memset (vnet_buffer (b0), 0, sizeof (*vnet_buffer (b0)));
bfd_init_final_control_frame (vm, b0, bfd_udp_main.bfd_main, bs,
0);
if (is_ipv6)
diff --git a/src/vnet/dhcp/dhcp6_proxy_node.c b/src/vnet/dhcp/dhcp6_proxy_node.c
index ea06c18..92e011b 100644
--- a/src/vnet/dhcp/dhcp6_proxy_node.c
+++ b/src/vnet/dhcp/dhcp6_proxy_node.c
@@ -179,7 +179,6 @@
dhcpv6_client_mac_t *cmac; // client mac
ethernet_header_t *e_h0;
u8 client_src_mac[6];
- vlib_buffer_free_list_t *fl;
dhcp_vss_t *vss;
u8 is_solicit = 0;
@@ -315,11 +314,9 @@
copy_ip6_address (&r1->link_addr, ia0);
link_address_set:
- fl = vlib_buffer_get_free_list
- (vm, VLIB_BUFFER_DEFAULT_FREE_LIST_INDEX);
if ((b0->current_length + sizeof (*id1) + sizeof (*vss1) +
- sizeof (*cmac)) > fl->n_data_bytes)
+ sizeof (*cmac)) > VLIB_BUFFER_DATA_SIZE)
{
error0 = DHCPV6_PROXY_ERROR_PKT_TOO_BIG;
next0 = DHCPV6_PROXY_TO_SERVER_INPUT_NEXT_DROP;
diff --git a/src/vnet/ip/ip6_neighbor.c b/src/vnet/ip/ip6_neighbor.c
index d501832..b4b6888 100755
--- a/src/vnet/ip/ip6_neighbor.c
+++ b/src/vnet/ip/ip6_neighbor.c
@@ -2307,7 +2307,6 @@
{
u32 bi0;
vlib_buffer_t *p0;
- vlib_buffer_free_list_t *fl;
icmp6_router_solicitation_header_t *rh;
u16 payload_length;
int bogus_length;
@@ -2322,8 +2321,6 @@
}
p0 = vlib_get_buffer (vm, bi0);
- fl = vlib_buffer_get_free_list (vm, VLIB_BUFFER_DEFAULT_FREE_LIST_INDEX);
- vlib_buffer_init_for_free_list (p0, fl);
VLIB_BUFFER_TRACE_TRAJECTORY_INIT (p0);
p0->flags |= VNET_BUFFER_F_LOCALLY_ORIGINATED;
diff --git a/src/vnet/ip/ip_frag.c b/src/vnet/ip/ip_frag.c
index de09987..de29776 100644
--- a/src/vnet/ip/ip_frag.c
+++ b/src/vnet/ip/ip_frag.c
@@ -78,9 +78,6 @@
return 0;
vlib_buffer_t *b = vlib_get_buffer (vm, *bi);
- vlib_buffer_free_list_t *fl =
- vlib_buffer_get_free_list (vm, VLIB_BUFFER_DEFAULT_FREE_LIST_INDEX);
- vlib_buffer_init_for_free_list (b, fl);
VLIB_BUFFER_TRACE_TRAJECTORY_INIT (b);
vlib_buffer_copy_trace_flag (vm, org_b, *bi);
diff --git a/src/vnet/ip/ping.c b/src/vnet/ip/ping.c
index 92a92e5..890285f 100755
--- a/src/vnet/ip/ping.c
+++ b/src/vnet/ip/ping.c
@@ -745,15 +745,12 @@
u32 bi0 = 0;
int n_buf0 = 0;
vlib_buffer_t *b0;
- vlib_buffer_free_list_t *fl;
n_buf0 = vlib_buffer_alloc (vm, &bi0, 1);
if (n_buf0 < 1)
ERROR_OUT (SEND_PING_ALLOC_FAIL);
b0 = vlib_get_buffer (vm, bi0);
- fl = vlib_buffer_get_free_list (vm, VLIB_BUFFER_DEFAULT_FREE_LIST_INDEX);
- vlib_buffer_init_for_free_list (b0, fl);
VLIB_BUFFER_TRACE_TRAJECTORY_INIT (b0);
/*
diff --git a/src/vnet/ipfix-export/flow_report.c b/src/vnet/ipfix-export/flow_report.c
index c9370a7..da91a7c 100644
--- a/src/vnet/ipfix-export/flow_report.c
+++ b/src/vnet/ipfix-export/flow_report.c
@@ -86,7 +86,6 @@
udp_header_t *udp;
vlib_main_t *vm = frm->vlib_main;
flow_report_stream_t *stream;
- vlib_buffer_free_list_t *fl;
ASSERT (buffer_indexp);
@@ -120,11 +119,9 @@
b0 = vlib_get_buffer (vm, bi0);
/* Initialize the buffer */
- fl = vlib_buffer_get_free_list (vm, VLIB_BUFFER_DEFAULT_FREE_LIST_INDEX);
- vlib_buffer_init_for_free_list (b0, fl);
VLIB_BUFFER_TRACE_TRAJECTORY_INIT (b0);
- ASSERT (vec_len (fr->rewrite) < VLIB_BUFFER_DEFAULT_FREE_LIST_BYTES);
+ ASSERT (vec_len (fr->rewrite) < VLIB_BUFFER_DATA_SIZE);
clib_memcpy_fast (b0->data, fr->rewrite, vec_len (fr->rewrite));
b0->current_data = 0;
diff --git a/src/vnet/ipfix-export/ipfix_doc.md b/src/vnet/ipfix-export/ipfix_doc.md
index 95db15c..5feea0e 100644
--- a/src/vnet/ipfix-export/ipfix_doc.md
+++ b/src/vnet/ipfix-export/ipfix_doc.md
@@ -284,7 +284,6 @@
vlib_buffer_t *b0 = 0;
u32 bi0 = ~0;
u32 offset;
- vlib_buffer_free_list_t *fl;
b0 = mlm->buffers_by_thread[thread_index];
@@ -300,9 +299,6 @@
}
b0 = vlib_get_buffer (vm, bi0);
- fl =
- vlib_buffer_get_free_list (vm, VLIB_BUFFER_DEFAULT_FREE_LIST_INDEX);
- vlib_buffer_init_for_free_list (b0, fl);
VLIB_BUFFER_TRACE_TRAJECTORY_INIT (b0);
offset = 0;
mlm->buffers_by_thread[thread_index] = b0;
diff --git a/src/vnet/syslog/syslog.c b/src/vnet/syslog/syslog.c
index 1cffe03..462c5de 100644
--- a/src/vnet/syslog/syslog.c
+++ b/src/vnet/syslog/syslog.c
@@ -163,7 +163,6 @@
u32 bi, msg_len, *to_next;
u8 *tmp;
vlib_buffer_t *b;
- vlib_buffer_free_list_t *fl;
vlib_frame_t *f;
int i;
@@ -171,9 +170,6 @@
return -1;
b = vlib_get_buffer (vm, bi);
- clib_memset (vnet_buffer (b), 0, sizeof (*vnet_buffer (b)));
- fl = vlib_buffer_get_free_list (vm, VLIB_BUFFER_DEFAULT_FREE_LIST_INDEX);
- vlib_buffer_init_for_free_list (b, fl);
VLIB_BUFFER_TRACE_TRAJECTORY_INIT (b);
/* one message per UDP datagram RFC5426 3.1. */