Re: [RFC PATCH net-next v2 1/2] virtio-net: support zerocopy multi buffer XDP in mergeable

2025-06-02 Thread Jason Wang
On Thu, May 29, 2025 at 8:28 PM Bui Quang Minh wrote: > > On 5/29/25 12:59, Jason Wang wrote: > > On Wed, May 28, 2025 at 12:19 AM Bui Quang Minh > > wrote: > >> Currently, in zerocopy mode with mergeable receive buffer, virtio-net > >> does not support m

Re: [PATCH] virtio-mmio: Remove virtqueue list from mmio device

2025-05-28 Thread Jason Wang
d. > > While at it, fix the virtio_device_for_each_vq() macro to accept an > argument like "&vm_dev->vdev" (which currently fails to build). > > Signed-off-by: Viresh Kumar > --- Acked-by: Jason Wang Btw, virtio-vdpa may need the same optimization. Thanks

Re: [PATCH 1/3] virtio: Fix typo in register_virtio_device() doc comment

2025-05-28 Thread Jason Wang
error, the caller must call put_device on &@dev->dev (and not kfree), > * as another code path may have obtained a reference to @dev. > * > - * Returns: 0 on suceess, -error on failure > + * Returns: 0 on success, -error on failure > */ > int register_virtio_device(struct virtio_device *dev) > { > -- > 2.47.1 > Acked-by: Jason Wang Thanks

Re: [PATCH] virtio: document ENOSPC

2025-05-28 Thread Jason Wang
It indicates that some buffers are outstanding and > that > + * the operation can be retried after some buffers have been used. > */ > int virtqueue_add_sgs(struct virtqueue *_vq, > struct scatterlist *sgs[], > -- > MST > Acked-by: Jason Wang Thanks

Re: [RFC PATCH net-next v2 1/2] virtio-net: support zerocopy multi buffer XDP in mergeable

2025-05-28 Thread Jason Wang
On Wed, May 28, 2025 at 12:19 AM Bui Quang Minh wrote: > > Currently, in zerocopy mode with mergeable receive buffer, virtio-net > does not support multi buffer but a single buffer only. This commit adds > support for multi mergeable receive buffer in the zerocopy XDP path by > utilizing XDP buffe

Re: [PATCH V2 00/19] virtio_ring in order support

2025-05-28 Thread Jason Wang
On Wed, May 28, 2025 at 8:51 PM Michael S. Tsirkin wrote: > > On Wed, May 28, 2025 at 02:42:15PM +0800, Jason Wang wrote: > > Hello all: > > > > This sereis tries to implement the VIRTIO_F_IN_ORDER to > > virtio_ring. This is done by introducing virtqueue ops so

[PATCH V2 11/19] virtio_ring: switch to use vring_virtqueue for detach_unused_buf variants

2025-05-28 Thread Jason Wang
Those variants are used internally so let's switch to use vring_virtqueue as parameter to be consistent with other internal virtqueue helpers. Reviewed-by: Xuan Zhuo Signed-off-by: Jason Wang --- drivers/virtio/virtio_ring.c | 12 +--- 1 file changed, 5 insertions(+), 7 dele

[PATCH V2 10/19] virtio_ring: switch to use vring_virtqueue for disable_cb variants

2025-05-28 Thread Jason Wang
Those variants are used internally so let's switch to use vring_virtqueue as parameter to be consistent with other internal virtqueue helpers. Reviewed-by: Xuan Zhuo Signed-off-by: Jason Wang --- drivers/virtio/virtio_ring.c | 14 +- 1 file changed, 5 insertions(+), 9 dele

[PATCH V2 09/19] virtio_ring: use vring_virtqueue for enable_cb_delayed variants

2025-05-28 Thread Jason Wang
Those variants are used internally so let's switch to use vring_virtqueue as parameter to be consistent with other internal virtqueue helpers. Reviewed-by: Xuan Zhuo Signed-off-by: Jason Wang --- drivers/virtio/virtio_ring.c | 16 +++- 1 file changed, 7 insertions(+), 9 dele

[PATCH V2 01/19] virtio_ring: rename virtqueue_reinit_xxx to virtqueue_reset_xxx()

2025-05-28 Thread Jason Wang
To be consistent with virtqueue_reset(). Reviewed-by: Xuan Zhuo Signed-off-by: Jason Wang --- drivers/virtio/virtio_ring.c | 12 ++-- 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/drivers/virtio/virtio_ring.c b/drivers/virtio/virtio_ring.c index b784aab66867

[PATCH V2 07/19] virtio: switch to use vring_virtqueue for virtqueue_add variants

2025-05-28 Thread Jason Wang
Those variants are used internally so let's switch to use vring_virtqueue as parameter to be consistent with other internal virtqueue helpers. Reviewed-by: Xuan Zhuo Signed-off-by: Jason Wang --- drivers/virtio/virtio_ring.c | 16 +++- 1 file changed, 7 insertions(+), 9 dele

[PATCH V2 05/19] virtio_ring: switch to use vring_virtqueue for virtqueue_kick_prepare variants

2025-05-27 Thread Jason Wang
Those variants are used internally so let's switch to use vring_virtqueue as parameter to be consistent with other internal virtqueue helpers. Reviewed-by: Xuan Zhuo Signed-off-by: Jason Wang --- drivers/virtio/virtio_ring.c | 14 ++ 1 file changed, 6 insertions(+), 8 dele

[PATCH V2 06/19] virtio_ring: switch to use vring_virtqueue for virtqueue_add variants

2025-05-27 Thread Jason Wang
Those variants are used internally so let's switch to use vring_virtqueue as parameter to be consistent with other internal virtqueue helpers. Reviewed-by: Xuan Zhuo Signed-off-by: Jason Wang --- drivers/virtio/virtio_ring.c | 40 +--- 1 file change

[PATCH V2 18/19] virtio_ring: factor out split detaching logic

2025-05-27 Thread Jason Wang
This patch factors out the split core detaching logic that could be reused by in order feature into a dedicated function. Reviewed-by: Xuan Zhuo Signed-off-by: Jason Wang --- drivers/virtio/virtio_ring.c | 18 ++ 1 file changed, 14 insertions(+), 4 deletions(-) diff --git a

[PATCH V2 16/19] virtio_ring: factor out core logic for updating last_used_idx

2025-05-27 Thread Jason Wang
Factor out the core logic for updating last_used_idx to be reused by the packed in order implementation. Reviewed-by: Xuan Zhuo Signed-off-by: Jason Wang --- drivers/virtio/virtio_ring.c | 43 +--- 1 file changed, 25 insertions(+), 18 deletions(-) diff --git a

[PATCH V2 19/19] virtio_ring: add in order support

2025-05-27 Thread Jason Wang
% PPS improvements from 8.6 Mpps to 9.0 Mpps Signed-off-by: Jason Wang --- drivers/virtio/virtio_ring.c | 423 +-- 1 file changed, 402 insertions(+), 21 deletions(-) diff --git a/drivers/virtio/virtio_ring.c b/drivers/virtio/virtio_ring.c index 27a9459a0555

[PATCH V2 17/19] virtio_ring: factor out split indirect detaching logic

2025-05-27 Thread Jason Wang
Factor out the split indirect descriptor detaching logic in order to make it be reused by the in order support. Reviewed-by: Xuan Zhuo Signed-off-by: Jason Wang --- drivers/virtio/virtio_ring.c | 63 1 file changed, 35 insertions(+), 28 deletions(-) diff

[PATCH V2 14/19] virtio_ring: determine descriptor flags at one time

2025-05-27 Thread Jason Wang
Let's determine the last descriptor by counting the number of sg. This would be consistent with packed virtqueue implementation and ease the future in-order implementation. Reviewed-by: Xuan Zhuo Signed-off-by: Jason Wang --- drivers/virtio/virtio_ring.c | 25 + 1

[PATCH V2 13/19] virtio_ring: introduce virtqueue ops

2025-05-27 Thread Jason Wang
uses global array of const ops to allow compiler to avoid indirect branches. Tested with CONFIG_MITIGATION_RETPOLINE, no performance differences were noticed. Suggested-by: Michael S. Tsirkin Signed-off-by: Jason Wang --- drivers/virtio/virtio_ring.c | 172 ++- 1

[PATCH V2 15/19] virtio_ring: factor out core logic of buffer detaching

2025-05-27 Thread Jason Wang
Factor out core logic of buffer detaching and leave the id population to the caller so in order can just call the core logic. Reviewed-by: Xuan Zhuo Signed-off-by: Jason Wang --- drivers/virtio/virtio_ring.c | 17 + 1 file changed, 13 insertions(+), 4 deletions(-) diff --git a

[PATCH V2 12/19] virtio_ring: use u16 for last_used_idx in virtqueue_poll_split()

2025-05-27 Thread Jason Wang
Use u16 for last_used_idx in virtqueue_poll_split() to align with the spec. Reviewed-by: Xuan Zhuo Signed-off-by: Jason Wang --- drivers/virtio/virtio_ring.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/virtio/virtio_ring.c b/drivers/virtio/virtio_ring.c index

[PATCH V2 08/19] virtio_ring: switch to use vring_virtqueue for enable_cb_prepare variants

2025-05-27 Thread Jason Wang
Those variants are used internally so let's switch to use vring_virtqueue as parameter to be consistent with other internal virtqueue helpers. Reviewed-by: Xuan Zhuo Signed-off-by: Jason Wang --- drivers/virtio/virtio_ring.c | 15 ++- 1 file changed, 6 insertions(+), 9 dele

[PATCH V2 03/19] virtio_ring: unify logic of virtqueue_poll() and more_used()

2025-05-27 Thread Jason Wang
This patch unifies the logic of virtqueue_poll() and more_used() for better code reusing and ease the future in order implementation. Reviewed-by: Xuan Zhuo Signed-off-by: Jason Wang --- drivers/virtio/virtio_ring.c | 48 +++- 1 file changed, 20 insertions

[PATCH V2 04/19] virtio_ring: switch to use vring_virtqueue for virtqueue resize variants

2025-05-27 Thread Jason Wang
Those variants are used internally so let's switch to use vring_virtqueue as parameter to be consistent with other internal virtqueue helpers. Reviewed-by: Xuan Zhuo Signed-off-by: Jason Wang --- drivers/virtio/virtio_ring.c | 14 ++ 1 file changed, 6 insertions(+), 8 dele

[PATCH V2 02/19] virtio_ring: switch to use vring_virtqueue in virtqueue_poll variants

2025-05-27 Thread Jason Wang
Those variants are used internally so let's switch to use vring_virtqueue as parameter to be consistent with other internal virtqueue helpers. Reviewed-by: Xuan Zhuo Signed-off-by: Jason Wang --- drivers/virtio/virtio_ring.c | 14 ++ 1 file changed, 6 insertions(+), 8 dele

[PATCH V2 00/19] virtio_ring in order support

2025-05-27 Thread Jason Wang
with KVM guest testpmd on the host. Changes since V1: - use const global array of function pointers to avoid indirect branches to eliminate retpoline when mitigation is enabled - fix used length calculation when processing used ids in a batch - fix sparse warnings Please review. Thanks Jason

Re: [PATCH 13/19] virtio_ring: introduce virtqueue ops

2025-05-19 Thread Jason Wang
On Fri, May 16, 2025 at 6:35 PM Michael S. Tsirkin wrote: > > On Fri, May 16, 2025 at 09:30:01AM +0800, Jason Wang wrote: > > On Wed, May 14, 2025 at 10:24 PM Michael S. Tsirkin wrote: > > > > > > On Wed, May 14, 2025 at 10:19:05AM -0400, Michael S. Tsirkin wrote: &

Re: [PATCH v9 4/4] vhost: Add a KConfig knob to enable IOCTL VHOST_FORK_FROM_OWNER

2025-05-19 Thread Jason Wang
On Fri, May 16, 2025 at 6:39 PM Michael S. Tsirkin wrote: > > On Fri, May 16, 2025 at 09:31:42AM +0800, Jason Wang wrote: > > On Thu, May 15, 2025 at 2:14 PM Michael S. Tsirkin wrote: > > > > > > On Wed, May 14, 2025 at 10:52:58AM +0800, Jason Wang wrote: > >

Re: [PATCH 13/19] virtio_ring: introduce virtqueue ops

2025-05-15 Thread Jason Wang
On Wed, May 14, 2025 at 10:24 PM Michael S. Tsirkin wrote: > > On Wed, May 14, 2025 at 10:19:05AM -0400, Michael S. Tsirkin wrote: > > On Wed, Apr 09, 2025 at 12:06:03PM +0800, Jason Wang wrote: > > > On Tue, Apr 8, 2025 at 7:37 PM Michael S. Tsirkin wrote: > > >

Re: [PATCH v9 4/4] vhost: Add a KConfig knob to enable IOCTL VHOST_FORK_FROM_OWNER

2025-05-15 Thread Jason Wang
On Thu, May 15, 2025 at 2:14 PM Michael S. Tsirkin wrote: > > On Wed, May 14, 2025 at 10:52:58AM +0800, Jason Wang wrote: > > On Tue, May 13, 2025 at 3:09 PM Michael S. Tsirkin wrote: > > > > > > On Tue, May 13, 2025 at 12:08:51PM +0800, Jason Wang wrote: > >

Re: [PATCH v3] virtio: reject shm region if length is zero

2025-05-13 Thread Jason Wang
o_shm_region *region, u8 id) > { > + if (!region->len) > + return false; > if (!vdev->config->get_shm_region) > return false; > return vdev->config->get_shm_region(vdev, region, id); > -- > 2.34.1 > Acked-by: Jason Wang Thanks

Re: [PATCH] vhost/net: remove zerocopy support

2025-05-13 Thread Jason Wang
---| > > CAUTION: External Email > > > > |---! > > > > On Tue, Apr 8, 2025 at 8:28 AM Jason Wang wrote: > >> > >> On Tue, Apr 8, 2025 at 9:18 AM Jon Kohler wrote: > >>> > >>> > >>> > >>>> On Apr 6, 202

Re: [PATCH v9 4/4] vhost: Add a KConfig knob to enable IOCTL VHOST_FORK_FROM_OWNER

2025-05-13 Thread Jason Wang
On Tue, May 13, 2025 at 3:09 PM Michael S. Tsirkin wrote: > > On Tue, May 13, 2025 at 12:08:51PM +0800, Jason Wang wrote: > > On Wed, Apr 30, 2025 at 5:27 PM Michael S. Tsirkin wrote: > > > > > > On Wed, Apr 30, 2025 at 11:34:49AM +0800, Jason Wang wrote: > >

Re: [PATCH v9 4/4] vhost: Add a KConfig knob to enable IOCTL VHOST_FORK_FROM_OWNER

2025-05-12 Thread Jason Wang
On Wed, Apr 30, 2025 at 5:27 PM Michael S. Tsirkin wrote: > > On Wed, Apr 30, 2025 at 11:34:49AM +0800, Jason Wang wrote: > > On Tue, Apr 29, 2025 at 6:56 PM Michael S. Tsirkin wrote: > > > > > > On Tue, Apr 29, 2025 at 11:39:37AM +0800, Jason Wang wrote: > >

Re: [PATCH v9 4/4] vhost: Add a KConfig knob to enable IOCTL VHOST_FORK_FROM_OWNER

2025-04-29 Thread Jason Wang
On Tue, Apr 29, 2025 at 6:56 PM Michael S. Tsirkin wrote: > > On Tue, Apr 29, 2025 at 11:39:37AM +0800, Jason Wang wrote: > > On Mon, Apr 21, 2025 at 11:46 AM Jason Wang wrote: > > > > > > On Mon, Apr 21, 2025 at 11:45 AM Jason Wang wrote: > > > > >

Re: [PATCH v9 4/4] vhost: Add a KConfig knob to enable IOCTL VHOST_FORK_FROM_OWNER

2025-04-28 Thread Jason Wang
On Mon, Apr 21, 2025 at 11:46 AM Jason Wang wrote: > > On Mon, Apr 21, 2025 at 11:45 AM Jason Wang wrote: > > > > On Mon, Apr 21, 2025 at 10:45 AM Cindy Lu wrote: > > > > > > Introduce a new config knob `CONFIG_VHOST_ENABLE_FORK_OWNER_IOCTL`, >

Re: [PATCH v9 4/4] vhost: Add a KConfig knob to enable IOCTL VHOST_FORK_FROM_OWNER

2025-04-20 Thread Jason Wang
On Mon, Apr 21, 2025 at 11:45 AM Jason Wang wrote: > > On Mon, Apr 21, 2025 at 10:45 AM Cindy Lu wrote: > > > > Introduce a new config knob `CONFIG_VHOST_ENABLE_FORK_OWNER_IOCTL`, > > to control the availability of the `VHOST_FORK_FROM_OWNER` ioctl. > > When CONFIG

Re: [PATCH v9 4/4] vhost: Add a KConfig knob to enable IOCTL VHOST_FORK_FROM_OWNER

2025-04-20 Thread Jason Wang
On Mon, Apr 21, 2025 at 10:45 AM Cindy Lu wrote: > > Introduce a new config knob `CONFIG_VHOST_ENABLE_FORK_OWNER_IOCTL`, > to control the availability of the `VHOST_FORK_FROM_OWNER` ioctl. > When CONFIG_VHOST_ENABLE_FORK_OWNER_IOCTL is set to n, the ioctl > is disabled, and any attempt to use it w

Re: [PATCH v9 3/4] vhost: add VHOST_FORK_FROM_OWNER ioctl and validate inherit_owner

2025-04-20 Thread Jason Wang
VHOST_SET_OWNER, as the worker > will be created in the VHOST_SET_OWNER function. > > In addition, the VHOST_NEW_WORKER requires the inherit_owner > setting to be true. So we need to add a check for this. > > Signed-off-by: Cindy Lu Acked-by: Jason Wang Thanks

Re: [PATCH v9 2/4] vhost: Reintroduce kthread mode support in vhost

2025-04-20 Thread Jason Wang
On Mon, Apr 21, 2025 at 10:45 AM Cindy Lu wrote: > > This patch reintroduces kthread mode support in vhost, > It also introduces struct vhost_worker_ops to abstract > worker create/stop/wakeup operations. > > * Bring back the original vhost_worker() implementation, > and renamed to vhost_run_wor

Re: [PATCH v9 1/4] vhost: Add a new parameter in vhost_dev to allow user select kthread

2025-04-20 Thread Jason Wang
gt; API support. > > Introduce a new parameter to enable users to choose between kthread and > task mode. > > By default, this parameter is set to true, so the default behavior > remains unchanged by this patch. > > Signed-off-by: Cindy Lu Acked-by: Jason Wang Thanks

Re: [PATCH v3 4/9] vhost: modify vhost_log_write() for broader users

2025-04-20 Thread Jason Wang
all pages of > vring descriptors, or only pages that are tainted by the driver. > > In addition, removes BUG(). > > Suggested-by: Joao Martins > Signed-off-by: Dongli Zhang Acked-by: Jason Wang Thanks

Re: [PATCH v4 1/4] virtio-net: disable delayed refill when pausing rx

2025-04-20 Thread Jason Wang
fixes up the > virtnet_rx_resume to disable future and cancel all inflights delayed > refill_work before calling napi_disable() to pause the rx. > > Fixes: 413f0271f396 ("net: protect NAPI enablement with netdev_lock()") > Acked-by: Michael S. Tsirkin > Signed-off-by: Bu

Re: [PATCH v3 3/3] selftests: net: add a virtio_net deadlock selftest

2025-04-16 Thread Jason Wang
On Wed, Apr 16, 2025 at 2:54 PM Bui Quang Minh wrote: > > On 4/16/25 11:27, Jakub Kicinski wrote: > > On Tue, 15 Apr 2025 14:43:41 +0700 Bui Quang Minh wrote: > >> +def setup_xsk(cfg, xdp_queue_id = 0) -> bkg: > >> +# Probe for support > >> +xdp = cmd(f'{cfg.net_lib_dir / "xdp_helper"} - -

Re: [PATCH 13/19] virtio_ring: introduce virtqueue ops

2025-04-08 Thread Jason Wang
On Tue, Apr 8, 2025 at 7:37 PM Michael S. Tsirkin wrote: > > On Tue, Apr 08, 2025 at 03:02:35PM +0800, Jason Wang wrote: > > On Mon, Apr 7, 2025 at 4:20 PM Michael S. Tsirkin wrote: > > > > > > On Mon, Mar 24, 2025 at 02:01:21PM +0800, Jason Wang wrote: > >

Re: [PATCH] vhost/net: remove zerocopy support

2025-04-08 Thread Jason Wang
On Tue, Apr 8, 2025 at 9:18 AM Jon Kohler wrote: > > > > > On Apr 6, 2025, at 7:14 PM, Jason Wang wrote: > > > > !---| &

Re: [PATCH 13/19] virtio_ring: introduce virtqueue ops

2025-04-08 Thread Jason Wang
On Mon, Apr 7, 2025 at 4:20 PM Michael S. Tsirkin wrote: > > On Mon, Mar 24, 2025 at 02:01:21PM +0800, Jason Wang wrote: > > This patch introduces virtqueue ops which is a set of the callbacks > > that will be called for different queue layout or features. This would > >

Re: [PATCH] virtio-net: disable delayed refill when pausing rx

2025-04-08 Thread Jason Wang
On Mon, Apr 7, 2025 at 10:27 AM Bui Quang Minh wrote: > > On 4/7/25 08:03, Xuan Zhuo wrote: > > On Fri, 4 Apr 2025 16:39:03 +0700, Bui Quang Minh > > wrote: > >> When pausing rx (e.g. set up xdp, xsk pool, rx resize), we call > >> napi_disable() on the receive queue's napi. In delayed refill_wo

Re: [PATCH] vhost/net: Defer TX queue re-enable until after sendmsg

2025-04-06 Thread Jason Wang
Datagrams/second: ~650k (~1.7x increase) > Interval Transfer Bitrate Lost/Total Datagrams > 0.00-30.00 sec 26.4 GBytes 7.55 Gbits/sec 0/19554720 (0%) sender > > Signed-off-by: Jon Kohler Acked-by: Jason Wang Thanks

Re: [PATCH] vhost/net: remove zerocopy support

2025-04-06 Thread Jason Wang
On Fri, Apr 4, 2025 at 10:24 PM Jon Kohler wrote: > > Commit 098eadce3c62 ("vhost_net: disable zerocopy by default") disabled > the module parameter for the handle_tx_zerocopy path back in 2019, > nothing that many downstream distributions (e.g., RHEL7 and later) had > already done the same. > > B

[PATCH 18/19] virtio_ring: factor out split indirect detaching logic

2025-03-24 Thread Jason Wang
Factor out the split indirect descriptor detaching logic in order to make it be reused by the in order support. Signed-off-by: Jason Wang --- drivers/virtio/virtio_ring.c | 63 1 file changed, 35 insertions(+), 28 deletions(-) diff --git a/drivers/virtio

Re: [PATCH net-next 3/4] virtio_net: Use new RSS config structs

2025-03-23 Thread Jason Wang
On Fri, Mar 21, 2025 at 2:35 PM Akihiko Odaki wrote: > > On 2025/03/21 9:35, Jason Wang wrote: > > On Thu, Mar 20, 2025 at 1:36 PM Akihiko Odaki > > wrote: > >> > >> On 2025/03/20 10:50, Jason Wang wrote: > >>> On Wed, Mar 19, 2025 at 12:48 PM Ak

[PATCH 11/19] virtio_ring: switch to use vring_virtqueue for detach_unused_buf variants

2025-03-23 Thread Jason Wang
Those variants are used internally so let's switch to use vring_virtqueue as parameter to be consistent with other internal virtqueue helpers. Signed-off-by: Jason Wang --- drivers/virtio/virtio_ring.c | 12 +--- 1 file changed, 5 insertions(+), 7 deletions(-) diff --git a/dr

[PATCH 19/19] virtio_ring: add in order support

2025-03-23 Thread Jason Wang
PPS. No obvious changes in other test cases. Signed-off-by: Jason Wang --- drivers/virtio/virtio_ring.c | 451 +-- 1 file changed, 434 insertions(+), 17 deletions(-) diff --git a/drivers/virtio/virtio_ring.c b/drivers/virtio/virtio_ring.c index 0fad8e8419c8

[PATCH 16/19] virtio_ring: factor out core logic for updating last_used_idx

2025-03-23 Thread Jason Wang
Factor out the core logic for updating last_used_idx to be reused by the packed in order implementation. Signed-off-by: Jason Wang --- drivers/virtio/virtio_ring.c | 43 +--- 1 file changed, 25 insertions(+), 18 deletions(-) diff --git a/drivers/virtio

[PATCH 17/19] virtio_ring: move next_avail_idx to vring_virtqueue

2025-03-23 Thread Jason Wang
This variable is used by packed virtqueue now, moving it to vring_virtqueue to make it possible to be reused by split virtqueue in-order implementation. Signed-off-by: Jason Wang --- drivers/virtio/virtio_ring.c | 22 +++--- 1 file changed, 11 insertions(+), 11 deletions

[PATCH 14/19] virtio_ring: determine descriptor flags at one time

2025-03-23 Thread Jason Wang
Let's determine the last descriptor by counting the number of sg. This would be consistent with packed virtqueue implementation and ease the future in-order implementation. Signed-off-by: Jason Wang --- drivers/virtio/virtio_ring.c | 25 + 1 file changed, 13 inser

[PATCH 15/19] virtio_ring: factor out core logic of buffer detaching

2025-03-23 Thread Jason Wang
Factor out core logic of buffer detaching and leave the id population to the caller so in order can just call the core logic. Signed-off-by: Jason Wang --- drivers/virtio/virtio_ring.c | 17 + 1 file changed, 13 insertions(+), 4 deletions(-) diff --git a/drivers/virtio

[PATCH 13/19] virtio_ring: introduce virtqueue ops

2025-03-23 Thread Jason Wang
This patch introduces virtqueue ops which is a set of the callbacks that will be called for different queue layout or features. This would help to avoid branches for split/packed and will ease the future implementation like in order. Signed-off-by: Jason Wang --- drivers/virtio/virtio_ring.c

[PATCH 12/19] virtio_ring: use u16 for last_used_idx in virtqueue_poll_split()

2025-03-23 Thread Jason Wang
Use u16 for last_used_idx in virtqueue_poll_split() to align with the spec. Signed-off-by: Jason Wang --- drivers/virtio/virtio_ring.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/virtio/virtio_ring.c b/drivers/virtio/virtio_ring.c index 19aa24d62d20..a2884eae14d9

[PATCH 08/19] virtio_ring: switch to use vring_virtqueue for enable_cb_prepare variants

2025-03-23 Thread Jason Wang
Those variants are used internally so let's switch to use vring_virtqueue as parameter to be consistent with other internal virtqueue helpers. Signed-off-by: Jason Wang --- drivers/virtio/virtio_ring.c | 15 ++- 1 file changed, 6 insertions(+), 9 deletions(-) diff --git a/dr

[PATCH 05/19] virtio_ring: switch to use vring_virtqueue for virtqueue_kick_prepare variants

2025-03-23 Thread Jason Wang
Those variants are used internally so let's switch to use vring_virtqueue as parameter to be consistent with other internal virtqueue helpers. Signed-off-by: Jason Wang --- drivers/virtio/virtio_ring.c | 14 ++ 1 file changed, 6 insertions(+), 8 deletions(-) diff --git a/dr

[PATCH 10/19] virtio_ring: switch to use vring_virtqueue for disable_cb variants

2025-03-23 Thread Jason Wang
Those variants are used internally so let's switch to use vring_virtqueue as parameter to be consistent with other internal virtqueue helpers. Signed-off-by: Jason Wang --- drivers/virtio/virtio_ring.c | 14 +- 1 file changed, 5 insertions(+), 9 deletions(-) diff --git a/dr

[PATCH 09/19] virtio_ring: use vring_virtqueue for enable_cb_delayed variants

2025-03-23 Thread Jason Wang
Those variants are used internally so let's switch to use vring_virtqueue as parameter to be consistent with other internal virtqueue helpers. Signed-off-by: Jason Wang --- drivers/virtio/virtio_ring.c | 16 +++- 1 file changed, 7 insertions(+), 9 deletions(-) diff --git a/dr

[PATCH 07/19] virtio: switch to use vring_virtqueue for virtqueue_add variants

2025-03-23 Thread Jason Wang
Those variants are used internally so let's switch to use vring_virtqueue as parameter to be consistent with other internal virtqueue helpers. Signed-off-by: Jason Wang --- drivers/virtio/virtio_ring.c | 16 +++- 1 file changed, 7 insertions(+), 9 deletions(-) diff --git a/dr

[PATCH 06/19] virtio_ring: switch to use vring_virtqueue for virtqueue_add variants

2025-03-23 Thread Jason Wang
Those variants are used internally so let's switch to use vring_virtqueue as parameter to be consistent with other internal virtqueue helpers. Signed-off-by: Jason Wang --- drivers/virtio/virtio_ring.c | 40 +--- 1 file changed, 19 insertions(+), 21 dele

[PATCH 04/19] virtio_ring: switch to use vring_virtqueue for virtqueue resize variants

2025-03-23 Thread Jason Wang
Those variants are used internally so let's switch to use vring_virtqueue as parameter to be consistent with other internal virtqueue helpers. Signed-off-by: Jason Wang --- drivers/virtio/virtio_ring.c | 14 ++ 1 file changed, 6 insertions(+), 8 deletions(-) diff --git a/dr

[PATCH 02/19] virtio_ring: switch to use vring_virtqueue in virtqueue_poll variants

2025-03-23 Thread Jason Wang
Those variants are used internally so let's switch to use vring_virtqueue as parameter to be consistent with other internal virtqueue helpers. Signed-off-by: Jason Wang --- drivers/virtio/virtio_ring.c | 14 ++ 1 file changed, 6 insertions(+), 8 deletions(-) diff --git a/dr

[PATCH 03/19] virtio_ring: unify logic of virtqueue_poll() and more_used()

2025-03-23 Thread Jason Wang
This patch unifies the logic of virtqueue_poll() and more_used() for better code reusing and ease the future in order implementation. Signed-off-by: Jason Wang --- drivers/virtio/virtio_ring.c | 48 +++- 1 file changed, 20 insertions(+), 28 deletions(-) diff

[PATCH 01/19] virtio_ring: rename virtqueue_reinit_xxx to virtqueue_reset_xxx()

2025-03-23 Thread Jason Wang
To be consistent with virtqueue_reset(). Signed-off-by: Jason Wang --- drivers/virtio/virtio_ring.c | 12 ++-- 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/drivers/virtio/virtio_ring.c b/drivers/virtio/virtio_ring.c index fdd2d2b07b5a..1bdfd5d617a7 100644 --- a/drivers

[PATCH 00/19] virtio_ring in order support

2025-03-23 Thread Jason Wang
+ testpmd on the host. Please review. Thanks Jason Wang (19): virtio_ring: rename virtqueue_reinit_xxx to virtqueue_reset_xxx() virtio_ring: switch to use vring_virtqueue in virtqueue_poll variants virtio_ring: unify logic of virtqueue_poll() and more_used() virtio_ring: switch to use

Re: [PATCH net-next v2 3/4] virtio_net: Use new RSS config structs

2025-03-23 Thread Jason Wang
Lei Yang > Acked-by: Michael S. Tsirkin > --- > drivers/net/virtio_net.c | 117 > +-- > 1 file changed, 43 insertions(+), 74 deletions(-) > Though I still think hash config should use a separate helper, it could be done in the future. So Acked-by: Jason Wang Thanks

Re: [PATCH net-next 3/4] virtio_net: Use new RSS config structs

2025-03-21 Thread Jason Wang
On Thu, Mar 20, 2025 at 1:36 PM Akihiko Odaki wrote: > > On 2025/03/20 10:50, Jason Wang wrote: > > On Wed, Mar 19, 2025 at 12:48 PM Akihiko Odaki > > wrote: > >> > >> On 2025/03/19 10:43, Jason Wang wrote: > >>> On Tue, Mar 18, 2025 at 5:57 PM Ak

Re: [PATCH net-next 3/4] virtio_net: Use new RSS config structs

2025-03-19 Thread Jason Wang
On Wed, Mar 19, 2025 at 12:48 PM Akihiko Odaki wrote: > > On 2025/03/19 10:43, Jason Wang wrote: > > On Tue, Mar 18, 2025 at 5:57 PM Akihiko Odaki > > wrote: > >> > >> The new RSS configuration structures allow easily constructing data for > >> V

Re: [PATCH v2 03/10] vhost-scsi: Fix vhost_scsi_send_status()

2025-03-19 Thread Jason Wang
On Thu, Mar 20, 2025 at 1:54 AM Dongli Zhang wrote: > > Hi Jason, > > On 3/17/25 5:48 PM, Jason Wang wrote: > > On Tue, Mar 18, 2025 at 7:52 AM Dongli Zhang > > wrote: > >> > >> Although the support of VIRTIO_F_ANY_LAYOUT + VIRTIO_F_VERSION_1 was > &

Re: [PATCH v2 04/10] vhost: modify vhost_log_write() for broader users

2025-03-19 Thread Jason Wang
On Thu, Mar 20, 2025 at 12:38 AM Dongli Zhang wrote: > > Hi Jason, > > On 3/17/25 6:12 PM, Jason Wang wrote: > > On Tue, Mar 18, 2025 at 7:51 AM Dongli Zhang > > wrote: > >> > >> Currently, the only user of vhost_log_write() is vhost-net. The 'le

Re: [PATCH net-next 4/4] virtio_net: Allocate rss_hdr with devres

2025-03-18 Thread Jason Wang
ze") > Signed-off-by: Akihiko Odaki > --- > drivers/net/virtio_net.c | 10 -- > 1 file changed, 4 insertions(+), 6 deletions(-) Acked-by: Jason Wang Thanks

Re: [PATCH net-next 3/4] virtio_net: Use new RSS config structs

2025-03-18 Thread Jason Wang
On Tue, Mar 18, 2025 at 5:57 PM Akihiko Odaki wrote: > > The new RSS configuration structures allow easily constructing data for > VIRTIO_NET_CTRL_MQ_RSS_CONFIG as they strictly follow the order of data > for the command. > > Signed-off-by: Akihiko Odaki > --- > drivers/net/virtio_net.c | 117 >

Re: [PATCH net-next 2/4] virtio_net: Fix endian with virtio_net_ctrl_rss

2025-03-18 Thread Jason Wang
Signed-off-by: Akihiko Odaki Acked-by: Jason Wang Thanks

Re: [PATCH net-next 1/4] virtio_net: Split struct virtio_net_rss_config

2025-03-18 Thread Jason Wang
On Tue, Mar 18, 2025 at 5:57 PM Akihiko Odaki wrote: > > struct virtio_net_rss_config was less useful in actual code because of a > flexible array placed in the middle. Add new structures that split it > into two to avoid having a flexible array in the middle. > > Sugges

Re: [PATCH v2 04/10] vhost: modify vhost_log_write() for broader users

2025-03-17 Thread Jason Wang
On Tue, Mar 18, 2025 at 7:51 AM Dongli Zhang wrote: > > Currently, the only user of vhost_log_write() is vhost-net. The 'len' > argument prevents logging of pages that are not tainted by the RX path. > > Adjustments are needed since more drivers (i.e. vhost-scsi) begin using > vhost_log_write(). S

Re: [PATCH v2 02/10] vhost-scsi: Fix vhost_scsi_send_bad_target()

2025-03-17 Thread Jason Wang
vhost/scsi.c | 48 ++++++------ > 1 file changed, 37 insertions(+), 11 deletions(-) > Acked-by: Jason Wang Thanks

Re: [PATCH v2 03/10] vhost-scsi: Fix vhost_scsi_send_status()

2025-03-17 Thread Jason Wang
csi *vs, struct > vhost_virtqueue *vq) > else if (ret == -EIO) > vhost_scsi_send_bad_target(vs, vq, &vc, TYPE_IO_CMD); > else if (ret == -ENOMEM) > - vhost_scsi_send_status(vs, vq, vc.head, vc.out, > + vhost_scsi_send_status(vs, vq, &vc, >SAM_STAT_TASK_SET_FULL); > } while (likely(!vhost_exceeds_weight(vq, ++c, 0))); > out: > -- > 2.39.3 > Acked-by: Jason Wang Thanks

Re: [PATCH v2 01/10] vhost-scsi: protect vq->log_used with vq->mutex

2025-03-17 Thread Jason Wang
; Assuming the VMM is QEMU. The vq->log_base is from QEMU userpace and can be > reclaimed via gfree(). As a result, this causes invalid memory writes to > QEMU userspace. > > The control queue path has the same issue. > > Signed-off-by: Dongli Zhang > --- Acked-by: Jason Wang Thanks

Re: [PATCH v2] virtio_ring: Fix data race by tagging event_triggered as racy for KCSAN

2025-03-16 Thread Jason Wang
ng_virtqueue *vq = to_vvq(_vq); > > if (vq->event_triggered) > - vq->event_triggered = false; > + data_race(vq->event_triggered = false); > > return vq->packed_ring ? virtqueue_enable_cb_delayed_packed(_vq) : > virtqueue_enable_cb_delayed_split(_vq); > -- > 2.25.1 > Acked-by: Jason Wang Thanks

Re: [PATCH v5] can: virtio: Initial virtio CAN driver.

2025-03-12 Thread Jason Wang
On Wed, Mar 12, 2025 at 9:36 PM Marc Kleine-Budde wrote: > > On 12.03.2025 14:28:10, Matias Ezequiel Vara Larsen wrote: > > On Wed, Mar 12, 2025 at 11:41:26AM +0100, Marc Kleine-Budde wrote: > > > On 12.03.2025 11:31:12, Matias Ezequiel Vara Larsen wrote: > > > > On Thu, Feb 01, 2024 at 07:57:45PM

Re: [PATCH] virtio_ring: Fix data race when accessing the event_triggered field of vring_virtqueue

2025-03-11 Thread Jason Wang
On Tue, Mar 11, 2025 at 9:18 PM Zhongqiu Han wrote: > > Syzkaller reports a data-race when accessing the event_triggered field of > vring_virtqueue in virtqueue_disable_cb / virtqueue_enable_cb_delayed. > Here is the simplified stack when the issue occurred: > > ===

Re: [PATCH v7 8/8] vhost: Add a KConfig knob to enable IOCTL VHOST_FORK_FROM_OWNER

2025-03-09 Thread Jason Wang
On Tue, Mar 4, 2025 at 1:33 AM Michael S. Tsirkin wrote: > > On Mon, Mar 03, 2025 at 01:52:06PM +0800, Jason Wang wrote: > > On Sun, Mar 2, 2025 at 10:34 PM Cindy Lu wrote: > > > > > > Introduce a new config knob `CONFIG_VHOST_ENABLE_FORK_OWNER_IOCTL`, > >

Re: [PATCH net-next v6 3/4] virtio-net: Map NAPIs to queues

2025-03-09 Thread Jason Wang
7;id': 0, 'ifindex': 2, 'type': 'tx'}, > {'id': 1, 'ifindex': 2, 'type': 'tx'}, > {'id': 2, 'ifindex': 2, 'type': 'tx'}, > {'id': 3, 'ifindex': 2, 'type': 'tx'}] > > Note that virtio_net has TX-only NAPIs which do not have NAPI IDs, so > the lack of 'napi-id' in the above output is expected. > > Signed-off-by: Joe Damato > --- Acked-by: Jason Wang Thanks

Re: [PATCH net-next v5 3/4] virtio-net: Map NAPIs to queues

2025-03-05 Thread Jason Wang
On Thu, Mar 6, 2025 at 12:34 AM Joe Damato wrote: > > On Wed, Mar 05, 2025 at 01:11:55PM +0800, Jason Wang wrote: > > On Tue, Mar 4, 2025 at 11:09 PM Joe Damato wrote: > > > > > > On Mon, Mar 03, 2025 at 04:03:55PM -0800, Jakub Kicinski wrote: > > > > On

Re: [PATCH net-next v5 3/4] virtio-net: Map NAPIs to queues

2025-03-04 Thread Jason Wang
On Tue, Mar 4, 2025 at 11:09 PM Joe Damato wrote: > > On Mon, Mar 03, 2025 at 04:03:55PM -0800, Jakub Kicinski wrote: > > On Mon, 3 Mar 2025 13:33:10 -0500 Joe Damato wrote: > > > > > @@ -2880,6 +2880,13 @@ static void refill_work(struct work_struct > > > > > *work) > > > > > bool still_e

Re: [PATCH] vduse: add virtio_fs to allowed dev id

2025-03-04 Thread Jason Wang
On Tue, Feb 25, 2025 at 8:31 PM Michael S. Tsirkin wrote: > > On Tue, Feb 25, 2025 at 01:17:02PM +0100, Eugenio Perez Martin wrote: > > On Mon, Feb 24, 2025 at 10:51 PM Michael S. Tsirkin wrote: > > > > > > On Tue, Jan 21, 2025 at 11:33:46AM +0100, Eugenio Pérez wrote: > > > > A VDUSE device that

Re: [PATCH] vhost: fix VHOST_*_OWNER documentation

2025-03-04 Thread Jason Wang
> > To avoid confusion, let's use the right names in the documentation. > > No change to the API, only the documentation is involved. > > > > Reviewed-by: Eugenio Pérez > Acked-by: Jason Wang Thanks

Re: [PATCH v7 8/8] vhost: Add a KConfig knob to enable IOCTL VHOST_FORK_FROM_OWNER

2025-03-02 Thread Jason Wang
On Sun, Mar 2, 2025 at 10:34 PM Cindy Lu wrote: > > Introduce a new config knob `CONFIG_VHOST_ENABLE_FORK_OWNER_IOCTL`, > to control the availability of the `VHOST_FORK_FROM_OWNER` ioctl. > When CONFIG_VHOST_ENABLE_FORK_OWNER_IOCTL is set to n, the ioctl > is disabled, and any attempt to use it wi

Re: [PATCH net-next v5 3/4] virtio-net: Map NAPIs to queues

2025-02-28 Thread Jason Wang
': 8292, 'type': 'rx'}, > {'id': 0, 'ifindex': 2, 'type': 'tx'}, > {'id': 1, 'ifindex': 2, 'type': 'tx'}, > {'id': 2, 'ifindex': 2, 'type': 'tx'}, > {'id': 3, 'ifindex': 2, 'type': 'tx'}] > > Note that virtio_net has TX-only NAPIs which do not have NAPI IDs, so > the lack of 'napi-id' in the above output is expected. > > Signed-off-by: Joe Damato > --- Acked-by: Jason Wang Thanks

Re: [PATCH net-next v4 3/4] virtio-net: Map NAPIs to queues

2025-02-26 Thread Jason Wang
n Wed, Feb 26, 2025 at 01:48:50PM +0800, Jason Wang wrote: > > > > > On Tue, Feb 25, 2025 at 10:05 AM Joe Damato > > > > > wrote: > > > > > > > > > > > > Use netif_queue_set_napi to map NAPIs to queue IDs so that th

Re: [PATCH net-next v4 0/4] virtio-net: Link queues to NAPIs

2025-02-26 Thread Jason Wang
t; - patch 2: > > - Previously patch 1, unchanged from v1. > > - Added Gerhard Engleder's Reviewed-by. > > - Added Lei Yang's Tested-by. > > > > - patch 3: > > - Introduced virtnet_napi_disable to eliminate duplicated code &g

Re: [PATCH bpf-next v3 3/6] selftests/bpf: move open_tuntap to network helpers

2025-02-25 Thread Jason Wang
r, > so it can be reused in other tests. > > Signed-off-by: Marcus Wichelmann > --- Acked-by: Jason Wang Thanks

Re: [PATCH bpf-next v3 2/6] net: tun: enable transfer of XDP metadata to skb

2025-02-25 Thread Jason Wang
ere the externally initialized > xdp_buff has no metadata support (xdp->data_meta == xdp->data + 1). > > More information about this feature can be found in the commit message > of commit de8f3a83b0a0 ("bpf: add meta pointer for direct access"). > > Signed-off-by: Marcus Wichelmann Acked-by: Jason Wang Thanks

Re: [PATCH bpf-next v3 1/6] net: tun: enable XDP metadata support

2025-02-25 Thread Jason Wang
alizes the xdp_buffs with metadata support and >sufficient headroom. But the tun driver disables it again, so the >xdp_set_data_meta_invalid call has to be removed. > > Signed-off-by: Marcus Wichelmann Acked-by: Jason Wang Thanks

  1   2   3   4   5   6   7   8   9   10   >