Re: [PATCH net-next v4 2/3] selftests: drv-net: Factor out ksft C helpers

2025-04-24 Thread Joe Damato
On Thu, Apr 24, 2025 at 06:32:18PM -0700, Jakub Kicinski wrote: > On Thu, 24 Apr 2025 00:27:32 +0000 Joe Damato wrote: > > +++ b/tools/testing/selftests/drivers/net/ksft.h > > +static void ksft_ready(void) > > > +static void ksft_wait(void) > > These need to be s

[PATCH net-next v4 3/3] selftests: drv-net: Test that NAPI ID is non-zero

2025-04-23 Thread Joe Damato
Test that the SO_INCOMING_NAPI_ID of a network file descriptor is non-zero. This ensures that either the core networking stack or, in some cases like netdevsim, the driver correctly sets the NAPI ID. Signed-off-by: Joe Damato --- .../testing/selftests/drivers/net/.gitignore | 1 + tools

[PATCH net-next v4 2/3] selftests: drv-net: Factor out ksft C helpers

2025-04-23 Thread Joe Damato
Factor ksft C helpers to a header so they can be used by other C-based tests. Signed-off-by: Joe Damato --- tools/testing/selftests/drivers/net/ksft.h| 56 +++ .../selftests/drivers/net/xdp_helper.c| 49 +--- 2 files changed, 58 insertions(+), 47

[PATCH net-next v4 0/3] Fix netdevim to correctly mark NAPI IDs

2025-04-23 Thread Joe Damato
rg/netdev/2025032930.39543-1-jdam...@fastly.com/ Joe Damato (3): netdevsim: Mark NAPI ID on skb in nsim_rcv selftests: drv-net: Factor out ksft C helpers selftests: drv-net: Test that NAPI ID is non-zero drivers/net/netdevsim/netdev.c| 2 + .../testing/selftests/drivers/net/.gitign

Re: [PATCH net-next v3 3/3] selftests: drv-net: Test that NAPI ID is non-zero

2025-04-23 Thread Joe Damato
On Wed, Apr 23, 2025 at 04:16:12PM -0700, Jakub Kicinski wrote: > On Fri, 18 Apr 2025 01:37:05 +0000 Joe Damato wrote: > > +bin_remote = cfg.remote.deploy(cfg.test_dir / "napi_id_helper") > > +listen_cmd = f"{bin_remote} {cfg.addr_v['4']} {p

[PATCH net-next v2 4/4] selftests: drv-net: Test that NAPI ID is non-zero

2025-04-18 Thread Joe Damato
Test that the SO_INCOMING_NAPI_ID of a network file descriptor is non-zero. This ensures that either the core networking stack or, in some cases like netdevsim, the driver correctly sets the NAPI ID. Signed-off-by: Joe Damato --- .../testing/selftests/drivers/net/.gitignore | 1 + tools

[PATCH net-next v2 2/4] selftests: drv-net: Factor out ksft C helpers

2025-04-18 Thread Joe Damato
Factor ksft C helpers to a header so they can be used by other C-based tests. Signed-off-by: Joe Damato --- tools/testing/selftests/drivers/net/ksft.h| 56 +++ .../selftests/drivers/net/xdp_helper.c| 49 +--- 2 files changed, 58 insertions(+), 47

[PATCH net-next v2 0/4] Fix netdevim to correctly mark NAPI IDs

2025-04-18 Thread Joe Damato
543-1-jdam...@fastly.com/ Joe Damato (4): netdevsim: Mark NAPI ID on skb in nsim_rcv selftests: drv-net: Factor out ksft C helpers selftests: net: Allow custom net ns paths selftests: drv-net: Test that NAPI ID is non-zero drivers/net/netdevsim/netdev.c| 2 + .../te

[PATCH net-next v3 3/3] selftests: drv-net: Test that NAPI ID is non-zero

2025-04-17 Thread Joe Damato
Test that the SO_INCOMING_NAPI_ID of a network file descriptor is non-zero. This ensures that either the core networking stack or, in some cases like netdevsim, the driver correctly sets the NAPI ID. Signed-off-by: Joe Damato --- .../testing/selftests/drivers/net/.gitignore | 1 + tools

[PATCH net-next v3 2/3] selftests: drv-net: Factor out ksft C helpers

2025-04-17 Thread Joe Damato
Factor ksft C helpers to a header so they can be used by other C-based tests. Signed-off-by: Joe Damato --- tools/testing/selftests/drivers/net/ksft.h| 56 +++ .../selftests/drivers/net/xdp_helper.c| 49 +--- 2 files changed, 58 insertions(+), 47

[PATCH net-next v3 0/3] Fix netdevim to correctly mark NAPI IDs

2025-04-17 Thread Joe Damato
er an RFC - Minor whitespace change in patch 1 (no functional change). - Patches 2-4 new in v2 rfcv1: https://lore.kernel.org/netdev/2025032930.39543-1-jdam...@fastly.com/ Joe Damato (3): netdevsim: Mark NAPI ID on skb in nsim_rcv selftests: drv-net: Factor out ksft C helpers selftests

Re: [PATCH net-next v2 4/4] selftests: drv-net: Test that NAPI ID is non-zero

2025-04-17 Thread Joe Damato
On Thu, Apr 17, 2025 at 09:53:10AM -0700, Jakub Kicinski wrote: > On Thu, 17 Apr 2025 09:43:23 -0700 Joe Damato wrote: > > I think the main outstanding thing is Paolo's feedback which maybe > > (?) is due to a Python version difference? If you have any guidance > > on h

Re: [PATCH net-next v2 4/4] selftests: drv-net: Test that NAPI ID is non-zero

2025-04-17 Thread Joe Damato
On Thu, Apr 17, 2025 at 06:46:15AM -0700, Jakub Kicinski wrote: > On Thu, 17 Apr 2025 01:32:42 +0000 Joe Damato wrote: > > Test that the SO_INCOMING_NAPI_ID of a network file descriptor is > > non-zero. This ensures that either the core networking stack or, in some > > case

Re: [PATCH net-next v2 4/4] selftests: drv-net: Test that NAPI ID is non-zero

2025-04-17 Thread Joe Damato
On Thu, Apr 17, 2025 at 09:26:22AM +0200, Paolo Abeni wrote: > On 4/17/25 3:32 AM, Joe Damato wrote: > > diff --git a/tools/testing/selftests/drivers/net/napi_id.py > > b/tools/testing/selftests/drivers/net/napi_id.py > > new file mode 100755 > > index ..aee

[PATCH net-next v2 3/4] selftests: net: Allow custom net ns paths

2025-04-16 Thread Joe Damato
Extend NetNSEnter to allow custom paths in order to support, for example, /proc/self/ns/net. Signed-off-by: Joe Damato --- tools/testing/selftests/net/lib/py/netns.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tools/testing/selftests/net/lib/py/netns.py b/tools

Re: [RFC -next 00/10] Add ZC notifications to splice and sendfile

2025-04-05 Thread Joe Damato
On Fri, Mar 21, 2025 at 09:36:34AM -0700, Joe Damato wrote: > On Fri, Mar 21, 2025 at 05:14:59AM -0600, Jens Axboe wrote: > > On 3/20/25 11:56 PM, Christoph Hellwig wrote: > > >> I don't know the entire historical context, but I presume sendmsg > > >> did tha

Re: [RFC -next 00/10] Add ZC notifications to splice and sendfile

2025-03-21 Thread Joe Damato
On Fri, Mar 21, 2025 at 02:33:16PM -0600, Jens Axboe wrote: > On 3/21/25 2:30 PM, Joe Damato wrote: > > On Fri, Mar 21, 2025 at 09:36:34AM -0700, Joe Damato wrote: > >> On Fri, Mar 21, 2025 at 05:14:59AM -0600, Jens Axboe wrote: > >>> On 3/20/25 11:56 PM, Christoph

Re: [RFC -next 00/10] Add ZC notifications to splice and sendfile

2025-03-21 Thread Joe Damato
On Thu, Mar 20, 2025 at 10:56:15PM -0700, Christoph Hellwig wrote: > On Thu, Mar 20, 2025 at 11:23:57AM -0700, Joe Damato wrote: > > In my other message to Jens I proposed: > > - SPLICE_F_ZC for splice to generate zc completion notifications > > to the error queue >

Re: [RFC -next 00/10] Add ZC notifications to splice and sendfile

2025-03-21 Thread Joe Damato
On Fri, Mar 21, 2025 at 05:14:59AM -0600, Jens Axboe wrote: > On 3/20/25 11:56 PM, Christoph Hellwig wrote: > >> I don't know the entire historical context, but I presume sendmsg > >> did that because there was no other mechanism at the time. > > > > At least aio had been around for about 15 years

Re: [RFC -next 00/10] Add ZC notifications to splice and sendfile

2025-03-20 Thread Joe Damato
On Wed, Mar 19, 2025 at 10:57:29PM -0700, Christoph Hellwig wrote: > On Wed, Mar 19, 2025 at 10:45:22AM -0700, Joe Damato wrote: > > I don't disagree; I just don't know if app developers: > > a.) know that this is possible to do, and > > b.) know how to do it >

Re: [RFC -next 00/10] Add ZC notifications to splice and sendfile

2025-03-20 Thread Joe Damato
On Wed, Mar 19, 2025 at 10:50:18PM -0700, Christoph Hellwig wrote: > On Wed, Mar 19, 2025 at 08:32:19AM -0700, Joe Damato wrote: > > See the docs on MSG_ZEROCOPY [1], but in short when a user app calls > > sendmsg and passes MSG_ZEROCOPY a completion notification is added > &g

Re: [RFC -next 00/10] Add ZC notifications to splice and sendfile

2025-03-19 Thread Joe Damato
On Wed, Mar 19, 2025 at 10:07:27AM -0600, Jens Axboe wrote: > On 3/19/25 9:32 AM, Joe Damato wrote: > > On Wed, Mar 19, 2025 at 01:04:48AM -0700, Christoph Hellwig wrote: > >> On Wed, Mar 19, 2025 at 12:15:11AM +, Joe Damato wrote: > >>> One way to fix this is to

Re: [RFC -next 00/10] Add ZC notifications to splice and sendfile

2025-03-19 Thread Joe Damato
On Wed, Mar 19, 2025 at 10:07:27AM -0600, Jens Axboe wrote: > On 3/19/25 9:32 AM, Joe Damato wrote: > > On Wed, Mar 19, 2025 at 01:04:48AM -0700, Christoph Hellwig wrote: > >> On Wed, Mar 19, 2025 at 12:15:11AM +, Joe Damato wrote: > >>> One way to fix this is to

Re: [RFC -next 00/10] Add ZC notifications to splice and sendfile

2025-03-19 Thread Joe Damato
On Wed, Mar 19, 2025 at 12:37:29PM -0600, Jens Axboe wrote: > On 3/19/25 11:45 AM, Joe Damato wrote: > > On Wed, Mar 19, 2025 at 11:20:50AM -0600, Jens Axboe wrote: > >> On 3/19/25 11:04 AM, Joe Damato wrote: > >>> On Wed, Mar 19, 2025 at 10:07:27AM -0600, Jens Axboe

Re: [RFC -next 00/10] Add ZC notifications to splice and sendfile

2025-03-19 Thread Joe Damato
On Wed, Mar 19, 2025 at 01:04:48AM -0700, Christoph Hellwig wrote: > On Wed, Mar 19, 2025 at 12:15:11AM +0000, Joe Damato wrote: > > One way to fix this is to add zerocopy notifications to sendfile similar > > to how MSG_ZEROCOPY works with sendmsg. This is possible thanks to th

Re: [RFC -next 00/10] Add ZC notifications to splice and sendfile

2025-03-19 Thread Joe Damato
On Wed, Mar 19, 2025 at 11:20:50AM -0600, Jens Axboe wrote: > On 3/19/25 11:04 AM, Joe Damato wrote: > > On Wed, Mar 19, 2025 at 10:07:27AM -0600, Jens Axboe wrote: > >> On 3/19/25 9:32 AM, Joe Damato wrote: > >>> On Wed, Mar 19, 2025 at 01:04:48AM -0700, Christop

[RFC -next 03/10] splice: Factor splice_socket into a helper

2025-03-18 Thread Joe Damato
splice_socket becomes a wrapper around splice_socket_generic which takes a ubuf pointer to prepare for zerocopy notifications. Signed-off-by: Joe Damato --- fs/splice.c | 40 +--- 1 file changed, 25 insertions(+), 15 deletions(-) diff --git a/fs/splice.c b

[RFC -next 04/10] splice: Add SPLICE_F_ZC and attach ubuf

2025-03-18 Thread Joe Damato
Add the SPLICE_F_ZC flag and when it is set, allocate a ubuf and attach it to generate zerocopy notifications. Signed-off-by: Joe Damato --- fs/splice.c| 20 include/linux/splice.h | 3 ++- 2 files changed, 22 insertions(+), 1 deletion(-) diff --git a/fs

[RFC -next 01/10] splice: Add ubuf_info to prepare for ZC

2025-03-18 Thread Joe Damato
Update struct splice_desc to include ubuf_info to prepare splice for zero copy notifications. Signed-off-by: Joe Damato --- include/linux/splice.h | 2 ++ 1 file changed, 2 insertions(+) diff --git a/include/linux/splice.h b/include/linux/splice.h index 9dec4861d09f..7477df3916e2 100644 --- a

[RFC -next 05/10] fs: Add splice_write_sd to file operations

2025-03-18 Thread Joe Damato
Introduce splice_write_sd to file operations and export a new helper for sockets splice_to_socket_sd to pass through the splice_desc context allowing the allocated ubuf to be attached. Signed-off-by: Joe Damato --- fs/splice.c| 22 ++ include/linux/fs.h | 2

[RFC -next 10/10] selftests: Add sendfile zerocopy notification test

2025-03-18 Thread Joe Damato
Extend the existing the msg_zerocopy test to allow testing sendfile to ensure that notifications are generated. Signed-off-by: Joe Damato --- tools/testing/selftests/net/msg_zerocopy.c | 54 - tools/testing/selftests/net/msg_zerocopy.sh | 5 ++ 2 files changed, 58

[RFC -next 08/10] fs: Add sendfile flags for sendfile2

2025-03-18 Thread Joe Damato
Add a default flag (SENDFILE_DEFAULT) and a flag for requesting zerocopy notifications (SENDFILE_ZC). do_sendfile is updated to pass through the corresponding splice flag to enable zerocopy notifications. Signed-off-by: Joe Damato --- fs/read_write.c | 5 + include/linux

[RFC -next 09/10] fs: Add sendfile2 syscall

2025-03-18 Thread Joe Damato
The sendfile2 system call is similar to sendfile64, but takes a flags argument allowing the user to select either a default sendfile or for sendfile to generate zerocopy notifications similar to MSG_ZEROCOPY and sendmsg. Signed-off-by: Joe Damato --- arch/alpha/kernel/syscalls/syscall.tbl

[RFC -next 07/10] fs: Add sendfile2 which accepts a flags argument

2025-03-18 Thread Joe Damato
Add sendfile2 which is similar to sendfile64, but takes a flags argument. Signed-off-by: Joe Damato --- fs/read_write.c | 17 + 1 file changed, 17 insertions(+) diff --git a/fs/read_write.c b/fs/read_write.c index 03d2a93c3d1b..057e5f37645d 100644 --- a/fs/read_write.c +++ b/fs

[RFC -next 06/10] fs: Extend do_sendfile to take a flags argument

2025-03-18 Thread Joe Damato
Extend the internal do_sendfile to take a flags argument, which will be used in future commits to signal that userland wants zerocopy notifications. This commit does not change anything about sendfile or sendfile64. Signed-off-by: Joe Damato --- fs/read_write.c | 18 +- 1 file

[RFC -next 02/10] splice: Add helper that passes through splice_desc

2025-03-18 Thread Joe Damato
Add do_splice_from_sd which takes splice_desc as an argument. This helper is just a wrapper around splice_write but will be extended. Use the helper from existing splice code. Signed-off-by: Joe Damato --- fs/splice.c | 13 +++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff

[RFC -next 00/10] Add ZC notifications to splice and sendfile

2025-03-18 Thread Joe Damato
cover.1657643355.git.asml.sile...@gmail.com/ Joe Damato (10): splice: Add ubuf_info to prepare for ZC splice: Add helper that passes through splice_desc splice: Factor splice_socket into a helper splice: Add SPLICE_F_ZC and attach ubuf fs: Add splice_write_sd to file operations fs: Exte

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

2025-03-07 Thread Joe Damato
x'}, {'id': 3, 'ifindex': 2, 'napi-id': 8292, 'type': 'rx'}, {'id': 0, 'ifindex': 2, 'type': 'tx'}, {'id': 1, 'ifindex': 2, 'type': 'tx'}, {'id': 2, 

[PATCH net-next v6 4/4] virtio_net: Use persistent NAPI config

2025-03-06 Thread Joe Damato
'ifindex': 2, 'type': 'tx'}] $ sudo ethtool -L ens4 combined 8 $ ./tools/net/ynl/pyynl/cli.py \ --spec Documentation/netlink/specs/netdev.yaml \ --dump queue-get --json='{"ifindex": 2}' [{'id': 0, 'ifindex': 2, 'napi-

[PATCH net-next v6 2/4] virtio-net: Refactor napi_disable paths

2025-03-06 Thread Joe Damato
Create virtnet_napi_disable helper and refactor virtnet_napi_tx_disable to take a struct send_queue. Signed-off-by: Joe Damato Acked-by: Michael S. Tsirkin Acked-by: Jason Wang Tested-by: Lei Yang --- drivers/net/virtio_net.c | 25 + 1 file changed, 17 insertions

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

2025-03-06 Thread Joe Damato
details. v1: https://lore.kernel.org/netdev/20250110202605.429475-1-jdam...@fastly.com/ Joe Damato (4): virtio-net: Refactor napi_enable paths virtio-net: Refactor napi_disable paths virtio-net: Map NAPIs to queues virtio_net: Use persistent NAPI config drivers/net/virtio_net.c | 101 ++

[PATCH net-next v6 1/4] virtio-net: Refactor napi_enable paths

2025-03-06 Thread Joe Damato
Refactor virtnet_napi_enable and virtnet_napi_tx_enable to take a struct receive_queue. Create a helper, virtnet_napi_do_enable, which contains the logic to enable a NAPI. Signed-off-by: Joe Damato Acked-by: Michael S. Tsirkin Acked-by: Jason Wang Tested-by: Lei Yang --- drivers/net

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

2025-03-06 Thread Joe Damato
On Wed, Mar 05, 2025 at 06:21:18PM -0800, Jakub Kicinski wrote: > On Wed, 5 Mar 2025 17:42:35 -0800 Joe Damato wrote: > > Two spots that come to mind are: > > - in virtnet_probe where all the other netdev ops are plumbed > >through, or > > - above virtnet_disable_

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

2025-03-05 Thread Joe Damato
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: > > > > How about we don't use the API at all from refill_work? > > > > Patch 4 adds consistent NAPI config state and refill_work isn't a &g

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

2025-03-05 Thread Joe Damato
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 Mon, 3 Mar 2025 13:33:10 -0500 Joe Damato wrote: [...] > > > Midd

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

2025-03-04 Thread Joe Damato
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_empty; > > > > int i;

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

2025-03-03 Thread Joe Damato
On Mon, Mar 03, 2025 at 12:00:10PM -0500, Joe Damato wrote: > On Mon, Mar 03, 2025 at 11:46:10AM -0500, Joe Damato wrote: > > On Fri, Feb 28, 2025 at 06:27:59PM -0800, Jakub Kicinski wrote: > > > On Thu, 27 Feb 2025 18:50:13 + Joe Damato wrote: > > > > @@ -

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

2025-03-03 Thread Joe Damato
On Mon, Mar 03, 2025 at 11:46:10AM -0500, Joe Damato wrote: > On Fri, Feb 28, 2025 at 06:27:59PM -0800, Jakub Kicinski wrote: > > On Thu, 27 Feb 2025 18:50:13 + Joe Damato wrote: > > > @@ -2870,9 +2883,15 @@ static void refill_work(struct work_struct *work) > >

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

2025-03-03 Thread Joe Damato
On Fri, Feb 28, 2025 at 06:27:59PM -0800, Jakub Kicinski wrote: > On Thu, 27 Feb 2025 18:50:13 +0000 Joe Damato wrote: > > @@ -2870,9 +2883,15 @@ static void refill_work(struct work_struct *work) > > for (i = 0; i < vi->curr_queue_pairs; i++) { > > str

[PATCH net-next v5 4/4] virtio_net: Use persistent NAPI config

2025-02-27 Thread Joe Damato
'ifindex': 2, 'type': 'tx'}] $ sudo ethtool -L ens4 combined 8 $ ./tools/net/ynl/pyynl/cli.py \ --spec Documentation/netlink/specs/netdev.yaml \ --dump queue-get --json='{"ifindex": 2}' [{'id': 0, 'ifindex': 2, 'napi-

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

2025-02-27 Thread Joe Damato
, 'napi-id': 8291, 'type': 'rx'}, {'id': 3, 'ifindex': 2, 'napi-id': 8292, 'type': 'rx'}, {'id': 0, 'ifindex': 2, 'type': 'tx'}, {'id': 1, 'ifindex': 2, &#x

[PATCH net-next v5 2/4] virtio-net: Refactor napi_disable paths

2025-02-27 Thread Joe Damato
Create virtnet_napi_disable helper and refactor virtnet_napi_tx_disable to take a struct send_queue. Signed-off-by: Joe Damato Acked-by: Michael S. Tsirkin Acked-by: Jason Wang Tested-by: Lei Yang --- drivers/net/virtio_net.c | 25 + 1 file changed, 17 insertions

[PATCH net-next v5 1/4] virtio-net: Refactor napi_enable paths

2025-02-27 Thread Joe Damato
Refactor virtnet_napi_enable and virtnet_napi_tx_enable to take a struct receive_queue. Create a helper, virtnet_napi_do_enable, which contains the logic to enable a NAPI. Signed-off-by: Joe Damato Acked-by: Michael S. Tsirkin Acked-by: Jason Wang Tested-by: Lei Yang --- drivers/net

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

2025-02-27 Thread Joe Damato
Reviewed-by and Tested-by from patch 3. - patch 4: - New in v2. Adds persistent NAPI configuration. See commit message for more details. v1: https://lore.kernel.org/netdev/20250110202605.429475-1-jdam...@fastly.com/ Joe Damato (4): virtio-net: Refactor napi_enable paths virtio-

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

2025-02-26 Thread Joe Damato
On Thu, Feb 27, 2025 at 12:18:33PM +0800, Jason Wang wrote: > On Thu, Feb 27, 2025 at 6:13 AM Michael S. Tsirkin wrote: > > > > On Wed, Feb 26, 2025 at 03:27:42PM -0500, Joe Damato wrote: > > > On Wed, Feb 26, 2025 at 01:08:49PM -0500, Joe Damato wrote: > > > >

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

2025-02-26 Thread Joe Damato
On Wed, Feb 26, 2025 at 01:08:49PM -0500, Joe Damato wrote: > On Wed, Feb 26, 2025 at 01:03:09PM -0500, Joe Damato wrote: > > On Wed, Feb 26, 2025 at 01:48:50PM +0800, Jason Wang wrote: > > > On Tue, Feb 25, 2025 at 10:05 AM Joe Damato wrote: > > > > > > >

[PATCH net v2] selftests: drv-net: Check if combined-count exists

2025-02-26 Thread Joe Damato
es successfully on tg3 and mlx5 (which does have a 'combined-count'). Fixes: 1cf270424218 ("net: selftest: add test for netdev netlink queue-get API") Signed-off-by: Joe Damato --- v2: - Simplify logic and reduce indentation as suggested by David Wei. Retested on b

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

2025-02-26 Thread Joe Damato
On Wed, Feb 26, 2025 at 01:03:09PM -0500, Joe Damato wrote: > On 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 the mapping > &g

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

2025-02-26 Thread Joe Damato
On 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 the mapping > > can be accessed by user apps, taking care to hold RTNL as needed. > >

Re: [PATCH net] selftests: drv-net: Check if combined-count exists

2025-02-25 Thread Joe Damato
On Tue, Feb 25, 2025 at 03:11:24PM -0800, David Wei wrote: > On 2025-02-25 10:14, Joe Damato wrote: [...] > > diff --git a/tools/testing/selftests/drivers/net/queues.py > > b/tools/testing/selftests/drivers/net/queues.py > > index 38303da957ee..baa8845d9f64 100755 &g

[PATCH net] selftests: drv-net: Check if combined-count exists

2025-02-25 Thread Joe Damato
es successfully on tg3 and mlx5 (which does have a 'combined-count'). Fixes: 1cf270424218 ("net: selftest: add test for netdev netlink queue-get API") Signed-off-by: Joe Damato --- tools/testing/selftests/drivers/net/queues.py | 9 ++--- 1 file changed, 6 insertions(+), 3

[PATCH net-next v4 4/4] virtio-net: Use persistent NAPI config

2025-02-24 Thread Joe Damato
'ifindex': 2, 'type': 'tx'}] $ sudo ethtool -L ens4 combined 8 $ ./tools/net/ynl/pyynl/cli.py \ --spec Documentation/netlink/specs/netdev.yaml \ --dump queue-get --json='{"ifindex": 2}' [{'id': 0, 'ifindex': 2, &

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

2025-02-24 Thread Joe Damato
{'id': 2, 'ifindex': 2, 'napi-id': 8291, 'type': 'rx'}, {'id': 3, 'ifindex': 2, 'napi-id': 8292, 'type': 'rx'}, {'id': 0, 'ifindex': 2, 'type': 'tx'}, {&#x

[PATCH net-next v4 2/4] virtio-net: Refactor napi_disable paths

2025-02-24 Thread Joe Damato
Create virtnet_napi_disable helper and refactor virtnet_napi_tx_disable to take a struct send_queue. Signed-off-by: Joe Damato --- drivers/net/virtio_net.c | 25 + 1 file changed, 17 insertions(+), 8 deletions(-) diff --git a/drivers/net/virtio_net.c b/drivers/net

[PATCH net-next v4 1/4] virtio-net: Refactor napi_enable paths

2025-02-24 Thread Joe Damato
Refactor virtnet_napi_enable and virtnet_napi_tx_enable to take a struct receive_queue. Create a helper, virtnet_napi_do_enable, which contains the logic to enable a NAPI. Signed-off-by: Joe Damato --- drivers/net/virtio_net.c | 37 + 1 file changed, 21

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

2025-02-24 Thread Joe Damato
re details. v1: https://lore.kernel.org/netdev/20250110202605.429475-1-jdam...@fastly.com/ [1]: https://lore.kernel.org/netdev/20250221142650.3c74d...@kernel.org/ [2]: https://lore.kernel.org/netdev/20250127142400.24eca...@kernel.org/ Joe Damato (4): virtio-net: Refactor napi_enable paths

[PATCH net-next v8 3/3] selftests: drv-net: Test queue xsk attribute

2025-02-14 Thread Joe Damato
Test that queues which are used for AF_XDP have the xsk nest attribute. The attribute is currently empty, but its existence means the AF_XDP is being used for the queue. Enable CONFIG_XDP_SOCKETS for selftests/drivers/net tests, as well. Signed-off-by: Joe Damato Suggested-by: Jakub Kicinski

[PATCH net-next v8 0/3] netdev-genl: Add an xsk attribute to queues

2025-02-14 Thread Joe Damato
s to patch 1, and to incorporate some Python feedback from Jakub :) rfc: https://lore.kernel.org/netdev/20250129172431.65773-1-jdam...@fastly.com/ Joe Damato (3): netlink: Add nla_put_empty_nest helper netdev-genl: Add an XSK attribute to queues selftests: drv-net: Test queue xsk

[PATCH net-next RESEND v7 3/3] selftests: drv-net: Test queue xsk attribute

2025-02-13 Thread Joe Damato
Test that queues which are used for AF_XDP have the xsk nest attribute. The attribute is currently empty, but its existence means the AF_XDP is being used for the queue. Enable CONFIG_XDP_SOCKETS for selftests/drivers/net tests, as well. Signed-off-by: Joe Damato Suggested-by: Jakub Kicinski

[PATCH net-next RESEND v7 0/3] netdev-genl: Add an xsk attribute to queues

2025-02-13 Thread Joe Damato
e the test based on changes to patch 1, and to incorporate some Python feedback from Jakub :) rfc: https://lore.kernel.org/netdev/20250129172431.65773-1-jdam...@fastly.com/ Joe Damato (3): netlink: Add nla_put_empty_nest helper netdev-genl: Add an XSK attribute to queues selftests: drv

[PATCH net-next v7 3/3] selftests: drv-net: Test queue xsk attribute

2025-02-12 Thread Joe Damato
Test that queues which are used for AF_XDP have the xsk nest attribute. The attribute is currently empty, but its existence means the AF_XDP is being used for the queue. Enable CONFIG_XDP_SOCKETS for selftests/drivers/net tests, as well. Signed-off-by: Joe Damato Suggested-by: Jakub Kicinski

[PATCH net-next v7 0/3] netdev-genl: Add an xsk attribute to queues

2025-02-12 Thread Joe Damato
from Jakub :) rfc: https://lore.kernel.org/netdev/20250129172431.65773-1-jdam...@fastly.com/ Joe Damato (3): netlink: Add nla_put_empty_nest helper netdev-genl: Add an XSK attribute to queues selftests: drv-net: Test queue xsk attribute Documentation/netlink/specs/netdev.yaml

Re: [PATCH net-next v6 3/3] selftests: drv-net: Test queue xsk attribute

2025-02-12 Thread Joe Damato
On Tue, Feb 11, 2025 at 06:37:06PM -0800, Jakub Kicinski wrote: > On Tue, 11 Feb 2025 15:10:52 -0800 Stanislav Fomichev wrote: > > > I can't comment on NIPA because I have no idea how it works. Maybe > > > there is a kernel with some options enabled and other kernels with > > > various options disa

Re: [PATCH net-next v6 3/3] selftests: drv-net: Test queue xsk attribute

2025-02-11 Thread Joe Damato
On Tue, Feb 11, 2025 at 12:00:38PM -0800, Stanislav Fomichev wrote: > On 02/11, Joe Damato wrote: > > On Tue, Feb 11, 2025 at 09:45:56AM -0800, Joe Damato wrote: > > > On Tue, Feb 11, 2025 at 12:09:50PM +0100, Paolo Abeni wrote: > > > > On 2/1

Re: [PATCH net-next v6 3/3] selftests: drv-net: Test queue xsk attribute

2025-02-11 Thread Joe Damato
On Tue, Feb 11, 2025 at 09:45:56AM -0800, Joe Damato wrote: > On Tue, Feb 11, 2025 at 12:09:50PM +0100, Paolo Abeni wrote: > > On 2/10/25 8:38 PM, Joe Damato wrote: > > > +def check_xdp(cfg, nl, xdp_queue_id=0) -> None: > > > +test_dir = os.path.dir

Re: [PATCH net-next v6 3/3] selftests: drv-net: Test queue xsk attribute

2025-02-11 Thread Joe Damato
On Tue, Feb 11, 2025 at 12:09:50PM +0100, Paolo Abeni wrote: > On 2/10/25 8:38 PM, Joe Damato wrote: > > +def check_xdp(cfg, nl, xdp_queue_id=0) -> None: > > +test_dir = os.path.dirname(os.path.realpath(__file__)) > > +xdp = subprocess.Popen([f"{test_dir

[PATCH net-next v6 3/3] selftests: drv-net: Test queue xsk attribute

2025-02-10 Thread Joe Damato
Test that queues which are used for AF_XDP have the xsk nest attribute. The attribute is currently empty, but its existence means the AF_XDP is being used for the queue. Signed-off-by: Joe Damato Suggested-by: Jakub Kicinski --- v3: - Change comment style of helper C program to avoid kdoc

[PATCH net-next v6 0/3] netdev-genl: Add an xsk attribute to queues

2025-02-10 Thread Joe Damato
to update the test based on changes to patch 1, and to incorporate some Python feedback from Jakub :) rfc: https://lore.kernel.org/netdev/20250129172431.65773-1-jdam...@fastly.com/ Joe Damato (3): netlink: Add nla_put_empty_nest helper netdev-genl: Add an XSK attribute to queues self

[PATCH net-next v5 3/3] selftests: drv-net: Test queue xsk attribute

2025-02-07 Thread Joe Damato
Test that queues which are used for AF_XDP have the xsk nest attribute. The attribute is currently empty, but its existence means the AF_XDP is being used for the queue. Signed-off-by: Joe Damato Suggested-by: Jakub Kicinski --- v3: - Change comment style of helper C program to avoid kdoc

[PATCH net-next v5 0/3] netdev-genl: Add an xsk attribute to queues

2025-02-07 Thread Joe Damato
ed patch 1 to include an empty nest as suggested by Jakub - Adjusted patch 2 to update the test based on changes to patch 1, and to incorporate some Python feedback from Jakub :) rfc: https://lore.kernel.org/netdev/20250129172431.65773-1-jdam...@fastly.com/ Joe Damato (3): ne

[PATCH net-next v4 3/3] selftests: drv-net: Test queue xsk attribute

2025-02-06 Thread Joe Damato
Test that queues which are used for AF_XDP have the xsk nest attribute. The attribute is currently empty, but its existence means the AF_XDP is being used for the queue. Signed-off-by: Joe Damato Suggested-by: Jakub Kicinski --- v3: - Change comment style of helper C program to avoid kdoc

[PATCH net-next v4 0/3] netdev-genl: Add an xsk attribute to queues

2025-02-06 Thread Joe Damato
update the test based on changes to patch 1, and to incorporate some Python feedback from Jakub :) rfc: https://lore.kernel.org/netdev/20250129172431.65773-1-jdam...@fastly.com/ Joe Damato (3): netlink: Add nla_put_empty_nest helper netdev-genl: Add an XSK attribute to queues selftest

