#include <vnet/ip/ip6_packet.h>
#include <vnet/ip/ip4_packet.h>
#include <vnet/udp/udp_packet.h>
-
+#include <vnet/interface/rx_queue_funcs.h>
#include <vmxnet3/vmxnet3.h>
#define foreach_vmxnet3_input_error \
b0->flags = 0;
b0->error = 0;
b0->current_config_index = 0;
- ASSERT (b0->current_length != 0);
if (PREDICT_FALSE ((rx_comp->index & VMXNET3_RXCI_EOP) &&
(rx_comp->len & VMXNET3_RXCL_ERROR)))
else if (rx_comp->index & VMXNET3_RXCI_EOP)
{
/* end of segment */
- if (prev_b0)
+ if (PREDICT_TRUE (prev_b0 != 0))
{
- prev_b0->flags |= VLIB_BUFFER_NEXT_PRESENT;
- prev_b0->next_buffer = bi0;
- hb->total_length_not_including_first_buffer +=
- b0->current_length;
+ if (PREDICT_TRUE (b0->current_length != 0))
+ {
+ prev_b0->flags |= VLIB_BUFFER_NEXT_PRESENT;
+ prev_b0->next_buffer = bi0;
+ hb->total_length_not_including_first_buffer +=
+ b0->current_length;
+ }
+ else
+ {
+ vlib_buffer_free_one (vm, bi0);
+ }
prev_b0 = 0;
got_packet = 1;
}
ethernet_header_t *e = (ethernet_header_t *) hb->data;
next[0] = VNET_DEVICE_INPUT_NEXT_ETHERNET_INPUT;
- if (!ethernet_frame_is_tagged (e->type))
+ if (!ethernet_frame_is_tagged (ntohs (e->type)))
vmxnet3_handle_offload (rx_comp, hb, gso_size);
}
next = nexts;
while (n_trace && n_left)
{
- vlib_buffer_t *b;
- vmxnet3_input_trace_t *tr;
-
- b = vlib_get_buffer (vm, bi[0]);
- vlib_trace_buffer (vm, node, next[0], b, /* follow_chain */ 0);
- tr = vlib_add_trace (vm, node, b, sizeof (*tr));
- tr->next_index = next[0];
- tr->hw_if_index = vd->hw_if_index;
- tr->buffer = *b;
-
- n_trace--;
+ vlib_buffer_t *b = vlib_get_buffer (vm, bi[0]);
+ if (PREDICT_TRUE
+ (vlib_trace_buffer
+ (vm, node, next[0], b, /* follow_chain */ 0)))
+ {
+ vmxnet3_input_trace_t *tr =
+ vlib_add_trace (vm, node, b, sizeof (*tr));
+ tr->next_index = next[0];
+ tr->hw_if_index = vd->hw_if_index;
+ tr->buffer = *b;
+ n_trace--;
+ }
n_left--;
bi++;
next++;
{
u32 n_rx = 0;
vmxnet3_main_t *vmxm = &vmxnet3_main;
- vnet_device_input_runtime_t *rt = (void *) node->runtime_data;
- vnet_device_and_queue_t *dq;
-
- foreach_device_and_queue (dq, rt->devices_and_queues)
- {
- vmxnet3_device_t *vd;
- vd = vec_elt_at_index (vmxm->devices, dq->dev_instance);
- if ((vd->flags & VMXNET3_DEVICE_F_ADMIN_UP) == 0)
- continue;
- n_rx += vmxnet3_device_input_inline (vm, node, frame, vd, dq->queue_id);
- }
+ vnet_hw_if_rxq_poll_vector_t *pv = vnet_hw_if_get_rxq_poll_vector (vm, node);
+ vnet_hw_if_rxq_poll_vector_t *pve;
+
+ vec_foreach (pve, pv)
+ {
+ vmxnet3_device_t *vd;
+ vd = vec_elt_at_index (vmxm->devices, pve->dev_instance);
+ if ((vd->flags & VMXNET3_DEVICE_F_ADMIN_UP) == 0)
+ continue;
+ n_rx += vmxnet3_device_input_inline (vm, node, frame, vd, pve->queue_id);
+ }
return n_rx;
}
VLIB_REGISTER_NODE (vmxnet3_input_node) = {
.name = "vmxnet3-input",
.sibling_of = "device-input",
+ .flags = VLIB_NODE_FLAG_TRACE_SUPPORTED,
.format_trace = format_vmxnet3_input_trace,
.type = VLIB_NODE_TYPE_INPUT,
.state = VLIB_NODE_STATE_DISABLED,