diff options
author | 2017-05-16 14:51:32 +0200 | |
---|---|---|
committer | 2017-05-16 14:51:32 +0200 | |
commit | fca143f059a0bddd7d47b8dc2df646a891b0eb0f (patch) | |
tree | 4bfeadc905c977e45e54a90c42330553b8942e4e /drivers/net/virtio/virtio_rxtx_simple_sse.c | |
parent | ce3d555e43e3795b5d9507fcfc76b7a0a92fd0d6 (diff) |
Imported Upstream version 17.05
Diffstat (limited to 'drivers/net/virtio/virtio_rxtx_simple_sse.c')
-rw-r--r-- | drivers/net/virtio/virtio_rxtx_simple_sse.c | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/drivers/net/virtio/virtio_rxtx_simple_sse.c b/drivers/net/virtio/virtio_rxtx_simple_sse.c index 87bb5c63..7cf0f8b8 100644 --- a/drivers/net/virtio/virtio_rxtx_simple_sse.c +++ b/drivers/net/virtio/virtio_rxtx_simple_sse.c @@ -74,12 +74,13 @@ virtio_recv_pkts_vec(void *rx_queue, struct rte_mbuf **rx_pkts, { struct virtnet_rx *rxvq = rx_queue; struct virtqueue *vq = rxvq->vq; + struct virtio_hw *hw = vq->hw; uint16_t nb_used; uint16_t desc_idx; struct vring_used_elem *rused; struct rte_mbuf **sw_ring; struct rte_mbuf **sw_ring_end; - uint16_t nb_pkts_received; + uint16_t nb_pkts_received = 0; __m128i shuf_msk1, shuf_msk2, len_adjust; shuf_msk1 = _mm_set_epi8( @@ -109,6 +110,9 @@ virtio_recv_pkts_vec(void *rx_queue, struct rte_mbuf **rx_pkts, 0, (uint16_t)-vq->hw->vtnet_hdr_size, 0, 0); + if (unlikely(hw->started == 0)) + return nb_pkts_received; + if (unlikely(nb_pkts < RTE_VIRTIO_DESC_PER_LOOP)) return 0; |