[PATCH net-next v3 2/2] selftests: drv-net: Test queue xsk attribute

2025-02-04 Thread Joe Damato
Test that queues which are used for AF_XDP have the xsk nest attribute. The attribute is currently empty, but its existence means the AF_XDP is being used for the queue. Signed-off-by: Joe Damato Suggested-by: Jakub Kicinski --- v3: - Change comment style of helper C program to avoid kdoc

[PATCH net-next v3 0/2] netdevgenl: Add an xsk attribute to queues

2025-02-04 Thread Joe Damato
changes to patch 1, and to incorporate some Python feedback from Jakub :) rfc: https://lore.kernel.org/netdev/20250129172431.65773-1-jdam...@fastly.com/ Joe Damato (2): netdev-genl: Add an XSK attribute to queues selftests: drv-net: Test queue xsk attribute Documentation/netlink/specs/n

[PATCH net-next v2 2/2] selftests: drv-net: Test queue xsk attribute

2025-02-03 Thread Joe Damato
Test that queues which are used for AF_XDP have the xsk nest attribute. The attribute is currently empty, but its existence means the AF_XDP is being used for the queue. Signed-off-by: Joe Damato Suggested-by: Jakub Kicinski --- v2: - Updated the Python test after changes to patch 1 which

[PATCH net-next v2 0/2] netdevgenl: Add an xsk attribute to queues

