aboutsummaryrefslogtreecommitdiffstats
path: root/src/plugins
diff options
context:
space:
mode:
Diffstat (limited to 'src/plugins')
-rw-r--r--src/plugins/af_xdp/device.c12
-rw-r--r--src/plugins/af_xdp/input.c18
-rw-r--r--src/plugins/avf/input.c7
-rw-r--r--src/plugins/dhcp/client.c1
-rw-r--r--src/plugins/dhcp/dhcp4_proxy_node.c1
-rw-r--r--src/plugins/dhcp/dhcp6_proxy_node.c1
-rw-r--r--src/plugins/dpdk/device/device.c9
-rw-r--r--src/plugins/dpdk/device/node.c6
-rw-r--r--src/plugins/flowprobe/node.c1
-rw-r--r--src/plugins/igmp/igmp_pkt.c1
-rw-r--r--src/plugins/marvell/pp2/input.c5
-rw-r--r--src/plugins/memif/node.c2
-rw-r--r--src/plugins/nat/lib/ipfix_logging.c7
-rw-r--r--src/plugins/nat/nat44-ei/nat44_ei_ha.c1
-rw-r--r--src/plugins/ping/ping.c1
-rw-r--r--src/plugins/vmxnet3/output.c1
-rw-r--r--src/plugins/vrrp/vrrp_packet.c3
17 files changed, 18 insertions, 59 deletions
diff --git a/src/plugins/af_xdp/device.c b/src/plugins/af_xdp/device.c
index fabf85adfa6..35ba617d6e3 100644
--- a/src/plugins/af_xdp/device.c
+++ b/src/plugins/af_xdp/device.c
@@ -208,6 +208,18 @@ af_xdp_create_queue (vlib_main_t * vm, af_xdp_create_if_args_t * args,
umem_config.comp_size = args->txq_size;
umem_config.frame_size =
sizeof (vlib_buffer_t) + vlib_buffer_get_default_data_size (vm);
+ /*
+ * Note about headroom: for some reasons, there seem to be a discrepency
+ * between 0-copy and copy mode:
+ * - 0-copy: XDP_PACKET_HEADROOM will be added to the user headroom
+ * - copy: nothing is added to the user headroom
+ * We privileged 0-copy and set headroom so that frame_headroom +
+ * XDP_PACKET_HEADROOM == sizeof(vlib_buffer_t), ie data will correctly
+ * point to vlib_buffer_t->data for 0-copy. In copy mode, we have to add
+ * XDP_PACKET_HEADROOM to desc offset during refill.
+ */
+ STATIC_ASSERT (sizeof (vlib_buffer_t) >= XDP_PACKET_HEADROOM, "wrong size");
+ umem_config.frame_headroom = sizeof (vlib_buffer_t) - XDP_PACKET_HEADROOM;
umem_config.flags = XDP_UMEM_UNALIGNED_CHUNK_FLAG;
if (xsk_umem__create
(umem, uword_to_pointer (vm->buffer_main->buffer_mem_start, void *),
diff --git a/src/plugins/af_xdp/input.c b/src/plugins/af_xdp/input.c
index 65eee75cb92..da422bdccaf 100644
--- a/src/plugins/af_xdp/input.c
+++ b/src/plugins/af_xdp/input.c
@@ -130,17 +130,11 @@ af_xdp_device_input_refill (vlib_main_t * vm,
/*
* Note about headroom: for some reasons, there seem to be a discrepency
- * between 0-copy and copy mode:
- * - 0-copy: XDP_PACKET_HEADROOM will be added to the user headroom
- * - copy: nothing is added to the user headroom
- * We privileged 0-copy and set headroom to 0. As XDP_PACKET_HEADROOM ==
- * sizeof(vlib_buffer_t), data will correctly point to vlib_buffer_t->data.
- * In copy mode, we have to add sizeof(vlib_buffer_t) to desc offset during
- * refill.
+ * between 0-copy and copy mode. See
+ * src/plugins/af_xdp/device.c:af_xdp_create_queue()
*/
- STATIC_ASSERT (sizeof (vlib_buffer_t) == XDP_PACKET_HEADROOM, "wrong size");
-#define bi2addr(bi) \
- (((bi) << CLIB_LOG2_CACHE_LINE_BYTES) + (copy ? sizeof(vlib_buffer_t) : 0))
+#define bi2addr(bi) \
+ (((bi) << CLIB_LOG2_CACHE_LINE_BYTES) + (copy ? XDP_PACKET_HEADROOM : 0))
wrap_around:
@@ -218,8 +212,8 @@ af_xdp_device_input_bufs (vlib_main_t * vm, const af_xdp_device_t * ad,
const u32 mask = rxq->rx.mask;
u32 n = n_rx, *bi = bis, bytes = 0;
-#define addr2bi(addr) \
- (((addr) - (copy ? sizeof(vlib_buffer_t) : 0)) >> CLIB_LOG2_CACHE_LINE_BYTES)
+#define addr2bi(addr) \
+ (((addr) - (copy ? XDP_PACKET_HEADROOM : 0)) >> CLIB_LOG2_CACHE_LINE_BYTES)
while (n >= 1)
{
diff --git a/src/plugins/avf/input.c b/src/plugins/avf/input.c
index 03ec2883601..6e437da2a16 100644
--- a/src/plugins/avf/input.c
+++ b/src/plugins/avf/input.c
@@ -230,11 +230,6 @@ avf_process_rx_burst (vlib_main_t * vm, vlib_node_runtime_t * node,
n_rx_bytes += avf_rx_attach_tail (vm, &bt, b[3], qw1[3], tail + 3);
}
- VLIB_BUFFER_TRACE_TRAJECTORY_INIT (b[0]);
- VLIB_BUFFER_TRACE_TRAJECTORY_INIT (b[1]);
- VLIB_BUFFER_TRACE_TRAJECTORY_INIT (b[2]);
- VLIB_BUFFER_TRACE_TRAJECTORY_INIT (b[3]);
-
/* next */
qw1 += 4;
tail += 4;
@@ -251,8 +246,6 @@ avf_process_rx_burst (vlib_main_t * vm, vlib_node_runtime_t * node,
if (maybe_multiseg)
n_rx_bytes += avf_rx_attach_tail (vm, &bt, b[0], qw1[0], tail + 0);
- VLIB_BUFFER_TRACE_TRAJECTORY_INIT (b[0]);
-
/* next */
qw1 += 1;
tail += 1;
diff --git a/src/plugins/dhcp/client.c b/src/plugins/dhcp/client.c
index e79cb694378..f93643390e9 100644
--- a/src/plugins/dhcp/client.c
+++ b/src/plugins/dhcp/client.c
@@ -500,7 +500,6 @@ send_dhcp_pkt (dhcp_client_main_t * dcm, dhcp_client_t * c,
/* Build a dhcpv4 pkt from whole cloth */
b = vlib_get_buffer (vm, bi);
- VLIB_BUFFER_TRACE_TRAJECTORY_INIT (b);
ASSERT (b->current_data == 0);
diff --git a/src/plugins/dhcp/dhcp4_proxy_node.c b/src/plugins/dhcp/dhcp4_proxy_node.c
index 6a3c51018d1..2ddad25bb11 100644
--- a/src/plugins/dhcp/dhcp4_proxy_node.c
+++ b/src/plugins/dhcp/dhcp4_proxy_node.c
@@ -370,7 +370,6 @@ dhcp_proxy_to_server_input (vlib_main_t * vm,
DHCP_PROXY_ERROR_ALLOC_FAIL, 1);
continue;
}
- VLIB_BUFFER_TRACE_TRAJECTORY_INIT (c0);
ci0 = vlib_get_buffer_index (vm, c0);
server = &proxy->dhcp_servers[ii];
diff --git a/src/plugins/dhcp/dhcp6_proxy_node.c b/src/plugins/dhcp/dhcp6_proxy_node.c
index 3b95e7f9f09..33fb8a37992 100644
--- a/src/plugins/dhcp/dhcp6_proxy_node.c
+++ b/src/plugins/dhcp/dhcp6_proxy_node.c
@@ -443,7 +443,6 @@ dhcpv6_proxy_to_server_input (vlib_main_t * vm,
DHCPV6_PROXY_ERROR_ALLOC_FAIL, 1);
continue;
}
- VLIB_BUFFER_TRACE_TRAJECTORY_INIT (c0);
ci0 = vlib_get_buffer_index (vm, c0);
server = &proxy->dhcp_servers[ii];
diff --git a/src/plugins/dpdk/device/device.c b/src/plugins/dpdk/device/device.c
index be20b4f8551..94b3f6b289a 100644
--- a/src/plugins/dpdk/device/device.c
+++ b/src/plugins/dpdk/device/device.c
@@ -311,11 +311,6 @@ VNET_DEVICE_CLASS_TX_FN (dpdk_device_class) (vlib_main_t * vm,
or_flags = b[0]->flags | b[1]->flags | b[2]->flags | b[3]->flags;
all_or_flags |= or_flags;
- VLIB_BUFFER_TRACE_TRAJECTORY_INIT (b[0]);
- VLIB_BUFFER_TRACE_TRAJECTORY_INIT (b[1]);
- VLIB_BUFFER_TRACE_TRAJECTORY_INIT (b[2]);
- VLIB_BUFFER_TRACE_TRAJECTORY_INIT (b[3]);
-
if (or_flags & VLIB_BUFFER_NEXT_PRESENT)
{
dpdk_validate_rte_mbuf (vm, b[0], 1);
@@ -374,9 +369,6 @@ VNET_DEVICE_CLASS_TX_FN (dpdk_device_class) (vlib_main_t * vm,
or_flags = b[0]->flags | b[1]->flags;
all_or_flags |= or_flags;
- VLIB_BUFFER_TRACE_TRAJECTORY_INIT (b[0]);
- VLIB_BUFFER_TRACE_TRAJECTORY_INIT (b[1]);
-
if (or_flags & VLIB_BUFFER_NEXT_PRESENT)
{
dpdk_validate_rte_mbuf (vm, b[0], 1);
@@ -412,7 +404,6 @@ VNET_DEVICE_CLASS_TX_FN (dpdk_device_class) (vlib_main_t * vm,
{
b[0] = vlib_buffer_from_rte_mbuf (mb[0]);
all_or_flags |= b[0]->flags;
- VLIB_BUFFER_TRACE_TRAJECTORY_INIT (b[0]);
dpdk_validate_rte_mbuf (vm, b[0], 1);
dpdk_buffer_tx_offload (xd, b[0], mb[0]);
diff --git a/src/plugins/dpdk/device/node.c b/src/plugins/dpdk/device/node.c
index 2eec74eaab2..98cda4c452f 100644
--- a/src/plugins/dpdk/device/node.c
+++ b/src/plugins/dpdk/device/node.c
@@ -216,11 +216,6 @@ dpdk_process_rx_burst (vlib_main_t * vm, dpdk_per_thread_data_t * ptd,
n_bytes += dpdk_process_subseq_segs (vm, b[3], mb[3], &bt);
}
- VLIB_BUFFER_TRACE_TRAJECTORY_INIT (b[0]);
- VLIB_BUFFER_TRACE_TRAJECTORY_INIT (b[1]);
- VLIB_BUFFER_TRACE_TRAJECTORY_INIT (b[2]);
- VLIB_BUFFER_TRACE_TRAJECTORY_INIT (b[3]);
-
/* next */
mb += 4;
n_left -= 4;
@@ -238,7 +233,6 @@ dpdk_process_rx_burst (vlib_main_t * vm, dpdk_per_thread_data_t * ptd,
if (maybe_multiseg)
n_bytes += dpdk_process_subseq_segs (vm, b[0], mb[0], &bt);
- VLIB_BUFFER_TRACE_TRAJECTORY_INIT (b[0]);
/* next */
mb += 1;
diff --git a/src/plugins/flowprobe/node.c b/src/plugins/flowprobe/node.c
index 70dc7267fd8..ab3640ca135 100644
--- a/src/plugins/flowprobe/node.c
+++ b/src/plugins/flowprobe/node.c
@@ -650,7 +650,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);
- VLIB_BUFFER_TRACE_TRAJECTORY_INIT (b0);
b0->current_data = 0;
b0->current_length = flowprobe_get_headersize ();
diff --git a/src/plugins/igmp/igmp_pkt.c b/src/plugins/igmp/igmp_pkt.c
index 8912e5af882..c2ce5c71255 100644
--- a/src/plugins/igmp/igmp_pkt.c
+++ b/src/plugins/igmp/igmp_pkt.c
@@ -38,7 +38,6 @@ igmp_pkt_get_buffer (igmp_pkt_build_t * bk)
return (NULL);
b = vlib_get_buffer (vm, bi);
- VLIB_BUFFER_TRACE_TRAJECTORY_INIT (b);
b->flags |= VNET_BUFFER_F_LOCALLY_ORIGINATED;
b->flags |= VLIB_BUFFER_IS_TRACED;
diff --git a/src/plugins/marvell/pp2/input.c b/src/plugins/marvell/pp2/input.c
index 202572dc152..44f01355e39 100644
--- a/src/plugins/marvell/pp2/input.c
+++ b/src/plugins/marvell/pp2/input.c
@@ -233,9 +233,6 @@ mrvl_pp2_device_input_inline (vlib_main_t * vm, vlib_node_runtime_t * node,
clib_memcpy_fast (vnet_buffer (b1)->sw_if_index, sw_if_index,
sizeof (sw_if_index));
- VLIB_BUFFER_TRACE_TRAJECTORY_INIT (b0);
- VLIB_BUFFER_TRACE_TRAJECTORY_INIT (b1);
-
if (PREDICT_FALSE (n_trace > 0))
{
mrvl_pp2_input_trace (vm, node, next0, b0, &n_trace, ppif, d);
@@ -277,8 +274,6 @@ mrvl_pp2_device_input_inline (vlib_main_t * vm, vlib_node_runtime_t * node,
clib_memcpy_fast (vnet_buffer (b0)->sw_if_index, sw_if_index,
sizeof (sw_if_index));
- VLIB_BUFFER_TRACE_TRAJECTORY_INIT (b0);
-
if (PREDICT_FALSE (n_trace > 0))
mrvl_pp2_input_trace (vm, node, next0, b0, &n_trace, ppif, d);
diff --git a/src/plugins/memif/node.c b/src/plugins/memif/node.c
index 675acf3b49e..b2422f9e323 100644
--- a/src/plugins/memif/node.c
+++ b/src/plugins/memif/node.c
@@ -91,8 +91,6 @@ memif_trace_buffer (vlib_main_t * vm, vlib_node_runtime_t * node,
memif_if_t * mif, vlib_buffer_t * b, u32 next, u16 qid,
uword * n_tracep)
{
- VLIB_BUFFER_TRACE_TRAJECTORY_INIT (b);
-
if (PREDICT_TRUE
(b != 0 && vlib_trace_buffer (vm, node, next, b, /* follow_chain */ 0)))
{
diff --git a/src/plugins/nat/lib/ipfix_logging.c b/src/plugins/nat/lib/ipfix_logging.c
index 2a5130e09d0..6e5e4b6c750 100644
--- a/src/plugins/nat/lib/ipfix_logging.c
+++ b/src/plugins/nat/lib/ipfix_logging.c
@@ -613,7 +613,6 @@ nat_ipfix_logging_nat44_ses (u32 thread_index, u8 nat_event, u32 src_ip,
}
b0 = sitd->nat44_session_buffer = vlib_get_buffer (vm, bi0);
- VLIB_BUFFER_TRACE_TRAJECTORY_INIT (b0);
offset = 0;
}
else
@@ -714,7 +713,6 @@ nat_ipfix_logging_addr_exhausted (u32 thread_index, u32 pool_id, int do_flush)
}
b0 = sitd->addr_exhausted_buffer = vlib_get_buffer (vm, bi0);
- VLIB_BUFFER_TRACE_TRAJECTORY_INIT (b0);
offset = 0;
}
else
@@ -800,7 +798,6 @@ nat_ipfix_logging_max_entries_per_usr (u32 thread_index,
}
b0 = sitd->max_entries_per_user_buffer = vlib_get_buffer (vm, bi0);
- VLIB_BUFFER_TRACE_TRAJECTORY_INIT (b0);
offset = 0;
}
else
@@ -892,7 +889,6 @@ nat_ipfix_logging_max_ses (u32 thread_index, u32 limit, int do_flush)
}
b0 = sitd->max_sessions_buffer = vlib_get_buffer (vm, bi0);
- VLIB_BUFFER_TRACE_TRAJECTORY_INIT (b0);
offset = 0;
}
else
@@ -981,7 +977,6 @@ nat_ipfix_logging_max_bib (u32 thread_index, u32 limit, int do_flush)
}
b0 = sitd->max_bibs_buffer = vlib_get_buffer (vm, bi0);
- VLIB_BUFFER_TRACE_TRAJECTORY_INIT (b0);
offset = 0;
}
else
@@ -1071,7 +1066,6 @@ nat_ipfix_logging_nat64_bibe (u32 thread_index, u8 nat_event,
}
b0 = sitd->nat64_bib_buffer = vlib_get_buffer (vm, bi0);
- VLIB_BUFFER_TRACE_TRAJECTORY_INIT (b0);
offset = 0;
}
else
@@ -1175,7 +1169,6 @@ nat_ipfix_logging_nat64_ses (u32 thread_index, u8 nat_event,
}
b0 = sitd->nat64_ses_buffer = vlib_get_buffer (vm, bi0);
- VLIB_BUFFER_TRACE_TRAJECTORY_INIT (b0);
offset = 0;
}
else
diff --git a/src/plugins/nat/nat44-ei/nat44_ei_ha.c b/src/plugins/nat/nat44-ei/nat44_ei_ha.c
index d94d07bdbfa..91eea98f84d 100644
--- a/src/plugins/nat/nat44-ei/nat44_ei_ha.c
+++ b/src/plugins/nat/nat44-ei/nat44_ei_ha.c
@@ -749,7 +749,6 @@ nat_ha_event_add (nat_ha_event_t *event, u8 do_flush, u32 session_thread_index,
b = td->state_sync_buffer = vlib_get_buffer (vm, bi);
clib_memset (vnet_buffer (b), 0, sizeof (*vnet_buffer (b)));
- VLIB_BUFFER_TRACE_TRAJECTORY_INIT (b);
offset = 0;
}
else
diff --git a/src/plugins/ping/ping.c b/src/plugins/ping/ping.c
index f3e238b9cd7..d09babd0be2 100644
--- a/src/plugins/ping/ping.c
+++ b/src/plugins/ping/ping.c
@@ -964,7 +964,6 @@ send_ip46_ping (vlib_main_t * vm,
ERROR_OUT (SEND_PING_ALLOC_FAIL);
b0 = vlib_get_buffer (vm, bi0);
- VLIB_BUFFER_TRACE_TRAJECTORY_INIT (b0);
/*
* if the user did not provide a source interface,
diff --git a/src/plugins/vmxnet3/output.c b/src/plugins/vmxnet3/output.c
index 4c9b7093f73..0de91d9bf21 100644
--- a/src/plugins/vmxnet3/output.c
+++ b/src/plugins/vmxnet3/output.c
@@ -175,7 +175,6 @@ VNET_DEVICE_CLASS_TX_FN (vmxnet3_device_class) (vlib_main_t * vm,
for (i = 0; i < space_needed; i++)
{
b0 = vlib_get_buffer (vm, bi0);
- VLIB_BUFFER_TRACE_TRAJECTORY_INIT (b0);
desc_idx = txq->tx_ring.produce;
diff --git a/src/plugins/vrrp/vrrp_packet.c b/src/plugins/vrrp/vrrp_packet.c
index b77f336930a..8daee500ece 100644
--- a/src/plugins/vrrp/vrrp_packet.c
+++ b/src/plugins/vrrp/vrrp_packet.c
@@ -313,7 +313,6 @@ vrrp_adv_send (vrrp_vr_t * vr, int shutdown)
bi0 = vec_elt (bi, i);
b = vlib_get_buffer (vm, bi0);
- VLIB_BUFFER_TRACE_TRAJECTORY_INIT (b);
b->flags |= VNET_BUFFER_F_LOCALLY_ORIGINATED;
vnet_buffer (b)->sw_if_index[VLIB_RX] = 0;
vnet_buffer (b)->sw_if_index[VLIB_TX] = vr->config.sw_if_index;
@@ -500,7 +499,6 @@ vrrp_garp_or_na_send (vrrp_vr_t * vr)
addr = vec_elt_at_index (vr->config.vr_addrs, i);
b = vlib_get_buffer (vm, bi[i]);
- VLIB_BUFFER_TRACE_TRAJECTORY_INIT (b);
b->flags |= VNET_BUFFER_F_LOCALLY_ORIGINATED;
vnet_buffer (b)->sw_if_index[VLIB_RX] = 0;
vnet_buffer (b)->sw_if_index[VLIB_TX] = vr->config.sw_if_index;
@@ -704,7 +702,6 @@ vrrp_vr_multicast_group_join (vrrp_vr_t * vr)
b = vlib_get_buffer (vm, bi);
- VLIB_BUFFER_TRACE_TRAJECTORY_INIT (b);
b->flags |= VNET_BUFFER_F_LOCALLY_ORIGINATED;
vnet_buffer (b)->sw_if_index[VLIB_RX] = 0;