examples/vhost: remove async inflight packet counter
authorCheng Jiang <cheng1.jiang@intel.com>
Tue, 2 Feb 2021 06:17:51 +0000 (06:17 +0000)
committerFerruh Yigit <ferruh.yigit@intel.com>
Thu, 4 Feb 2021 17:19:36 +0000 (18:19 +0100)
Remove async inflight packet counter since there is no need to keep
tracking it. Increase MAX_ENQUEUED_SIZE to prevent packet segment number
tracking ring from being exhausted.

Fixes: a68ba8e0a6b6 ("examples/vhost: refactor vhost data path")

Signed-off-by: Cheng Jiang <cheng1.jiang@intel.com>
Reviewed-by: Maxime Coquelin <maxime.coquelin@redhat.com>
examples/vhost/ioat.h
examples/vhost/main.c
examples/vhost/main.h

index 0a1dbb8..1aa28ed 100644 (file)
@@ -11,7 +11,7 @@
 
 #define MAX_VHOST_DEVICE 1024
 #define IOAT_RING_SIZE 4096
-#define MAX_ENQUEUED_SIZE 512
+#define MAX_ENQUEUED_SIZE 4096
 
 struct dma_info {
        struct rte_pci_addr addr;
index 233a2dc..99e8d9c 100644 (file)
@@ -831,11 +831,8 @@ complete_async_pkts(struct vhost_dev *vdev)
 
        complete_count = rte_vhost_poll_enqueue_completed(vdev->vid,
                                        VIRTIO_RXQ, p_cpl, MAX_PKT_BURST);
-       if (complete_count) {
-               __atomic_sub_fetch(&vdev->nr_async_pkts, complete_count,
-                       __ATOMIC_SEQ_CST);
+       if (complete_count)
                free_pkts(p_cpl, complete_count);
-       }
 }
 
 static __rte_always_inline void
@@ -878,8 +875,6 @@ drain_vhost(struct vhost_dev *vdev)
                complete_async_pkts(vdev);
                ret = rte_vhost_submit_enqueue_burst(vdev->vid, VIRTIO_RXQ,
                                        m, nr_xmit, m_cpu_cpl, &cpu_cpl_nr);
-               __atomic_add_fetch(&vdev->nr_async_pkts, ret - cpu_cpl_nr,
-                               __ATOMIC_SEQ_CST);
 
                if (cpu_cpl_nr)
                        free_pkts(m_cpu_cpl, cpu_cpl_nr);
@@ -1210,9 +1205,6 @@ drain_eth_rx(struct vhost_dev *vdev)
                enqueue_count = rte_vhost_submit_enqueue_burst(vdev->vid,
                                        VIRTIO_RXQ, pkts, rx_count,
                                        m_cpu_cpl, &cpu_cpl_nr);
-               __atomic_add_fetch(&vdev->nr_async_pkts,
-                                       enqueue_count - cpu_cpl_nr,
-                                       __ATOMIC_SEQ_CST);
                if (cpu_cpl_nr)
                        free_pkts(m_cpu_cpl, cpu_cpl_nr);
 
index 2d6c05f..0ccdce4 100644 (file)
@@ -51,7 +51,6 @@ struct vhost_dev {
        uint64_t features;
        size_t hdr_len;
        uint16_t nr_vrings;
-       uint64_t nr_async_pkts;
        struct rte_vhost_memory *mem;
        struct device_statistics stats;
        TAILQ_ENTRY(vhost_dev) global_vdev_entry;