2025-02-03 Thread Joe Damato
ty nest as suggested by Jakub - Adjusted patch 2 to update the test based on changes to patch 1, and to incorporate some Python feedback from Jakub :) rfc: https://lore.kernel.org/netdev/20250129172431.65773-1-jdam...@fastly.com/ Joe Damato (2): netdev-genl: Add an XSK attribute

Re: [RFC net-next 2/2] selftests: drv-net: Test queue xsk attribute

2025-01-30 Thread Joe Damato
On Wed, Jan 29, 2025 at 06:07:51PM -0800, Jakub Kicinski wrote: > On Wed, 29 Jan 2025 17:24:25 +0000 Joe Damato wrote: > > Test that queues which are used for AF_XDP have the xsk attribute set. > > > diff --git a/tools/testing/selftests/drivers/.gitignore > > b/tools/t

Re: [RFC net-next 0/2] netdevgenl: Add an xsk attribute to queues

2025-01-29 Thread Joe Damato
On Wed, Jan 29, 2025 at 05:24:23PM +, Joe Damato wrote: > Greetings: > > This is an attempt to followup on something Jakub asked me about [1], > adding an xsk attribute to queues and more clearly documenting which > queues are linked to NAPIs... > > But: > > 1. I

[RFC net-next 2/2] selftests: drv-net: Test queue xsk attribute

