net/virtio: fix Tx desc cleanup for packed ring
authorTiwei Bie <tiwei.bie@intel.com>
Tue, 19 Feb 2019 10:59:47 +0000 (18:59 +0800)
committerFerruh Yigit <ferruh.yigit@intel.com>
Fri, 22 Feb 2019 13:39:49 +0000 (14:39 +0100)
We should try to cleanup at least the 'need' number of descs.

Fixes: 892dc798fa9c ("net/virtio: implement Tx path for packed queues")
Cc: stable@dpdk.org
Signed-off-by: Tiwei Bie <tiwei.bie@intel.com>
Reviewed-by: Maxime Coquelin <maxime.coquelin@redhat.com>
drivers/net/virtio/virtio_rxtx.c

index 4c701c5..b07ceac 100644 (file)
@@ -1943,7 +1943,6 @@ virtio_xmit_pkts_packed(void *tx_queue, struct rte_mbuf **tx_pkts,
 
                /* Positive value indicates it need free vring descriptors */
                if (unlikely(need > 0)) {
-                       need = RTE_MIN(need, (int)nb_pkts);
                        virtio_xmit_cleanup_packed(vq, need);
                        need = slots - vq->vq_free_cnt;
                        if (unlikely(need > 0)) {