From: David Marchand <david.marchand@redhat.com>
To: maxime.coquelin@redhat.com, dev@dpdk.org
Cc: bruce.richardson@intel.com, Chenbo Xia <chenbox@nvidia.com>
Subject: [PATCH v3 5/6] vhost: rename packed layout helpers for batches
Date: Fri, 2 Oct 2026 09:44:39 +0200 [thread overview]
Message-ID: <20261002074440.2551536-6-david.marchand@redhat.com> (raw)
In-Reply-To: <20261002074440.2551536-1-david.marchand@redhat.com>
Now that the async datapath has been removed, the _sync in function names
gives no useful information.
Besides, vhost_reserve_avail_batch_packed does not reserve anything and
its name is confusing, rename it following the other rx/tx split/packed
helpers convention.
Signed-off-by: David Marchand <david.marchand@redhat.com>
---
Changes since v2:
- cleaned up indent,
---
lib/vhost/virtio_net.c | 28 +++++++++-------------------
1 file changed, 9 insertions(+), 19 deletions(-)
diff --git a/lib/vhost/virtio_net.c b/lib/vhost/virtio_net.c
index 9ad7fa3295..3c9b4afb06 100644
--- a/lib/vhost/virtio_net.c
+++ b/lib/vhost/virtio_net.c
@@ -1111,11 +1111,8 @@ virtio_dev_rx_split(struct virtio_net *dev, struct vhost_virtqueue *vq,
}
static __rte_always_inline int
-virtio_dev_rx_sync_batch_check(struct virtio_net *dev,
- struct vhost_virtqueue *vq,
- struct rte_mbuf **pkts,
- uint64_t *desc_addrs,
- uint64_t *lens)
+virtio_dev_rx_batch_check(struct virtio_net *dev, struct vhost_virtqueue *vq,
+ struct rte_mbuf **pkts, uint64_t *desc_addrs, uint64_t *lens)
__rte_requires_shared_capability(&vq->iotlb_lock)
{
bool wrap_counter = vq->avail_wrap_counter;
@@ -1213,15 +1210,14 @@ virtio_dev_rx_batch_packed_copy(struct virtio_net *dev,
}
static __rte_always_inline int
-virtio_dev_rx_sync_batch_packed(struct virtio_net *dev,
- struct vhost_virtqueue *vq,
- struct rte_mbuf **pkts)
+virtio_dev_rx_batch_packed(struct virtio_net *dev, struct vhost_virtqueue *vq,
+ struct rte_mbuf **pkts)
__rte_requires_shared_capability(&vq->iotlb_lock)
{
uint64_t desc_addrs[PACKED_BATCH_SIZE];
uint64_t lens[PACKED_BATCH_SIZE];
- if (virtio_dev_rx_sync_batch_check(dev, vq, pkts, desc_addrs, lens) == -1)
+ if (virtio_dev_rx_batch_check(dev, vq, pkts, desc_addrs, lens) == -1)
return -1;
if (vq->shadow_used_idx) {
@@ -1273,8 +1269,7 @@ virtio_dev_rx_packed(struct virtio_net *dev,
rte_prefetch0(&vq->desc_packed[vq->last_avail_idx]);
if (count - pkt_idx >= PACKED_BATCH_SIZE) {
- if (!virtio_dev_rx_sync_batch_packed(dev, vq,
- &pkts[pkt_idx])) {
+ if (!virtio_dev_rx_batch_packed(dev, vq, &pkts[pkt_idx])) {
pkt_idx += PACKED_BATCH_SIZE;
continue;
}
@@ -1971,12 +1966,8 @@ virtio_dev_tx_split_compliant(struct virtio_net *dev,
}
static __rte_always_inline int
-vhost_reserve_avail_batch_packed(struct virtio_net *dev,
- struct vhost_virtqueue *vq,
- struct rte_mbuf **pkts,
- uint16_t avail_idx,
- uintptr_t *desc_addrs,
- uint16_t *ids)
+virtio_dev_tx_batch_packed_check(struct virtio_net *dev, struct vhost_virtqueue *vq,
+ struct rte_mbuf **pkts, uint16_t avail_idx, uintptr_t *desc_addrs, uint16_t *ids)
__rte_requires_shared_capability(&vq->iotlb_lock)
{
bool wrap = vq->avail_wrap_counter;
@@ -2055,8 +2046,7 @@ virtio_dev_tx_batch_packed(struct virtio_net *dev,
uint16_t ids[PACKED_BATCH_SIZE];
uint16_t i;
- if (vhost_reserve_avail_batch_packed(dev, vq, pkts, avail_idx,
- desc_addrs, ids))
+ if (virtio_dev_tx_batch_packed_check(dev, vq, pkts, avail_idx, desc_addrs, ids))
return -1;
vhost_for_each_try_unroll(i, 0, PACKED_BATCH_SIZE)
--
2.54.0
next prev parent reply other threads:[~2026-10-02 7:45 UTC|newest]
Thread overview: 32+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-07-23 15:31 [RFC 0/3] Drop vhost async (DMA-accelerated) datapath David Marchand
2026-07-23 15:31 ` [RFC 1/3] examples: stop using vhost async datapath David Marchand
2026-08-25 11:39 ` David Marchand
2026-07-23 15:31 ` [RFC 2/3] vhost: refuse " David Marchand
2026-07-23 15:31 ` [RFC 3/3] vhost: drop " David Marchand
2026-08-18 9:10 ` [RFC 0/3] Drop vhost async (DMA-accelerated) datapath Maxime Coquelin
2026-08-26 14:02 ` [PATCH 0/5] " David Marchand
2026-08-26 14:02 ` [PATCH 1/5] vhost: decouple guest pages population from async datapath David Marchand
2026-08-26 14:02 ` [PATCH 2/5] examples/vhost: stop using " David Marchand
2026-08-26 14:02 ` [PATCH 3/5] vhost: drop " David Marchand
2026-08-26 14:02 ` [PATCH 4/5] vhost: rename packed layout helpers for batches David Marchand
2026-08-26 14:02 ` [PATCH 5/5] vhost: simplify some descriptor handling David Marchand
2026-09-04 7:46 ` [PATCH v2 0/6] Drop vhost async (DMA-accelerated) datapath David Marchand
2026-09-04 7:46 ` [PATCH v2 1/6] vhost: decouple guest pages population from async datapath David Marchand
2026-09-29 7:45 ` Maxime Coquelin
2026-09-04 7:46 ` [PATCH v2 2/6] examples/vhost: stop using " David Marchand
2026-09-29 7:54 ` Maxime Coquelin
2026-09-04 7:46 ` [PATCH v2 3/6] examples/vdpa: remove dependency on PCI library David Marchand
2026-09-29 7:54 ` Maxime Coquelin
2026-09-04 7:46 ` [PATCH v2 4/6] vhost: drop async datapath David Marchand
2026-09-04 7:46 ` [PATCH v2 5/6] vhost: rename packed layout helpers for batches David Marchand
2026-09-04 7:46 ` [PATCH v2 6/6] vhost: simplify some descriptor handling David Marchand
2026-10-02 7:44 ` [PATCH v3 0/6] Drop vhost async (DMA-accelerated) datapath David Marchand
2026-10-02 7:44 ` [PATCH v3 1/6] vhost: decouple guest pages population from async datapath David Marchand
2026-10-02 7:44 ` [PATCH v3 2/6] examples/vhost: stop using " David Marchand
2026-10-02 7:44 ` [PATCH v3 3/6] examples/vdpa: remove dependency on PCI library David Marchand
2026-10-02 7:44 ` [PATCH v3 4/6] vhost: drop async datapath David Marchand
2026-10-05 19:07 ` Maxime Coquelin
2026-10-02 7:44 ` David Marchand [this message]
2026-10-05 19:14 ` [PATCH v3 5/6] vhost: rename packed layout helpers for batches Maxime Coquelin
2026-10-02 7:44 ` [PATCH v3 6/6] vhost: simplify some descriptor handling David Marchand
2026-10-05 19:24 ` Maxime Coquelin
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20261002074440.2551536-6-david.marchand@redhat.com \
--to=david.marchand@redhat.com \
--cc=bruce.richardson@intel.com \
--cc=chenbox@nvidia.com \
--cc=dev@dpdk.org \
--cc=maxime.coquelin@redhat.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox