Re: [PATCH vhost 4/6] virtio_net: big mode support premapped

2024-04-18 Thread Jason Wang
On Fri, Apr 19, 2024 at 12:23 PM Xuan Zhuo wrote: > > On Fri, 19 Apr 2024 08:43:43 +0800, Jason Wang wrote: > > On Thu, Apr 18, 2024 at 4:35 PM Xuan Zhuo > > wrote: > > > > > > On Thu, 18 Apr 2024 14:25:06 +0800, Jason Wang > > > wrote: > > > > On Thu, Apr 11, 2024 at 10:51 AM Xuan Zhuo > >

Re: [PATCH vhost 4/6] virtio_net: big mode support premapped

2024-04-18 Thread Xuan Zhuo
On Fri, 19 Apr 2024 08:43:43 +0800, Jason Wang wrote: > On Thu, Apr 18, 2024 at 4:35 PM Xuan Zhuo wrote: > > > > On Thu, 18 Apr 2024 14:25:06 +0800, Jason Wang wrote: > > > On Thu, Apr 11, 2024 at 10:51 AM Xuan Zhuo > > > wrote: > > > > > > > > In big mode, pre-mapping DMA is beneficial becaus

Re: [PATCH vhost 5/6] virtio_net: enable premapped by default

2024-04-18 Thread Jason Wang
On Thu, Apr 18, 2024 at 4:37 PM Xuan Zhuo wrote: > > On Thu, 18 Apr 2024 14:26:33 +0800, Jason Wang wrote: > > On Thu, Apr 11, 2024 at 10:51 AM Xuan Zhuo > > wrote: > > > > > > Currently, big, merge, and small modes all support the premapped mode. > > > We can now enable premapped mode by defau

Re: [PATCH vhost 4/6] virtio_net: big mode support premapped

2024-04-18 Thread Jason Wang
On Thu, Apr 18, 2024 at 4:35 PM Xuan Zhuo wrote: > > On Thu, 18 Apr 2024 14:25:06 +0800, Jason Wang wrote: > > On Thu, Apr 11, 2024 at 10:51 AM Xuan Zhuo > > wrote: > > > > > > In big mode, pre-mapping DMA is beneficial because if the pages are not > > > used, we can reuse them without needing

Re: [PATCH net-next v4 3/6] virtio_net: Add a lock for the command VQ.

2024-04-18 Thread Jason Wang
On Fri, Apr 19, 2024 at 12:12 AM Heng Qi wrote: > > > > 在 2024/4/18 下午11:48, Paolo Abeni 写道: > > On Thu, 2024-04-18 at 15:38 +, Dan Jurgens wrote: > >>> From: Paolo Abeni > >>> Sent: Thursday, April 18, 2024 5:57 AM > >>> On Thu, 2024-04-18 at 15:36 +0800, Heng Qi wrote: > 在 2024/4/18 下午

Re: [PATCH vhost 3/6] virtio_net: replace private by pp struct inside page

2024-04-18 Thread Matthew Wilcox
On Thu, Apr 18, 2024 at 10:19:33PM +0200, Jesper Dangaard Brouer wrote: > I'm not sure it is "fine" to, explicitly choosing not to use page pool, > and then (ab)use `struct page` member (pp) that intended for page_pool > for other stuff. (In this case create a linked list of pages). > > +#define

Re: [PATCH vhost 3/6] virtio_net: replace private by pp struct inside page

2024-04-18 Thread Jesper Dangaard Brouer
On 17/04/2024 10.20, Xuan Zhuo wrote: On Wed, 17 Apr 2024 12:08:10 +0800, Jason Wang wrote: On Wed, Apr 17, 2024 at 9:38 AM Xuan Zhuo wrote: On Tue, 16 Apr 2024 11:24:53 +0800, Jason Wang wrote: On Mon, Apr 15, 2024 at 5:04 PM Xuan Zhuo wrote: On Mon, 15 Apr 2024 16:56:45 +0800, Jaso

Re: [patch net-next v4 2/6] selftests: forwarding: move initial root check to the beginning

2024-04-18 Thread Benjamin Poirier
On 2024-04-18 18:08 +0200, Jiri Pirko wrote: > From: Jiri Pirko > > This check can be done at the very beginning of the script. > As the follow up patch needs to add early code that needs to be executed > after the check, move it. > > Signed-off-by: Jiri Pirko > --- > v3->v4: > - removed NUM_NE

Re: [patch net-next v4 6/6] selftests: virtio_net: add initial tests

