summaryrefslogtreecommitdiffstats
path: root/src/plugins
diff options
context:
space:
mode:
authorDamjan Marion <damarion@cisco.com>2019-01-20 00:11:22 +0100
committerFlorin Coras <florin.coras@gmail.com>2019-01-20 19:24:46 +0000
commit6434430fd593840e463fff0acb8f6b1676fa7bba (patch)
treee4b533efa71fef52b5b30920b5915777f2222b35 /src/plugins
parentd50e3477635e6cc2592cbf30d4fdcee842053624 (diff)
buffers: don't init metadata, as it is already initialized
Change-Id: Ia083050389853c25b069f0f8286d50d3f4aef527 Signed-off-by: Damjan Marion <damarion@cisco.com>
Diffstat (limited to 'src/plugins')
-rw-r--r--src/plugins/dpdk/buffer.c1
-rw-r--r--src/plugins/dpdk/device/init.c5
-rw-r--r--src/plugins/flowprobe/node.c4
-rw-r--r--src/plugins/igmp/igmp_pkt.c3
-rw-r--r--src/plugins/nat/nat_ipfix_logging.c36
-rw-r--r--src/plugins/nsim/nsim_input.c3
6 files changed, 1 insertions, 51 deletions
diff --git a/src/plugins/dpdk/buffer.c b/src/plugins/dpdk/buffer.c
index 37966ba9759..626bea2e345 100644
--- a/src/plugins/dpdk/buffer.c
+++ b/src/plugins/dpdk/buffer.c
@@ -210,7 +210,6 @@ CLIB_MULTIARCH_FN (dpdk_buffer_fill_free_list) (vlib_main_t * vm,
return 0;
clib_memset (&bt, 0, sizeof (vlib_buffer_t));
- vlib_buffer_init_for_free_list (&bt, fl);
bt.buffer_pool_index = privp->buffer_pool_index;
_vec_len (d->mbuf_alloc_list) = n_alloc;
diff --git a/src/plugins/dpdk/device/init.c b/src/plugins/dpdk/device/init.c
index df1a823f6da..93f020595a9 100644
--- a/src/plugins/dpdk/device/init.c
+++ b/src/plugins/dpdk/device/init.c
@@ -273,11 +273,8 @@ dpdk_lib_init (dpdk_main_t * dm)
CLIB_CACHE_LINE_BYTES);
for (i = 0; i < tm->n_vlib_mains; i++)
{
- vlib_buffer_free_list_t *fl;
dpdk_per_thread_data_t *ptd = vec_elt_at_index (dm->per_thread_data, i);
- fl = vlib_buffer_get_free_list (vm,
- VLIB_BUFFER_DEFAULT_FREE_LIST_INDEX);
- vlib_buffer_init_for_free_list (&ptd->buffer_template, fl);
+ clib_memset (&ptd->buffer_template, 0, sizeof (vlib_buffer_t));
ptd->buffer_template.flags = dm->buffer_flags_template;
vnet_buffer (&ptd->buffer_template)->sw_if_index[VLIB_TX] = (u32) ~ 0;
}
diff --git a/src/plugins/flowprobe/node.c b/src/plugins/flowprobe/node.c
index 2cd754b67bb..8dfc47cace9 100644
--- a/src/plugins/flowprobe/node.c
+++ b/src/plugins/flowprobe/node.c
@@ -631,7 +631,6 @@ flowprobe_get_buffer (vlib_main_t * vm, flowprobe_variant_t which)
flow_report_main_t *frm = &flow_report_main;
vlib_buffer_t *b0;
u32 bi0;
- vlib_buffer_free_list_t *fl;
u32 my_cpu_number = vm->thread_index;
/* Find or allocate a buffer */
@@ -650,9 +649,6 @@ flowprobe_get_buffer (vlib_main_t * vm, flowprobe_variant_t which)
/* Initialize the buffer */
b0 = fm->context[which].buffers_per_worker[my_cpu_number] =
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);
b0->current_data = 0;
diff --git a/src/plugins/igmp/igmp_pkt.c b/src/plugins/igmp/igmp_pkt.c
index 81b8ecb18bc..e93dd9c2667 100644
--- a/src/plugins/igmp/igmp_pkt.c
+++ b/src/plugins/igmp/igmp_pkt.c
@@ -27,7 +27,6 @@ vlib_buffer_append (vlib_buffer_t * b, uword l)
static vlib_buffer_t *
igmp_pkt_get_buffer (igmp_pkt_build_t * bk)
{
- vlib_buffer_free_list_t *fl;
vlib_main_t *vm;
vlib_buffer_t *b;
u32 bi;
@@ -38,8 +37,6 @@ igmp_pkt_get_buffer (igmp_pkt_build_t * bk)
return (NULL);
b = vlib_get_buffer (vm, bi);
- 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);
b->flags |= VNET_BUFFER_F_LOCALLY_ORIGINATED;
diff --git a/src/plugins/nat/nat_ipfix_logging.c b/src/plugins/nat/nat_ipfix_logging.c
index 042239fee85..8bee8e444dc 100644
--- a/src/plugins/nat/nat_ipfix_logging.c
+++ b/src/plugins/nat/nat_ipfix_logging.c
@@ -620,7 +620,6 @@ snat_ipfix_logging_nat44_ses (u8 nat_event, u32 src_ip, u32 nat_src_ip,
u32 offset;
vlib_main_t *vm = frm->vlib_main;
u64 now;
- vlib_buffer_free_list_t *fl;
u8 proto = ~0;
if (!silm->enabled)
@@ -645,9 +644,6 @@ snat_ipfix_logging_nat44_ses (u8 nat_event, u32 src_ip, u32 nat_src_ip,
}
b0 = silm->nat44_session_buffer = 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;
}
@@ -723,7 +719,6 @@ snat_ipfix_logging_addr_exhausted (u32 pool_id, int do_flush)
u32 offset;
vlib_main_t *vm = frm->vlib_main;
u64 now;
- vlib_buffer_free_list_t *fl;
u8 nat_event = NAT_ADDRESSES_EXHAUTED;
if (!silm->enabled)
@@ -746,9 +741,6 @@ snat_ipfix_logging_addr_exhausted (u32 pool_id, int do_flush)
}
b0 = silm->addr_exhausted_buffer = 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;
}
@@ -809,7 +801,6 @@ snat_ipfix_logging_max_entries_per_usr (u32 limit, u32 src_ip, int do_flush)
u32 offset;
vlib_main_t *vm = frm->vlib_main;
u64 now;
- vlib_buffer_free_list_t *fl;
u8 nat_event = QUOTA_EXCEEDED;
u32 quota_event = MAX_ENTRIES_PER_USER;
@@ -833,9 +824,6 @@ snat_ipfix_logging_max_entries_per_usr (u32 limit, u32 src_ip, int do_flush)
}
b0 = silm->max_entries_per_user_buffer = 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;
}
@@ -902,7 +890,6 @@ nat_ipfix_logging_max_ses (u32 limit, int do_flush)
u32 offset;
vlib_main_t *vm = frm->vlib_main;
u64 now;
- vlib_buffer_free_list_t *fl;
u8 nat_event = QUOTA_EXCEEDED;
u32 quota_event = MAX_SESSION_ENTRIES;
@@ -926,9 +913,6 @@ nat_ipfix_logging_max_ses (u32 limit, int do_flush)
}
b0 = silm->max_sessions_buffer = 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;
}
@@ -992,7 +976,6 @@ nat_ipfix_logging_max_bib (u32 limit, int do_flush)
u32 offset;
vlib_main_t *vm = frm->vlib_main;
u64 now;
- vlib_buffer_free_list_t *fl;
u8 nat_event = QUOTA_EXCEEDED;
u32 quota_event = MAX_BIB_ENTRIES;
@@ -1016,9 +999,6 @@ nat_ipfix_logging_max_bib (u32 limit, int do_flush)
}
b0 = silm->max_bibs_buffer = 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;
}
@@ -1082,7 +1062,6 @@ nat_ipfix_logging_max_frag_ip4 (u32 limit, u32 src, int do_flush)
u32 offset;
vlib_main_t *vm = frm->vlib_main;
u64 now;
- vlib_buffer_free_list_t *fl;
u8 nat_event = QUOTA_EXCEEDED;
u32 quota_event = MAX_FRAGMENTS_PENDING_REASSEMBLY;
@@ -1106,9 +1085,6 @@ nat_ipfix_logging_max_frag_ip4 (u32 limit, u32 src, int do_flush)
}
b0 = silm->max_frags_ip4_buffer = 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;
}
@@ -1175,7 +1151,6 @@ nat_ipfix_logging_max_frag_ip6 (u32 limit, ip6_address_t * src, int do_flush)
u32 offset;
vlib_main_t *vm = frm->vlib_main;
u64 now;
- vlib_buffer_free_list_t *fl;
u8 nat_event = QUOTA_EXCEEDED;
u32 quota_event = MAX_FRAGMENTS_PENDING_REASSEMBLY;
@@ -1199,9 +1174,6 @@ nat_ipfix_logging_max_frag_ip6 (u32 limit, ip6_address_t * src, int do_flush)
}
b0 = silm->max_frags_ip6_buffer = 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;
}
@@ -1270,7 +1242,6 @@ nat_ipfix_logging_nat64_bibe (u8 nat_event, ip6_address_t * src_ip,
u32 offset;
vlib_main_t *vm = frm->vlib_main;
u64 now;
- vlib_buffer_free_list_t *fl;
if (!silm->enabled)
return;
@@ -1292,9 +1263,6 @@ nat_ipfix_logging_nat64_bibe (u8 nat_event, ip6_address_t * src_ip,
}
b0 = silm->nat64_bib_buffer = 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;
}
@@ -1374,7 +1342,6 @@ nat_ipfix_logging_nat64_ses (u8 nat_event, ip6_address_t * src_ip,
u32 offset;
vlib_main_t *vm = frm->vlib_main;
u64 now;
- vlib_buffer_free_list_t *fl;
if (!silm->enabled)
return;
@@ -1396,9 +1363,6 @@ nat_ipfix_logging_nat64_ses (u8 nat_event, ip6_address_t * src_ip,
}
b0 = silm->nat64_ses_buffer = 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;
}
diff --git a/src/plugins/nsim/nsim_input.c b/src/plugins/nsim/nsim_input.c
index 2e328a58bf3..44c9f535f92 100644
--- a/src/plugins/nsim/nsim_input.c
+++ b/src/plugins/nsim/nsim_input.c
@@ -81,7 +81,6 @@ nsim_input_inline (vlib_main_t * vm, vlib_node_runtime_t * node,
uword n_rx_packets = 0;
vlib_buffer_t *b0;
u32 bi0, next0;
- vlib_buffer_free_list_t *fl;
u32 *to_next;
u32 next_index;
u32 n_left_to_next;
@@ -100,7 +99,6 @@ nsim_input_inline (vlib_main_t * vm, vlib_node_runtime_t * node,
* We use per-thread buffer caches, so we need the freelist to
* initialize them...
*/
- fl = vlib_buffer_get_free_list (vm, VLIB_BUFFER_DEFAULT_FREE_LIST_INDEX);
next_index = node->cached_next_index;
while (wp->cursize)
@@ -149,7 +147,6 @@ nsim_input_inline (vlib_main_t * vm, vlib_node_runtime_t * node,
b0 = vlib_get_buffer (vm, bi0);
/* Initialize the buffer */
- vlib_buffer_init_for_free_list (b0, fl);
b0->current_data = 0;
b0->current_length = ep->current_length;