#include <vnet/mpls/packet.h>
#include <vnet/handoff.h>
#include <vnet/devices/devices.h>
+#include <vnet/interface/rx_queue_funcs.h>
#include <vnet/feature/feature.h>
#include <dpdk/device/dpdk_priv.h>
<code>xd->per_interface_next_index</code>
*/
-static_always_inline u8
+static_always_inline u16
dpdk_ol_flags_extract (struct rte_mbuf **mb, u16 * flags, int count)
{
- u8 rv = 0;
+ u16 rv = 0;
int i;
for (i = 0; i < count; i++)
{
vlib_node_runtime_t * node, u32 thread_index, u16 queue_id)
{
uword n_rx_packets = 0, n_rx_bytes;
+ dpdk_rx_queue_t *rxq = vec_elt_at_index (xd->rx_queues, queue_id);
u32 n_left, n_trace;
u32 *buffers;
u32 next_index = VNET_DEVICE_INPUT_NEXT_ETHERNET_INPUT;
bt->error = node->errors[DPDK_ERROR_NONE];
/* as DPDK is allocating empty buffers from mempool provided before interface
start for each queue, it is safe to store this in the template */
- bt->buffer_pool_index = xd->buffer_pool_for_queue[queue_id];
+ bt->buffer_pool_index = rxq->buffer_pool_index;
bt->ref_count = 1;
vnet_buffer (bt)->feature_arc_index = 0;
bt->current_config_index = 0;
vlib_frame_t *f;
ethernet_input_frame_t *ef;
nf = vlib_node_runtime_get_next_frame (vm, node, next_index);
- f = vlib_get_frame (vm, nf->frame_index);
+ f = vlib_get_frame (vm, nf->frame);
f->flags = ETH_INPUT_FRAME_F_SINGLE_SW_IF_IDX;
ef = vlib_frame_scalar_args (f);
b0 = vlib_get_buffer (vm, buffers[0]);
if (single_next == 0)
next_index = next[0];
- vlib_trace_buffer (vm, node, next_index, b0, /* follow_chain */ 0);
-
- dpdk_rx_trace_t *t0 = vlib_add_trace (vm, node, b0, sizeof t0[0]);
- t0->queue_index = queue_id;
- t0->device_index = xd->device_index;
- t0->buffer_index = vlib_get_buffer_index (vm, b0);
-
- clib_memcpy_fast (&t0->mb, mb[0], sizeof t0->mb);
- clib_memcpy_fast (&t0->buffer, b0,
- sizeof b0[0] - sizeof b0->pre_data);
- clib_memcpy_fast (t0->buffer.pre_data, b0->data,
- sizeof t0->buffer.pre_data);
- clib_memcpy_fast (&t0->data, mb[0]->buf_addr + mb[0]->data_off,
- sizeof t0->data);
- n_trace--;
+
+ if (PREDICT_TRUE
+ (vlib_trace_buffer
+ (vm, node, next_index, b0, /* follow_chain */ 0)))
+ {
+
+ dpdk_rx_trace_t *t0 =
+ vlib_add_trace (vm, node, b0, sizeof t0[0]);
+ t0->queue_index = queue_id;
+ t0->device_index = xd->device_index;
+ t0->buffer_index = vlib_get_buffer_index (vm, b0);
+
+ clib_memcpy_fast (&t0->mb, mb[0], sizeof t0->mb);
+ clib_memcpy_fast (&t0->buffer, b0,
+ sizeof b0[0] - sizeof b0->pre_data);
+ clib_memcpy_fast (t0->buffer.pre_data, b0->data,
+ sizeof t0->buffer.pre_data);
+ clib_memcpy_fast (&t0->data, mb[0]->buf_addr + mb[0]->data_off,
+ sizeof t0->data);
+ n_trace--;
+ }
+
n_left--;
buffers++;
mb++;
dpdk_main_t *dm = &dpdk_main;
dpdk_device_t *xd;
uword n_rx_packets = 0;
- vnet_device_input_runtime_t *rt = (void *) node->runtime_data;
- vnet_device_and_queue_t *dq;
+ vnet_hw_if_rxq_poll_vector_t *pv;
u32 thread_index = node->thread_index;
/*
* Poll all devices on this cpu for input/interrupts.
*/
- /* *INDENT-OFF* */
- foreach_device_and_queue (dq, rt->devices_and_queues)
+
+ pv = vnet_hw_if_get_rxq_poll_vector (vm, node);
+
+ for (int i = 0; i < vec_len (pv); i++)
{
- 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 */
- n_rx_packets += dpdk_device_input (vm, dm, xd, node, thread_index,
- dq->queue_id);
+ xd = vec_elt_at_index (dm->devices, pv[i].dev_instance);
+ n_rx_packets +=
+ dpdk_device_input (vm, dm, xd, node, thread_index, pv[i].queue_id);
}
- /* *INDENT-ON* */
return n_rx_packets;
}
.type = VLIB_NODE_TYPE_INPUT,
.name = "dpdk-input",
.sibling_of = "device-input",
+ .flags = VLIB_NODE_FLAG_TRACE_SUPPORTED,
/* Will be enabled if/when hardware is detected. */
.state = VLIB_NODE_STATE_DISABLED,