2024-04-18 Thread Petr Machata
Jiri Pirko writes: > From: Jiri Pirko > > Introduce initial tests for virtio_net driver. Focus on feature testing > leveraging previously introduced debugfs feature filtering > infrastructure. Add very basic ping and F_MAC feature tests. > > To run this, do: > $ make -C tools/testing/selftests

Re: [patch net-next v4 5/6] selftests: forwarding: add wait_for_dev() helper

2024-04-18 Thread Petr Machata
Jiri Pirko writes: > From: Jiri Pirko > > The existing setup_wait*() helper family check the status of the > interface to be up. Introduce wait_for_dev() to wait for the netdevice > to appear, for example after test script does manual device bind. > > Signed-off-by: Jiri Pirko Reviewed-by: P

Re: [patch net-next v4 3/6] selftests: forwarding: add ability to assemble NETIFS array by driver name

2024-04-18 Thread Petr Machata
Jiri Pirko writes: > From: Jiri Pirko > > Allow driver tests to work without specifying the netdevice names. > Introduce a possibility to search for available netdevices according to > set driver name. Allow test to specify the name by setting > NETIF_FIND_DRIVER variable. > > Note that user o

Re: [patch net-next v4 2/6] selftests: forwarding: move initial root check to the beginning

2024-04-18 Thread Petr Machata
Jiri Pirko writes: > From: Jiri Pirko > > This check can be done at the very beginning of the script. > As the follow up patch needs to add early code that needs to be executed > after the check, move it. > > Signed-off-by: Jiri Pirko Reviewed-by: Petr Machata

Re: [PATCH net-next v4 3/6] virtio_net: Add a lock for the command VQ.

2024-04-18 Thread Heng Qi
在 2024/4/18 下午11:48, Paolo Abeni 写道: On Thu, 2024-04-18 at 15:38 +, Dan Jurgens wrote: From: Paolo Abeni Sent: Thursday, April 18, 2024 5:57 AM On Thu, 2024-04-18 at 15:36 +0800, Heng Qi wrote: 在 2024/4/18 下午2:42, Jason Wang 写道: On Wed, Apr 17, 2024 at 3:31 AM Daniel Jurgens wrote:

[patch net-next v4 6/6] selftests: virtio_net: add initial tests

2024-04-18 Thread Jiri Pirko
From: Jiri Pirko Introduce initial tests for virtio_net driver. Focus on feature testing leveraging previously introduced debugfs feature filtering infrastructure. Add very basic ping and F_MAC feature tests. To run this, do: $ make -C tools/testing/selftests/ TARGETS=drivers/net/virtio_net/ run

[patch net-next v4 5/6] selftests: forwarding: add wait_for_dev() helper

2024-04-18 Thread Jiri Pirko
From: Jiri Pirko The existing setup_wait*() helper family check the status of the interface to be up. Introduce wait_for_dev() to wait for the netdevice to appear, for example after test script does manual device bind. Signed-off-by: Jiri Pirko --- v3->v4: - removed "up" from ip link command li

[patch net-next v4 4/6] selftests: forwarding: add check_driver() helper

2024-04-18 Thread Jiri Pirko
From: Jiri Pirko Add a helper to be used to check if the netdevice is backed by specified driver. Signed-off-by: Jiri Pirko Reviewed-by: Petr Machata --- tools/testing/selftests/net/forwarding/lib.sh | 12 1 file changed, 12 insertions(+) diff --git a/tools/testing/selftests/net

[patch net-next v4 3/6] selftests: forwarding: add ability to assemble NETIFS array by driver name

2024-04-18 Thread Jiri Pirko
From: Jiri Pirko Allow driver tests to work without specifying the netdevice names. Introduce a possibility to search for available netdevices according to set driver name. Allow test to specify the name by setting NETIF_FIND_DRIVER variable. Note that user overrides this either by passing netde

[patch net-next v4 2/6] selftests: forwarding: move initial root check to the beginning

2024-04-18 Thread Jiri Pirko
From: Jiri Pirko This check can be done at the very beginning of the script. As the follow up patch needs to add early code that needs to be executed after the check, move it. Signed-off-by: Jiri Pirko --- v3->v4: - removed NUM_NETIFS mode, rephrased the patch subject and description accordin

[patch net-next v4 1/6] virtio: add debugfs infrastructure to allow to debug virtio features

2024-04-18 Thread Jiri Pirko
From: Jiri Pirko Currently there is no way for user to set what features the driver should obey or not, it is hard wired in the code. In order to be able to debug the device behavior in case some feature is disabled, introduce a debugfs infrastructure with couple of files allowing user to see wh

