X-Git-Url: https://gerrit.fd.io/r/gitweb?a=blobdiff_plain;f=src%2Fvnet%2Fdevices%2Fvirtio%2Fnode.c;h=b58c75360e3e7b1f20c10fa2a141e6d69f15a580;hb=00c59e496;hp=551651ed372d677f1a8e643df9fe17acb4054d76;hpb=096c8cc680919858f51ba2a7ee451d8e5d1671f7;p=vpp.git diff --git a/src/vnet/devices/virtio/node.c b/src/vnet/devices/virtio/node.c index 551651ed372..b58c75360e3 100644 --- a/src/vnet/devices/virtio/node.c +++ b/src/vnet/devices/virtio/node.c @@ -214,6 +214,29 @@ virtio_get_len (vnet_virtio_vring_t *vring, const int packed, const int hdr_sz, } \ while (0) +static_always_inline void +virtio_device_input_ethernet (vlib_main_t *vm, vlib_node_runtime_t *node, + const u32 next_index, const u32 sw_if_index, + const u32 hw_if_index) +{ + vlib_next_frame_t *nf; + vlib_frame_t *f; + ethernet_input_frame_t *ef; + + if (PREDICT_FALSE (VNET_DEVICE_INPUT_NEXT_ETHERNET_INPUT != next_index)) + return; + + nf = vlib_node_runtime_get_next_frame ( + vm, node, VNET_DEVICE_INPUT_NEXT_ETHERNET_INPUT); + f = vlib_get_frame (vm, nf->frame); + f->flags = ETH_INPUT_FRAME_F_SINGLE_SW_IF_IDX; + + ef = vlib_frame_scalar_args (f); + ef->sw_if_index = sw_if_index; + ef->hw_if_index = hw_if_index; + vlib_frame_no_append (f); +} + static_always_inline uword virtio_device_input_gso_inline (vlib_main_t *vm, vlib_node_runtime_t *node, vlib_frame_t *frame, virtio_if_t *vif, @@ -248,7 +271,7 @@ virtio_device_input_gso_inline (vlib_main_t *vm, vlib_node_runtime_t *node, next_index = vif->per_interface_next_index; /* only for l2, redirect if feature path enabled */ - vnet_feature_start_device_input_x1 (vif->sw_if_index, &next_index, &bt); + vnet_feature_start_device_input (vif->sw_if_index, &next_index, &bt); } while (n_left) @@ -256,7 +279,7 @@ virtio_device_input_gso_inline (vlib_main_t *vm, vlib_node_runtime_t *node, u32 n_left_to_next; u32 next0 = next_index; - vlib_get_next_frame (vm, node, next_index, to_next, n_left_to_next); + vlib_get_new_next_frame (vm, node, next_index, to_next, n_left_to_next); while (n_left && n_left_to_next) { @@ -386,10 +409,13 @@ virtio_device_input_gso_inline (vlib_main_t *vm, vlib_node_runtime_t *node, n_rx_packets++; n_rx_bytes += len; } + virtio_device_input_ethernet (vm, node, next_index, vif->sw_if_index, + vif->hw_if_index); vlib_put_next_frame (vm, node, next_index, n_left_to_next); } vring->last_used_idx = last; + vring->total_packets += n_rx_packets; vlib_increment_combined_counter (vnm->interface_main.combined_sw_if_counters + VNET_INTERFACE_COUNTER_RX, thread_index, vif->sw_if_index, n_rx_packets,