vlib_buffer_is_mpls (vlib_buffer_t * b)
{
ethernet_header_t *h = (ethernet_header_t *) vlib_buffer_get_current (b);
- return (h->type == clib_host_to_net_u16 (ETHERNET_TYPE_MPLS_UNICAST));
+ return (h->type == clib_host_to_net_u16 (ETHERNET_TYPE_MPLS));
}
always_inline u32
*error = DPDK_ERROR_NONE;
}
-void
+static void
dpdk_rx_trace (dpdk_main_t * dm,
vlib_node_runtime_t * node,
dpdk_device_t * xd,
mb_seg = mb->next;
b_chain = b;
- while ((mb->nb_segs > 1) && (nb_seg < mb->nb_segs))
+ if (mb->nb_segs < 2)
+ return;
+
+ b->flags |= VLIB_BUFFER_TOTAL_LENGTH_VALID;
+ b->total_length_not_including_first_buffer = 0;
+
+ while (nb_seg < mb->nb_segs)
{
ASSERT (mb_seg != 0);
dpdk_buffer_init_from_template (void *d0, void *d1, void *d2, void *d3,
void *s)
{
+#if defined(CLIB_HAVE_VEC128)
int i;
for (i = 0; i < 2; i++)
{
*(u8x32 *) (((u8 *) d2) + i * 32) =
*(u8x32 *) (((u8 *) d3) + i * 32) = *(u8x32 *) (((u8 *) s) + i * 32);
}
+#elif defined(CLIB_HAVE_VEC64)
+ int i;
+ for (i = 0; i < 4; i++)
+ {
+ *(u8x16 *) (((u8 *) d0) + i * 16) =
+ *(u8x16 *) (((u8 *) d1) + i * 16) =
+ *(u8x16 *) (((u8 *) d2) + i * 16) =
+ *(u8x16 *) (((u8 *) d3) + i * 16) = *(u8x16 *) (((u8 *) s) + i * 16);
+ }
+#else
+#error "Either CLIB_HAVE_VEC128 or CLIB_HAVE_VEC64 has to be defined"
+#endif
}
/*
dpdk_main_t *dm = &dpdk_main;
dpdk_device_t *xd;
uword n_rx_packets = 0;
- dpdk_device_and_queue_t *dq;
- u32 thread_index = vlib_get_thread_index ();
+ vnet_device_input_runtime_t *rt = (void *) node->runtime_data;
+ vnet_device_and_queue_t *dq;
+ u32 thread_index = node->thread_index;
/*
* Poll all devices on this cpu for input/interrupts.
*/
/* *INDENT-OFF* */
- vec_foreach (dq, dm->devices_by_cpu[thread_index])
+ foreach_device_and_queue (dq, rt->devices_and_queues)
{
- xd = vec_elt_at_index(dm->devices, dq->device);
+ xd = vec_elt_at_index(dm->devices, dq->dev_instance);
+ if (PREDICT_FALSE (xd->flags & DPDK_DEVICE_FLAG_BOND_SLAVE))
+ continue; /* Do not poll slave to a bonded interface */
if (xd->flags & DPDK_DEVICE_FLAG_MAYBE_MULTISEG)
n_rx_packets += dpdk_device_input (dm, xd, node, thread_index, dq->queue_id, /* maybe_multiseg */ 1);
else