2025-01-29 Thread Joe Damato
Test that queues which are used for AF_XDP have the xsk attribute set. Signed-off-by: Joe Damato --- tools/testing/selftests/drivers/.gitignore| 1 + tools/testing/selftests/drivers/net/Makefile | 3 + tools/testing/selftests/drivers/net/queues.py | 32 ++- .../selftests/drivers/net

[RFC net-next 0/2] netdevgenl: Add an xsk attribute to queues

2025-01-29 Thread Joe Damato
s better ways to do things. Thanks, Joe [1]: https://lore.kernel.org/netdev/20250113143109.60afa...@kernel.org/ Joe Damato (2): netdev-genl: Add an XSK attribute to queues selftests: drv-net: Test queue xsk attribute Documentation/netlink/specs/netdev.yaml | 10 ++- include/uapi/li

Re: [RFC net-next v3 2/4] virtio_net: Prepare for NAPI to queue mapping

2025-01-27 Thread Joe Damato
On Mon, Jan 27, 2025 at 02:24:00PM -0800, Jakub Kicinski wrote: > On Mon, 27 Jan 2025 17:07:54 -0500 Joe Damato wrote: > > > Tx NAPIs are one aspect, whether they have ID or not we may want direct > > > access to the struct somewhere in the core, via txq, at some point, and

