[PATCH] x86: Reduce duplicated code in the x86_64 context switch path.

2013-05-12 Thread Joe Damato
Signed-off-by: Joe Damato --- arch/x86/include/asm/switch_to.h | 30 ++ arch/x86/kernel/process_64.c | 29 ++--- 2 files changed, 32 insertions(+), 27 deletions(-) diff --git a/arch/x86/include/asm/switch_to.h b/arch/x86/include/asm

[PATCH v2] x86: Reduce duplicated code in the x86_64 context switch path.

2013-05-13 Thread Joe Damato
Signed-off-by: Joe Damato --- arch/x86/include/asm/switch_to.h | 25 + arch/x86/kernel/process_64.c | 29 ++--- 2 files changed, 27 insertions(+), 27 deletions(-) diff --git a/arch/x86/include/asm/switch_to.h b/arch/x86/include/asm

Re: [PATCH] x86: Reduce duplicated code in the x86_64 context switch path.

2013-05-13 Thread Joe Damato
it would be nice to remove the duplicated code and (IMHO) it makes __switch_to easier to read. > Joe Damato wrote: > >>Signed-off-by: Joe Damato >>--- >> arch/x86/include/asm/switch_to.h | 30 ++ >> arch/x86/kernel/process_64.c | 29

Re: [PATH v6 0/3] vdpa: support set mac address from vdpa tool

2024-07-25 Thread Joe Damato
On Thu, Jul 25, 2024 at 09:31:01AM +0800, Cindy Lu wrote: > Add support for setting the MAC address using the VDPA tool. > This feature will allow setting the MAC address using the VDPA tool. > For example, in vdpa_sim_net, the implementation sets the MAC address > to the config space. However, for

Re: [PATH v6 1/3] vdpa: support set mac address from vdpa tool