[patch net-next v4 0/6] selftests: virtio_net: introduce initial testing infrastructure

2024-04-18 Thread Jiri Pirko
From: Jiri Pirko This patchset aims at introducing very basic initial infrastructure for virtio_net testing, namely it focuses on virtio feature testing. The first patch adds support for debugfs for virtio devices, allowing user to filter features to pretend to be driver that is not capable of t

Re: [PATCH net-next v4 3/6] virtio_net: Add a lock for the command VQ.

2024-04-18 Thread Heng Qi
I didn't see any warnings with GCC or clang. This is used other places in the kernel as well. gcc version 13.2.1 20230918 (Red Hat 13.2.1-3) (GCC) clang version 17.0.6 (Fedora 17.0.6-2.fc39) I think Paolo is suggesting this[1][2], guard will mess with the sparse check and cause a warning: [

Re: [PATCH net-next v4 3/6] virtio_net: Add a lock for the command VQ.

2024-04-18 Thread Jakub Kicinski
On Thu, 18 Apr 2024 17:48:57 +0200 Paolo Abeni wrote: > > > Side note: the compiler apparently does not like guard() construct, > > > leading to > > > new warning, here and in later patches. I'm unsure if the code > > > simplification > > > is worthy. > > > > I didn't see any warnings with GCC

Re: [PATCH net-next v4 3/6] virtio_net: Add a lock for the command VQ.

2024-04-18 Thread Paolo Abeni
On Thu, 2024-04-18 at 15:38 +, Dan Jurgens wrote: > > From: Paolo Abeni > > Sent: Thursday, April 18, 2024 5:57 AM > > On Thu, 2024-04-18 at 15:36 +0800, Heng Qi wrote: > > > > > > 在 2024/4/18 下午2:42, Jason Wang 写道: > > > > On Wed, Apr 17, 2024 at 3:31 AM Daniel Jurgens > > wrote: > > > > >

RE: [PATCH net-next v4 3/6] virtio_net: Add a lock for the command VQ.

2024-04-18 Thread Dan Jurgens
> From: Paolo Abeni > Sent: Thursday, April 18, 2024 5:57 AM > On Thu, 2024-04-18 at 15:36 +0800, Heng Qi wrote: > > > > 在 2024/4/18 下午2:42, Jason Wang 写道: > > > On Wed, Apr 17, 2024 at 3:31 AM Daniel Jurgens > wrote: > > > > The command VQ will no longer be protected by the RTNL lock. Use a > >

Re: [patch net-next v3 3/6] selftests: forwarding: add ability to assemble NETIFS array by driver name

2024-04-18 Thread Jiri Pirko
Thu, Apr 18, 2024 at 10:11:12AM CEST, pe...@nvidia.com wrote: > >Jiri Pirko writes: > >> From: Jiri Pirko >> >> Allow driver tests to work without specifying the netdevice names. >> Introduce a possibility to search for available netdevices according to >> set driver name. Allow test to specify t

Re: [patch net-next v3 3/6] selftests: forwarding: add ability to assemble NETIFS array by driver name

2024-04-18 Thread Jiri Pirko
Thu, Apr 18, 2024 at 10:43:44AM CEST, pe...@nvidia.com wrote: > >Petr Machata writes: > >> Jiri Pirko writes: >> >>> +# Whether to find netdevice according to the specified driver. >>> +: "${NETIF_FIND_DRIVER:=}" >> >> This would be better placed up there in the Topology description >> section. T

Re: [patch net-next v3 5/6] selftests: forwarding: add wait_for_dev() helper

2024-04-18 Thread Jiri Pirko
Thu, Apr 18, 2024 at 10:33:13AM CEST, pe...@nvidia.com wrote: > >Jiri Pirko writes: > >> From: Jiri Pirko >> >> The existing setup_wait*() helper family check the status of the >> interface to be up. Introduce wait_for_dev() to wait for the netdevice >> to appear, for example after test script do

Re: [patch net-next v3 6/6] selftests: virtio_net: add initial tests

2024-04-18 Thread Jiri Pirko
Thu, Apr 18, 2024 at 10:39:49AM CEST, pe...@nvidia.com wrote: > >Jiri Pirko writes: > >> From: Jiri Pirko >> >> Introduce initial tests for virtio_net driver. Focus on feature testing >> leveraging previously introduced debugfs feature filtering >> infrastructure. Add very basic ping and F_MAC fe

Re: [PATCH net-next v4 3/6] virtio_net: Add a lock for the command VQ.

