Test-Label: iol-testing Test-Status: WARNING http://dpdk.org/patch/111602 _apply patch failure_ Submitter: Yuan Wang Date: Monday, May 23 2022 16:13:45 Applied on: CommitID:26d734b5d280b96f91f00f5e0c6c7eff99facef2 Apply patch set 111602-111603 failed: Checking patch doc/guides/prog_guide/vhost_lib.rst... error: while searching for: * ``rte_vhost_clear_queue_thread_unsafe(vid, queue_id, **pkts, count, dma_id, vchan_id)`` Clear inflight packets which are submitted to DMA engine in vhost async data path. Completed packets are returned to applications through ``pkts``. * ``rte_vhost_vring_stats_get_names(int vid, uint16_t queue_id, struct rte_vhost_stat_name *names, unsigned int size)`` error: patch failed: doc/guides/prog_guide/vhost_lib.rst:288 Checking patch doc/guides/rel_notes/release_22_07.rst... error: while searching for: Added vhost async dequeue API which can leverage DMA devices to accelerate receiving pkts from guest. Removed Items ------------- error: patch failed: doc/guides/rel_notes/release_22_07.rst:92 Checking patch lib/vhost/rte_vhost_async.h... Checking patch lib/vhost/version.map... error: while searching for: rte_vhost_vring_stats_get; rte_vhost_vring_stats_reset; rte_vhost_async_try_dequeue_burst; }; INTERNAL { error: patch failed: lib/vhost/version.map:94 Checking patch lib/vhost/virtio_net.c... Hunk #2 succeeded at 2088 (offset -72 lines). error: while searching for: return 0; } n_pkts_cpl = vhost_poll_enqueue_completed(dev, queue_id, pkts, count, dma_id, vchan_id); vhost_queue_stats_update(dev, vq, pkts, n_pkts_cpl); vq->stats.inflight_completed += n_pkts_cpl; error: patch failed: lib/vhost/virtio_net.c:2182 Hunk #4 succeeded at 2114 (offset -92 lines). Applying patch doc/guides/prog_guide/vhost_lib.rst with 1 reject... Rejected hunk #1. Applying patch doc/guides/rel_notes/release_22_07.rst with 1 reject... Rejected hunk #1. Applied patch lib/vhost/rte_vhost_async.h cleanly. Applying patch lib/vhost/version.map with 1 reject... Rejected hunk #1. Applying patch lib/vhost/virtio_net.c with 1 reject... Hunk #1 applied cleanly. Hunk #2 applied cleanly. Rejected hunk #3. Hunk #4 applied cleanly. diff a/doc/guides/prog_guide/vhost_lib.rst b/doc/guides/prog_guide/vhost_lib.rst (rejected hunks) @@ -288,7 +288,13 @@ The following is an overview of some key Vhost API functions: * ``rte_vhost_clear_queue_thread_unsafe(vid, queue_id, **pkts, count, dma_id, vchan_id)`` - Clear inflight packets which are submitted to DMA engine in vhost async data + Clear in-flight packets which are submitted to async channel in vhost + async data path without performing any locking. Completed packets are + returned to applications through ``pkts``. + +* ``rte_vhost_clear_queue(vid, queue_id, **pkts, count, dma_id, vchan_id)`` + + Clear in-flight packets which are submitted to async channel in vhost async data path. Completed packets are returned to applications through ``pkts``. * ``rte_vhost_vring_stats_get_names(int vid, uint16_t queue_id, struct rte_vhost_stat_name *names, unsigned int size)`` diff a/doc/guides/rel_notes/release_22_07.rst b/doc/guides/rel_notes/release_22_07.rst (rejected hunks) @@ -92,6 +92,11 @@ New Features Added vhost async dequeue API which can leverage DMA devices to accelerate receiving pkts from guest. +* **Added thread-safe version of inflight packet clear API in vhost library.** + + Added an API which can clear the inflight packets submitted to + the async channel in a thread-safe manner in the vhost async data path. + Removed Items ------------- diff a/lib/vhost/version.map b/lib/vhost/version.map (rejected hunks) @@ -94,6 +94,7 @@ EXPERIMENTAL { rte_vhost_vring_stats_get; rte_vhost_vring_stats_reset; rte_vhost_async_try_dequeue_burst; + rte_vhost_clear_queue; }; INTERNAL { diff a/lib/vhost/virtio_net.c b/lib/vhost/virtio_net.c (rejected hunks) @@ -2182,7 +2187,18 @@ rte_vhost_clear_queue_thread_unsafe(int vid, uint16_t queue_id, return 0; } - n_pkts_cpl = vhost_poll_enqueue_completed(dev, queue_id, pkts, count, dma_id, vchan_id); + if (queue_id % 2 == 0) + n_pkts_cpl = vhost_poll_enqueue_completed(dev, queue_id, + pkts, count, dma_id, vchan_id); + else { + if (unlikely(vq_is_packed(dev))) + VHOST_LOG_DATA(ERR, + "(%d) %s: async dequeue does not support packed ring.\n", + dev->vid, __func__); + else + n_pkts_cpl = async_poll_dequeue_completed_split(dev, vq, pkts, count, + dma_id, vchan_id, dev->flags & VIRTIO_DEV_LEGACY_OL_FLAGS); + } vhost_queue_stats_update(dev, vq, pkts, n_pkts_cpl); vq->stats.inflight_completed += n_pkts_cpl; Checking patch examples/vhost/main.c... error: while searching for: } } /* * Remove a device from the specific data core linked list and from the * main linked list. Synchronization occurs through the use of the error: patch failed: examples/vhost/main.c:1539 error: while searching for: vdev->vid); if (dma_bind[vid].dmas[VIRTIO_RXQ].async_enabled) { vhost_clear_queue_thread_unsafe(vdev, VIRTIO_RXQ); rte_vhost_async_channel_unregister(vid, VIRTIO_RXQ); dma_bind[vid].dmas[VIRTIO_RXQ].async_enabled = false; } if (dma_bind[vid].dmas[VIRTIO_TXQ].async_enabled) { vhost_clear_queue_thread_unsafe(vdev, VIRTIO_TXQ); rte_vhost_async_channel_unregister(vid, VIRTIO_TXQ); dma_bind[vid].dmas[VIRTIO_TXQ].async_enabled = false; } error: patch failed: examples/vhost/main.c:1596 error: while searching for: if (!vdev) return -1; if (queue_id != VIRTIO_RXQ) return 0; if (dma_bind[vid2socketid[vid]].dmas[queue_id].async_enabled) { if (!enable) vhost_clear_queue_thread_unsafe(vdev, queue_id); error: patch failed: examples/vhost/main.c:1761 Applying patch examples/vhost/main.c with 3 rejects... Rejected hunk #1. Rejected hunk #2. Rejected hunk #3. diff a/examples/vhost/main.c b/examples/vhost/main.c (rejected hunks) @@ -1539,6 +1539,25 @@ vhost_clear_queue_thread_unsafe(struct vhost_dev *vdev, uint16_t queue_id) } } +static void +vhost_clear_queue(struct vhost_dev *vdev, uint16_t queue_id) +{ + uint16_t n_pkt = 0; + int pkts_inflight; + + int16_t dma_id = dma_bind[vid2socketid[vdev->vid]].dmas[queue_id].dev_id; + pkts_inflight = rte_vhost_async_get_inflight(vdev->vid, queue_id); + + struct rte_mbuf *m_cpl[pkts_inflight]; + + while (pkts_inflight) { + n_pkt = rte_vhost_clear_queue(vdev->vid, queue_id, m_cpl, + pkts_inflight, dma_id, 0); + free_pkts(m_cpl, n_pkt); + pkts_inflight = rte_vhost_async_get_inflight(vdev->vid, queue_id); + } +} + /* * Remove a device from the specific data core linked list and from the * main linked list. Synchronization occurs through the use of the @@ -1596,13 +1615,13 @@ destroy_device(int vid) vdev->vid); if (dma_bind[vid].dmas[VIRTIO_RXQ].async_enabled) { - vhost_clear_queue_thread_unsafe(vdev, VIRTIO_RXQ); + vhost_clear_queue(vdev, VIRTIO_RXQ); rte_vhost_async_channel_unregister(vid, VIRTIO_RXQ); dma_bind[vid].dmas[VIRTIO_RXQ].async_enabled = false; } if (dma_bind[vid].dmas[VIRTIO_TXQ].async_enabled) { - vhost_clear_queue_thread_unsafe(vdev, VIRTIO_TXQ); + vhost_clear_queue(vdev, VIRTIO_TXQ); rte_vhost_async_channel_unregister(vid, VIRTIO_TXQ); dma_bind[vid].dmas[VIRTIO_TXQ].async_enabled = false; } @@ -1761,9 +1780,6 @@ vring_state_changed(int vid, uint16_t queue_id, int enable) if (!vdev) return -1; - if (queue_id != VIRTIO_RXQ) - return 0; - if (dma_bind[vid2socketid[vid]].dmas[queue_id].async_enabled) { if (!enable) vhost_clear_queue_thread_unsafe(vdev, queue_id); https://lab.dpdk.org/results/dashboard/patchsets/22237/ UNH-IOL DPDK Community Lab