2024-07-25 Thread Joe Damato
On Thu, Jul 25, 2024 at 09:31:02AM +0800, Cindy Lu wrote: [...] > diff --git a/drivers/vdpa/vdpa.c b/drivers/vdpa/vdpa.c > index 8d391947eb8d..532cf3b52b26 100644 > --- a/drivers/vdpa/vdpa.c > +++ b/drivers/vdpa/vdpa.c > @@ -1361,6 +1361,81 @@ static int vdpa_nl_cmd_dev_config_get_doit(struct > sk

Re: [PATH v6 3/3] vdpa/mlx5: Add the support of set mac address

2024-07-25 Thread Joe Damato
On Thu, Jul 25, 2024 at 09:31:04AM +0800, Cindy Lu wrote: > Add the function to support setting the MAC address. > For vdpa/mlx5, the function will use mlx5_mpfs_add_mac > to set the mac address > > Tested in ConnectX-6 Dx device > > Signed-off-by: Cindy Lu > --- > drivers/vdpa/mlx5/net/mlx5_vn

Re: [PATCH net-next v7 09/12] selftests: ncdevmem: Remove hard-coded queue numbers

2024-11-04 Thread Joe Damato
> 1 file changed, 38 insertions(+), 2 deletions(-) Reviewed-by: Joe Damato

Re: [PATCH net-next v7 12/12] selftests: ncdevmem: Add automated test

2024-11-04 Thread Joe Damato
On Mon, Nov 04, 2024 at 10:14:30AM -0800, Stanislav Fomichev wrote: > Only RX side for now and small message to test the setup. > In the future, we can extend it to TX side and to testing > both sides with a couple of megs of data. > > make \ > -C tools/testing/selftests \ > TARGETS=

Re: [PATCH net-next v7 10/12] selftests: ncdevmem: Run selftest when none of the -s or -c has been provided

2024-11-04 Thread Joe Damato
On Mon, Nov 04, 2024 at 10:14:28AM -0800, Stanislav Fomichev wrote: > This will be used as a 'probe' mode in the selftest to check whether > the device supports the devmem or not. Use hard-coded queue layout > (two last queues) and prevent user from passing custom -q and/or -t. > > Reviewed-by: Mi

[PATCH net-next v6 6/7] selftests: net: Add busy_poll_test

2024-11-04 Thread Joe Damato
(like defer_hard_irqs) and suspend. Signed-off-by: Joe Damato Co-developed-by: Martin Karsten Signed-off-by: Martin Karsten --- v5: - Updated commit message to replace netcat with socat and fixed misspelling of netdevsim. No functional/code changes. v4: - Updated busy_poll_te

Re: [PATCH net-next v7 01/12] selftests: ncdevmem: Redirect all non-payload output to stderr

2024-11-04 Thread Joe Damato
s/net/ncdevmem.c | 61 +- > 1 file changed, 30 insertions(+), 31 deletions(-) Reviewed-by: Joe Damato

Re: [PATCH net-next v7 02/12] selftests: ncdevmem: Separate out dmabuf provider

2024-11-04 Thread Joe Damato
1 file changed, 119 insertions(+), 84 deletions(-) Reviewed-by: Joe Damato

Re: [PATCH net-next v7 03/12] selftests: ncdevmem: Unify error handling

2024-11-04 Thread Joe Damato
setsockopt(socket_fd, SOL_SOCKET, SO_REUSEADDR, &opt, >sizeof(opt)); > if (ret) > - error(errno, errno, "%s: [FAIL, set sock opt]\n", TEST_PREFIX); > + error(1, errno, "%s: [FAIL, set sock opt]\n", TEST_PREFIX); A minor nit (definitely not worth re-sending for this on its own): it might be helpful to add which of the sockopts failed to the error message REUSEADDR or REUSEPORT. Reviewed-by: Joe Damato

Re: [PATCH net-next v7 04/12] selftests: ncdevmem: Make client_ip optional

2024-11-04 Thread Joe Damato
; tools/testing/selftests/net/ncdevmem.c | 12 +--- > 1 file changed, 9 insertions(+), 3 deletions(-) Reviewed-by: Joe Damato

Re: [PATCH net-next v7 06/12] selftests: ncdevmem: Switch to AF_INET6

2024-11-04 Thread Joe Damato
s/net/ncdevmem.c | 99 ++ > 1 file changed, 71 insertions(+), 28 deletions(-) Reviewed-by: Joe Damato

Re: [PATCH net-next v7 07/12] selftests: ncdevmem: Properly reset flow steering

2024-11-04 Thread Joe Damato
testing/selftests/net/ncdevmem.c | 19 --- > 1 file changed, 12 insertions(+), 7 deletions(-) Reviewed-by: Joe Damato

Re: [PATCH net-next v7 05/12] selftests: ncdevmem: Remove default arguments

2024-11-04 Thread Joe Damato
nt > and cleanup the client invocation a bit to make more readable. > > Reviewed-by: Mina Almasry > Signed-off-by: Stanislav Fomichev > --- > tools/testing/selftests/net/ncdevmem.c | 61 -- > 1 file changed, 39 insertions(+), 22 deletions(-) Reviewed-by: Joe Damato

Re: [PATCH net-next v7 08/12] selftests: ncdevmem: Use YNL to enable TCP header split

2024-11-04 Thread Joe Damato
ools/testing/selftests/net/ncdevmem.c | 57 +- > 2 files changed, 56 insertions(+), 3 deletions(-) Reviewed-by: Joe Damato

Re: [PATCH net-next v6 6/7] selftests: net: Add busy_poll_test

2024-11-05 Thread Joe Damato
On Mon, Nov 04, 2024 at 07:50:21PM -0800, Stanislav Fomichev wrote: > On 11/04, Joe Damato wrote: > > Add an epoll busy poll test using netdevsim. > > > > This test is comprised of: > > - busy_poller (via busy_poller.c) > > - busy_poll_test.sh which loads netd

Re: [PATCH net 3/4] virtio_net: Sync rss config to device when virtnet_probe

2024-11-05 Thread Joe Damato
gt; + } > + > virtnet_set_queues(vi, vi->curr_queue_pairs); > > /* a random MAC address has been assigned, notify the device. Acked-by: Joe Damato

Re: [PATCH net 2/4] virtio_net: Add hash_key_length check

2024-11-05 Thread Joe Damato
; > + err = -EINVAL; > + goto free; > + } I agree that an out of bounds error could occur and a check here is needed. I have no idea if returning -EINVAL from probe is the correct solution (vs say using min()) as I am just a casual observer of virtio_net and not a maintainer. Acked-by: Joe Damato

Re: [PATCH net 1/4] virtio_net: Support dynamic rss indirection table size

2024-11-05 Thread Joe Damato
) > + goto free; > > if (vi->has_rss || vi->has_rss_hash_report) { > vi->rss_key_size = > @@ -6674,6 +6701,8 @@ static void virtnet_remove(struct virtio_device *vdev) > > remove_vq_common(vi); > > + rss_indirection_table_free(&vi->rss); > + > free_netdev(vi->dev); > } > I'm not an expert on virtio, so I don't feel comfortable giving a Reviewed-by, but this does seem to fix a potential out of bounds access in virtnet_init_default_rss if rss_indir_table_size were larger than VIRTIO_NET_RSS_MAX_TABLE_LEN (128). Acked-by: Joe Damato

Re: [PATCH net 4/4] virtio_net: Update rss when set queue

2024-11-05 Thread Joe Damato
On Mon, Nov 04, 2024 at 04:57:06PM +0800, Philo Lu wrote: > RSS configuration should be updated with queue number. In particular, it > should be updated when (1) rss enabled and (2) default rss configuration > is used without user modification. > > During rss command processing, device updates que

Re: [PATCH net-next v3 6/7] selftests: net: Add busy_poll_test

2024-11-01 Thread Joe Damato
On Fri, Nov 01, 2024 at 06:34:26AM -0700, Jakub Kicinski wrote: > On Fri, 1 Nov 2024 00:48:33 +0000 Joe Damato wrote: > > + ip netns exec nscl nc -N 192.168.1.1 48675 < $tmp_file > > Thanks a lot for adding the test. Thanks for the review. > Could you replace nc with

[PATCH net-next v4 6/7] selftests: net: Add busy_poll_test

2024-11-01 Thread Joe Damato
(like defer_hard_irqs) and suspend. Signed-off-by: Joe Damato Co-developed-by: Martin Karsten Signed-off-by: Martin Karsten --- v4: - Updated busy_poll_test.sh: - use socat instead of nc - drop cli.py usage from the script - removed check_ynl - Updated busy_poller.c:

[PATCH net-next v5 6/7] selftests: net: Add busy_poll_test

2024-11-02 Thread Joe Damato
(like defer_hard_irqs) and suspend. Signed-off-by: Joe Damato Co-developed-by: Martin Karsten Signed-off-by: Martin Karsten --- v5: - Updated commit message to replace netcat with socat and fixed misspelling of netdevsim. No functional/code changes. v4: - Updated busy_poll_te

[PATCH net-next v3 6/7] selftests: net: Add busy_poll_test

2024-10-31 Thread Joe Damato
(like defer_hard_irqs) and suspend. Signed-off-by: Joe Damato Co-developed-by: Martin Karsten Signed-off-by: Martin Karsten --- v3: - New in v3 tools/testing/selftests/net/.gitignore| 1 + tools/testing/selftests/net/Makefile | 2 + tools/testing/selftests/net/busy_poll_te

[PATCH net-next v9 5/6] selftests: net: Add busy_poll_test

2024-11-08 Thread Joe Damato
(like defer_hard_irqs) and suspend. Signed-off-by: Joe Damato Co-developed-by: Martin Karsten Signed-off-by: Martin Karsten Acked-by: Stanislav Fomichev --- v9: - Based on feedback from Willem, in busy_poll_test.sh: - shortened long lines, - used more reader friendly variable

Re: [PATCH net-next v8 5/6] selftests: net: Add busy_poll_test

2024-11-08 Thread Joe Damato
On Fri, Nov 08, 2024 at 12:47:16PM -0500, Willem de Bruijn wrote: > Joe Damato wrote: > > On Fri, Nov 08, 2024 at 09:57:48AM -0500, Willem de Bruijn wrote: > > > Joe Damato wrote: [...] > > > > > > Nice test. > > > > > > Busy polling do

Re: [PATCH net-next v8 5/6] selftests: net: Add busy_poll_test

2024-11-08 Thread Joe Damato
On Fri, Nov 08, 2024 at 09:57:48AM -0500, Willem de Bruijn wrote: > Joe Damato wrote: [...] > > diff --git a/tools/testing/selftests/net/busy_poller.c > > b/tools/testing/selftests/net/busy_poller.c > > new file mode 100644 > > index ..8d8aa9e5939a > &

Re: [PATCH net-next v8 5/6] selftests: net: Add busy_poll_test

2024-11-08 Thread Joe Damato
On Fri, Nov 08, 2024 at 12:47:16PM -0500, Willem de Bruijn wrote: > Joe Damato wrote: > > On Fri, Nov 08, 2024 at 09:57:48AM -0500, Willem de Bruijn wrote: > > > Joe Damato wrote: > > > > Add an epoll busy poll test using netdevsim. > > &g

Re: [PATCH net-next v8 5/6] selftests: net: Add busy_poll_test

2024-11-08 Thread Joe Damato
On Fri, Nov 08, 2024 at 09:57:48AM -0500, Willem de Bruijn wrote: > Joe Damato wrote: > > Add an epoll busy poll test using netdevsim. > > > > This test is comprised of: > > - busy_poller (via busy_poller.c) > > - busy_poll_test.sh which loads netd

Re: [PATCH net-next v8 12/12] selftests: ncdevmem: Add automated test

2024-11-07 Thread Joe Damato
gt; > Reviewed-by: Mina Almasry > Signed-off-by: Stanislav Fomichev > --- > .../testing/selftests/drivers/net/hw/Makefile | 1 + > .../selftests/drivers/net/hw/devmem.py| 45 +++ > 2 files changed, 46 insertions(+) > create mode 100755 tools/testing/selftests/drivers/net/hw/devmem.py I'm not a python expert, but the changes make sense to me. Reviewed-by: Joe Damato

Re: [PATCH net-next v8 00/12] selftests: ncdevmem: Add ncdevmem to ksft

2024-11-07 Thread Joe Damato
On Thu, Nov 07, 2024 at 10:11:59AM -0800, Stanislav Fomichev wrote: > The goal of the series is to simplify and make it possible to use > ncdevmem in an automated way from the ksft python wrapper. > > ncdevmem is slowly mutated into a state where it uses stdout > to print the payload and the pytho

[PATCH net-next v7 5/6] selftests: net: Add busy_poll_test

2024-11-07 Thread Joe Damato
(like defer_hard_irqs) and suspend. Signed-off-by: Joe Damato Co-developed-by: Martin Karsten Signed-off-by: Martin Karsten Acked-by: Stanislav Fomichev --- v5: - Updated commit message to replace netcat with socat and fixed misspelling of netdevsim. No functional/code changes.

[PATCH net-next v8 5/6] selftests: net: Add busy_poll_test

2024-11-07 Thread Joe Damato
(like defer_hard_irqs) and suspend. Signed-off-by: Joe Damato Co-developed-by: Martin Karsten Signed-off-by: Martin Karsten Acked-by: Stanislav Fomichev --- v5: - Updated commit message to replace netcat with socat and fixed misspelling of netdevsim. No functional/code changes.

[PATCH net-next] selftests: net: cleanup busy_poller.c

2024-12-02 Thread Joe Damato
Fix various integer type conversions by using strtoull and a temporary variable which is bounds checked before being casted into the appropriate cfg_* variable for use by the test program. While here, free the strdup'd cfg string for overall hygenie. Signed-off-by: Joe Damato --- tools/te

Re: [PATCH net-next] selftests: net: cleanup busy_poller.c

2024-12-03 Thread Joe Damato
On Mon, Dec 02, 2024 at 09:14:58PM -0800, Stanislav Fomichev wrote: > On 12/03, Joe Damato wrote: > > Fix various integer type conversions by using strtoull and a temporary > > variable which is bounds checked before being casted into the > > appropriate cfg_* variable for us

Re: [PATCH net-next] selftests: net: cleanup busy_poller.c

2024-12-03 Thread Joe Damato
On Tue, Dec 03, 2024 at 08:26:11AM -0800, Joe Damato wrote: > On Mon, Dec 02, 2024 at 09:14:58PM -0800, Stanislav Fomichev wrote: > > On 12/03, Joe Damato wrote: > > > Fix various integer type conversions by using strtoull and a temporary > > > variable which is bounds

[PATCH net-next v2] selftests: net: cleanup busy_poller.c

2024-12-04 Thread Joe Damato
queue to avoid warnings on some compilers. Signed-off-by: Joe Damato --- v2: - initialize napi_id to 0 in setup_queue to avoid clang warning as suggested by Stanislav. Tested with clang 10.0.0 and 18.1.8 tools/testing/selftests/net/busy_poller.c | 88 +-- 1

[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

[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 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 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 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 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 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 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

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 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 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: [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 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

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-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-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-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 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 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: [PATCH net-next v2 3/4] virtio_net: Map NAPIs to queues

2025-01-21 Thread Joe Damato
On Thu, Jan 16, 2025 at 09:28:07PM +0100, Gerhard Engleder wrote: > On 16.01.25 17:09, Joe Damato wrote: > > On Thu, Jan 16, 2025 at 03:53:14PM +0800, Xuan Zhuo wrote: > > > On Thu, 16 Jan 2025 05:52:58 +, Joe Damato wrote: > > > > Use netif_queue_set_napi to

[RFC net-next v3 3/4] virtio_net: Map NAPIs to queues

2025-01-21 Thread Joe Damato
ndex': 2, 'napi-id': 8291, 'type': 'rx'}, {'id': 3, 'ifindex': 2, 'napi-id': 8292, 'type': 'rx'}, {'id': 0, 'ifindex': 2, 'type': 'tx'}, {'id': 1, 'ifindex':

[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, 

[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 +++--

Re: [PATCH net-next v2 3/4] virtio_net: Map NAPIs to queues

2025-01-21 Thread Joe Damato
On Mon, Jan 20, 2025 at 09:58:13AM +0800, Jason Wang wrote: > On Thu, Jan 16, 2025 at 3:57 PM Xuan Zhuo wrote: > > > > On Thu, 16 Jan 2025 05:52:58 +0000, Joe Damato wrote: > > > Use netif_queue_set_napi to map NAPIs to queue IDs so that the mapping > >

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: [PATCH net-next 3/3] virtio_net: Map NAPIs to queues

2025-01-13 Thread Joe Damato
On Mon, Jan 13, 2025 at 02:04:46PM -0800, Jakub Kicinski wrote: > On Mon, 13 Jan 2025 09:30:20 -0800 Joe Damato wrote: > > > > static void virtnet_napi_enable_lock(struct virtqueue *vq, > > > > -

Re: [PATCH net-next 3/3] virtio_net: Map NAPIs to queues

2025-01-13 Thread Joe Damato
On Mon, Jan 13, 2025 at 12:05:51PM +0800, Jason Wang wrote: > On Sat, Jan 11, 2025 at 4:26 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. > > > > $ ethtool -i ens4 | g

[PATCH net-next v2 0/4] virtio_net: Link queues to NAPIs

2025-01-15 Thread Joe Damato
Tested-by from patch 3. - patch 4: - New in v2. Adds persistent NAPI configuration. See commit message for more 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

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

2025-01-15 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-id

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

2025-01-15 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

[PATCH net-next v2 3/4] virtio_net: Map NAPIs to queues

2025-01-15 Thread Joe Damato
ndex': 2, 'napi-id': 8291, 'type': 'rx'}, {'id': 3, 'ifindex': 2, 'napi-id': 8292, 'type': 'rx'}, {'id': 0, 'ifindex': 2, 'type': 'tx'}, {'id': 1, 'ifindex':

Re: [PATCH net-next v2 3/4] virtio_net: Map NAPIs to queues

2025-01-16 Thread Joe Damato
On Thu, Jan 16, 2025 at 03:53:14PM +0800, Xuan Zhuo wrote: > On Thu, 16 Jan 2025 05:52:58 +0000, Joe Damato wrote: > > Use netif_queue_set_napi to map NAPIs to queue IDs so that the mapping > > can be accessed by user apps. > > > > $ ethtool -i ens4 | grep dr

[PATCH net-next 2/3] virtio_net: Hold RTNL for NAPI to queue mapping

2025-01-10 Thread Joe Damato
Prepare for NAPI to queue mapping by holding RTNL in code paths where NAPIs will be mapped to queue IDs and RTNL is not currently held. Signed-off-by: Joe Damato --- drivers/net/virtio_net.c | 17 ++--- 1 file changed, 14 insertions(+), 3 deletions(-) diff --git a/drivers/net

[PATCH net-next 3/3] virtio_net: Map NAPIs to queues

2025-01-10 Thread Joe Damato
ndex': 2, 'napi-id': 8291, 'type': 'rx'}, {'id': 3, 'ifindex': 2, 'napi-id': 8292, 'type': 'rx'}, {'id': 0, 'ifindex': 2, 'type': 'tx'}, {'id': 1, 'ifindex': 2

[PATCH net-next 0/3] virtio_net: Link queues to NAPIs

2025-01-10 Thread Joe Damato
Joe [1]: https://lore.kernel.org/netdev/20250109084301.2445a...@kernel.org/ Joe Damato (3): virtio_net: Prepare for NAPI to queue mapping virtio_net: Hold RTNL for NAPI to queue mapping virtio_net: Map NAPIs to queues drivers/net/virtio_net.c | 48 1 f

[PATCH net-next 1/3] virtio_net: Prepare for NAPI to queue mapping

2025-01-10 Thread Joe Damato
Slight refactor to prepare the code for NAPI to queue mapping. No functional changes. Signed-off-by: Joe Damato --- drivers/net/virtio_net.c | 10 -- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/drivers/net/virtio_net.c b/drivers/net/virtio_net.c index 7646ddd9bef7

[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 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 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 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

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

[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 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 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 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, &

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. > >

[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: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: > > > > > > >

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

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

  1   2   >