2024-04-18 Thread Paolo Abeni
On Thu, 2024-04-18 at 15:36 +0800, Heng Qi wrote: > > 在 2024/4/18 下午2:42, Jason Wang 写道: > > On Wed, Apr 17, 2024 at 3:31 AM Daniel Jurgens wrote: > > > The command VQ will no longer be protected by the RTNL lock. Use a > > > spinlock to protect the control buffer header and the VQ. > > > > > >

Re: [patch net-next v3 6/6] selftests: virtio_net: add initial tests

2024-04-18 Thread Petr Machata
Jiri Pirko writes: > From: Jiri Pirko > > Introduce initial tests for virtio_net driver. Focus on feature testing > leveraging previously introduced debugfs feature filtering > infrastructure. Add very basic ping and F_MAC feature tests. > > To run this, do: > $ make -C tools/testing/selftests

Re: [patch net-next v3 3/6] selftests: forwarding: add ability to assemble NETIFS array by driver name

2024-04-18 Thread Petr Machata
Petr Machata writes: > Jiri Pirko writes: > >> +# Whether to find netdevice according to the specified driver. >> +: "${NETIF_FIND_DRIVER:=}" > > This would be better placed up there in the Topology description > section. Together with NETIFS and NETIF_NO_CABLE, as it concerns > specification

Re: [PATCH vhost 5/6] virtio_net: enable premapped by default

2024-04-18 Thread Xuan Zhuo
On Thu, 18 Apr 2024 14:26:33 +0800, Jason Wang wrote: > On Thu, Apr 11, 2024 at 10:51 AM Xuan Zhuo wrote: > > > > Currently, big, merge, and small modes all support the premapped mode. > > We can now enable premapped mode by default. Furthermore, > > virtqueue_set_dma_premapped() must succeed whe

Re: [patch net-next v3 5/6] selftests: forwarding: add wait_for_dev() helper

2024-04-18 Thread Petr Machata
Jiri Pirko writes: > From: Jiri Pirko > > The existing setup_wait*() helper family check the status of the > interface to be up. Introduce wait_for_dev() to wait for the netdevice > to appear, for example after test script does manual device bind. > > Signed-off-by: Jiri Pirko > --- > v1->v2:

Re: [PATCH vhost 4/6] virtio_net: big mode support premapped

2024-04-18 Thread Xuan Zhuo
On Thu, 18 Apr 2024 14:25:06 +0800, Jason Wang wrote: > On Thu, Apr 11, 2024 at 10:51 AM Xuan Zhuo wrote: > > > > In big mode, pre-mapping DMA is beneficial because if the pages are not > > used, we can reuse them without needing to unmap and remap. > > > > We require space to store the DMA addre

Re: [patch net-next v3 4/6] selftests: forwarding: add check_driver() helper

2024-04-18 Thread Petr Machata
Jiri Pirko writes: > From: Jiri Pirko > > Add a helper to be used to check if the netdevice is backed by specified > driver. > > Signed-off-by: Jiri Pirko Reviewed-by: Petr Machata

Re: [patch net-next v3 3/6] selftests: forwarding: add ability to assemble NETIFS array by driver name

2024-04-18 Thread Petr Machata
Jiri Pirko writes: > From: Jiri Pirko > > Allow driver tests to work without specifying the netdevice names. > Introduce a possibility to search for available netdevices according to > set driver name. Allow test to specify the name by setting > NETIF_FIND_DRIVER variable. > > Note that user o

Re: [patch net-next v2 1/6] virtio: add debugfs infrastructure to allow to debug virtio features

2024-04-18 Thread Jiri Pirko
Thu, Apr 18, 2024 at 02:59:41AM CEST, jasow...@redhat.com wrote: >On Wed, Apr 17, 2024 at 3:23 PM Jiri Pirko wrote: >> >> Wed, Apr 17, 2024 at 06:37:30AM CEST, jasow...@redhat.com wrote: >> >On Tue, Apr 16, 2024 at 5:37 PM Jiri Pirko wrote: >> >> >> >> Tue, Apr 16, 2024 at 05:52:41AM CEST, jasow.

Re: [PATCH net-next v4 3/6] virtio_net: Add a lock for the command VQ.

2024-04-18 Thread Heng Qi
在 2024/4/18 下午2:42, Jason Wang 写道: On Wed, Apr 17, 2024 at 3:31 AM Daniel Jurgens wrote: The command VQ will no longer be protected by the RTNL lock. Use a spinlock to protect the control buffer header and the VQ. Signed-off-by: Daniel Jurgens Reviewed-by: Jiri Pirko --- drivers/net/vir