u32 n_left, *from;
n_left = n_buffers;
- from = vlib_frame_args (frame);
+ from = vlib_frame_vector_args (frame);
while (n_left >= 4)
{
{
t0 = vlib_add_trace (vm, node, b0, sizeof (t0[0]));
t0->sw_if_index = vnet_buffer (b0)->sw_if_index[VLIB_TX];
- clib_memcpy (t0->data, vlib_buffer_get_current (b0),
- sizeof (t0->data));
+ clib_memcpy_fast (t0->data, vlib_buffer_get_current (b0),
+ sizeof (t0->data));
}
if (b1->flags & VLIB_BUFFER_IS_TRACED)
{
t1 = vlib_add_trace (vm, node, b1, sizeof (t1[0]));
t1->sw_if_index = vnet_buffer (b1)->sw_if_index[VLIB_TX];
- clib_memcpy (t1->data, vlib_buffer_get_current (b1),
- sizeof (t1->data));
+ clib_memcpy_fast (t1->data, vlib_buffer_get_current (b1),
+ sizeof (t1->data));
}
from += 2;
n_left -= 2;
{
t0 = vlib_add_trace (vm, node, b0, sizeof (t0[0]));
t0->sw_if_index = vnet_buffer (b0)->sw_if_index[VLIB_TX];
- clib_memcpy (t0->data, vlib_buffer_get_current (b0),
- sizeof (t0->data));
+ clib_memcpy_fast (t0->data, vlib_buffer_get_current (b0),
+ sizeof (t0->data));
}
from += 1;
n_left -= 1;
if (b->flags & VNET_BUFFER_F_OFFLOAD_IP_CKSUM)
ip4->checksum = ip4_header_checksum (ip4);
if (b->flags & VNET_BUFFER_F_OFFLOAD_TCP_CKSUM)
- th->checksum = ip4_tcp_udp_compute_checksum (vm, b, ip4);
+ {
+ th->checksum = 0;
+ th->checksum = ip4_tcp_udp_compute_checksum (vm, b, ip4);
+ }
if (b->flags & VNET_BUFFER_F_OFFLOAD_UDP_CKSUM)
uh->checksum = ip4_tcp_udp_compute_checksum (vm, b, ip4);
}
if (node->flags & VLIB_NODE_FLAG_TRACE)
vnet_interface_output_trace (vm, node, frame, n_buffers);
- from = vlib_frame_args (frame);
+ from = vlib_frame_vector_args (frame);
if (rt->is_deleted)
return vlib_error_drop_buffers (vm, node, from,
return n_buffers;
}
-static_always_inline uword
+uword
vnet_interface_output_node (vlib_main_t * vm, vlib_node_runtime_t * node,
vlib_frame_t * frame)
{
/* do_tx_offloads */ 1);
}
-VLIB_NODE_FUNCTION_MULTIARCH_CLONE (vnet_interface_output_node);
-CLIB_MULTIARCH_SELECT_FN (vnet_interface_output_node);
-
/* Use buffer's sw_if_index[VNET_TX] to choose output interface. */
static uword
vnet_per_buffer_interface_output (vlib_main_t * vm,
n_left_from = frame->n_vectors;
- from = vlib_frame_args (frame);
+ from = vlib_frame_vector_args (frame);
next_index = node->cached_next_index;
while (n_left_from > 0)
validate_error_frame (vlib_main_t * vm,
vlib_node_runtime_t * node, vlib_frame_t * f)
{
- u32 *buffers = vlib_frame_args (f);
+ u32 *buffers = vlib_frame_vector_args (f);
vlib_buffer_t *b;
u8 *msg = 0;
uword i;
static vlib_error_t memory[VNET_ERROR_N_DISPOSITION];
static char memory_init[VNET_ERROR_N_DISPOSITION];
- buffers = vlib_frame_args (frame);
+ buffers = vlib_frame_vector_args (frame);
first_buffer = buffers;
{
};
/* *INDENT-ON* */
+/* Convenience node to drop a vector of buffers with a "misc error". */
+static uword
+misc_drop_buffers (vlib_main_t * vm,
+ vlib_node_runtime_t * node, vlib_frame_t * frame)
+{
+ return vlib_error_drop_buffers (vm, node, vlib_frame_vector_args (frame),
+ /* buffer stride */ 1,
+ frame->n_vectors,
+ /* next */ 0,
+ node->node_index,
+ /* error */ 0);
+}
+
+static char *misc_drop_buffers_error_strings[] = {
+ [0] = "misc. errors",
+};
+
+/* *INDENT-OFF* */
+VLIB_REGISTER_NODE (misc_drop_buffers_node,static) = {
+ .function = misc_drop_buffers,
+ .name = "misc-drop-buffers",
+ .vector_size = sizeof (u32),
+ .n_errors = 1,
+ .n_next_nodes = 1,
+ .next_nodes = {
+ "error-drop",
+ },
+ .error_strings = misc_drop_buffers_error_strings,
+};
+/* *INDENT-ON* */
+
VLIB_NODE_FUNCTION_MULTIARCH (vnet_per_buffer_interface_output_node,
vnet_per_buffer_interface_output);
{
.arc_name = "interface-output",
.start_nodes = VNET_FEATURES (0),
+ .last_in_arc = "interface-tx",
.arc_index_ptr = &vnet_main.interface_main.output_feature_arc_index,
};
if (im->pcap_filename == 0)
im->pcap_filename = format (0, "/tmp/drop.pcap%c", 0);
- memset (&im->pcap_main, 0, sizeof (im->pcap_main));
+ clib_memset (&im->pcap_main, 0, sizeof (im->pcap_main));
im->pcap_main.file_name = (char *) im->pcap_filename;
im->pcap_main.n_packets_to_capture = 100;
if (im->pcap_pkts_to_capture)