X-Git-Url: https://gerrit.fd.io/r/gitweb?a=blobdiff_plain;f=src%2Fvnet%2Fdevices%2Fvirtio%2Fdevice.c;h=29b38a2ed225adc0b398e0adae79a9da63658659;hb=587f9130424fd451e4ba823240d02f655fb197d1;hp=fe943a9b6d7830c0ff377970a9e3e546ecd024b4;hpb=6178bdafa6a318d50cc8ad82f07c6c798c7024ef;p=vpp.git diff --git a/src/vnet/devices/virtio/device.c b/src/vnet/devices/virtio/device.c index fe943a9b6d7..29b38a2ed22 100644 --- a/src/vnet/devices/virtio/device.c +++ b/src/vnet/devices/virtio/device.c @@ -552,11 +552,6 @@ virtio_interface_tx_gso_inline (vlib_main_t * vm, vlib_node_runtime_t * node, u16 sz = vring->size; u16 mask = sz - 1; u16 n_vectors = n_left; - u16 retry_count = 2; - -retry: - /* free consumed buffers */ - virtio_free_used_device_desc (vm, vring, node->node_index); used = vring->desc_in_use; next = vring->desc_next; @@ -645,9 +640,6 @@ retry: virtio_kick (vm, vring, vif); } - if (n_left && retry_count--) - goto retry; - return n_left; } @@ -701,6 +693,12 @@ VNET_DEVICE_CLASS_TX_FN (virtio_device_class) (vlib_main_t * vm, buffers = to; } + u16 retry_count = 2; + +retry: + /* free consumed buffers */ + virtio_free_used_device_desc (vm, vring, node->node_index); + if (vif->type == VIRTIO_IF_TYPE_TAP) n_left = virtio_interface_tx_inline (vm, node, vif, vring, VIRTIO_IF_TYPE_TAP, buffers, n_left); @@ -713,6 +711,9 @@ VNET_DEVICE_CLASS_TX_FN (virtio_device_class) (vlib_main_t * vm, else ASSERT (0); + if (n_left && retry_count--) + goto retry; + if (vif->packet_buffering && n_left) { u16 n_buffered =