Re: [RFC net-next v3 2/4] virtio_net: Prepare for NAPI to queue mapping

2025-01-27 Thread Joe Damato
On Mon, Jan 27, 2025 at 01:33:04PM -0800, Jakub Kicinski wrote: > On Mon, 27 Jan 2025 14:31:21 -0500 Joe Damato wrote: > > Actually, I missed a patch Jakub submit to net [1], which prevents > > dumping TX-only NAPIs. > > That patch only addresses NAPI ops, here I thin

Re: [RFC net-next v3 2/4] virtio_net: Prepare for NAPI to queue mapping

2025-01-27 Thread Joe Damato
On Mon, Jan 27, 2025 at 12:52:06PM -0500, Joe Damato wrote: > On Sun, Jan 26, 2025 at 04:04:02PM +0800, Jason Wang wrote: > > On Sat, Jan 25, 2025 at 4:19 AM Joe Damato wrote: > > > > > > On Fri, Jan 24, 2025 at 09:14:54AM +0800, Jason Wang wrote: > > > &g

Re: [RFC net-next v3 2/4] virtio_net: Prepare for NAPI to queue mapping

2025-01-27 Thread Joe Damato
On Sun, Jan 26, 2025 at 04:04:02PM +0800, Jason Wang wrote: > On Sat, Jan 25, 2025 at 4:19 AM Joe Damato wrote: > > > > On Fri, Jan 24, 2025 at 09:14:54AM +0800, Jason Wang wrote: > > > On Thu, Jan 23, 2025 at 10:47 AM Joe Damato wrote: > > > > > > &g

Re: [RFC net-next v3 2/4] virtio_net: Prepare for NAPI to queue mapping

2025-01-24 Thread Joe Damato
On Fri, Jan 24, 2025 at 09:14:54AM +0800, Jason Wang wrote: > On Thu, Jan 23, 2025 at 10:47 AM Joe Damato wrote: > > > > On Thu, Jan 23, 2025 at 10:40:43AM +0800, Jason Wang wrote: > > > On Thu, Jan 23, 2025 at 1:41 AM Joe Damato wrote: > > > > > > &g

Re: [RFC net-next v3 2/4] virtio_net: Prepare for NAPI to queue mapping

2025-01-22 Thread Joe Damato
On Thu, Jan 23, 2025 at 10:40:43AM +0800, Jason Wang wrote: > On Thu, Jan 23, 2025 at 1:41 AM Joe Damato wrote: > > > > On Wed, Jan 22, 2025 at 02:12:46PM +0800, Jason Wang wrote: > > > On Wed, Jan 22, 2025 at 3:11 AM Joe Damato wrote: > > > > > > > &

Re: [RFC net-next v3 2/4] virtio_net: Prepare for NAPI to queue mapping

2025-01-22 Thread Joe Damato
On Wed, Jan 22, 2025 at 02:12:46PM +0800, Jason Wang wrote: > On Wed, Jan 22, 2025 at 3:11 AM Joe Damato wrote: > > > > Slight refactor to prepare the code for NAPI to queue mapping. No > > functional changes. > > > > Signed-off-by: Joe Damato > > Revie

[RFC net-next v3 2/4] virtio_net: Prepare for NAPI to queue mapping

2025-01-21 Thread Joe Damato
Slight refactor to prepare the code for NAPI to queue mapping. No functional changes. Signed-off-by: Joe Damato Reviewed-by: Gerhard Engleder Tested-by: Lei Yang --- v2: - Previously patch 1 in the v1. - Added Reviewed-by and Tested-by tags to commit message. No functional changes

[RFC net-next v3 0/4] virtio_net: Link queues to NAPIs

2025-01-21 Thread Joe Damato
re details. Jakub Kicinski (1): net: protect queue -> napi linking with netdev_lock() Joe Damato (3): virtio_net: Prepare for NAPI to queue mapping virtio_net: Map NAPIs to queues virtio_net: Use persistent NAPI config drivers/net/virtio_net.c | 38 +++--

[RFC net-next v3 4/4] virtio_net: Use persistent NAPI config

2025-01-21 Thread Joe Damato
'ifindex': 2, 'type': 'tx'}] $ sudo ethtool -L ens4 combined 8 $ ./tools/net/ynl/pyynl/cli.py \ --spec Documentation/netlink/specs/netdev.yaml \ --dump queue-get --json='{"ifindex": 2}' [{'id': 0, 'ifindex': 2, 

  1   2   >