Re: [PATCH net-next v3 3/4] net: add dev_dstats_rx_dropped_add() helper

2025-06-17 Thread Joe Damato
gt; multiple dropped packets at once, such as when dropping entire queues. > > Signed-off-by: Breno Leitao > --- > include/linux/netdevice.h | 10 ++ > 1 file changed, 10 insertions(+) > Reviewed-by: Joe Damato

Re: [PATCH net-next v3 2/4] netdevsim: collect statistics at RX side

2025-06-17 Thread Joe Damato
he > TX path. > > Signed-off-by: Breno Leitao > --- > drivers/net/netdevsim/netdev.c | 12 ++-- > 1 file changed, 10 insertions(+), 2 deletions(-) > Thanks for moving the RX accounting around. Reviewed-by: Joe Damato

Re: [PATCH v2 59/62] livepatch/klp-build: Introduce klp-build script for generating livepatch modules

2025-06-12 Thread Joe Lawrence
n reverted. > - [[ -d "$SRC/.git" ]] && (cd "$SRC" && git update-index -q --refresh) > } > > validate_patches() { > Ah yes, even better. -- Joe

Re: [PATCH v2 59/62] livepatch/klp-build: Introduce klp-build script for generating livepatch modules

2025-06-11 Thread Joe Lawrence
atches() call - for --help, at the cleanup() -> revert_patches() call So if you don't like the conditional change above, should revert_patches() end with `true` to eat the [[ -d "$SRC/.git" ]] status? Or does that interfere with other calls to that function throughout the script? FWIW, with either adjustment, the script seems happy to operate on a plain ol' kernel source tree without git. -- Joe

Re: [PATCH v2 59/62] livepatch/klp-build: Introduce klp-build script for generating livepatch modules

2025-06-11 Thread Joe Lawrence
On 6/11/25 3:08 PM, Josh Poimboeuf wrote: > On Wed, Jun 11, 2025 at 02:44:35PM -0400, Joe Lawrence wrote: >>> +get_patch_files() { >>> + local patch="$1" >>> + >>> + grep0 -E '^(--- |\+\+\+ )' "

Re: [PATCH v2 59/62] livepatch/klp-build: Introduce klp-build script for generating livepatch modules

2025-06-11 Thread Joe Lawrence
ir/b" > + > + # Find all source files affected by the patch > + grep0 -E '^(--- |\+\+\+ )[^ /]+' "$patch" | > + sed -E 's/(--- |\+\+\+ )[^ /]+\///' | > + sort | uniq | mapfile -t files > + Should just call `get_patch_files() here? -- Joe

Re: [PATCH v2 52/62] objtool/klp: Introduce klp diff subcommand for diffing object files

2025-06-10 Thread Joe Lawrence
On 6/9/25 7:21 PM, Josh Poimboeuf wrote: > On Mon, Jun 09, 2025 at 02:32:19PM -0400, Joe Lawrence wrote: >> On Fri, May 09, 2025 at 01:17:16PM -0700, Josh Poimboeuf wrote: >>> +static int validate_ffunction_fdata_sections(struct elf *elf) >>> +{ >>> + struct

Re: [PATCH v2 59/62] livepatch/klp-build: Introduce klp-build script for generating livepatch modules

2025-06-09 Thread Joe Lawrence
On Fri, May 09, 2025 at 01:17:23PM -0700, Josh Poimboeuf wrote: > +revert_patch() { > + local patch="$1" > + shift > + local extra_args=("$@") > + local tmp=() > + > + ( cd "$SRC" && git apply --reverse "${extra_args[@]}" "$patch" ) > + git_refresh "$patch" > + > + for p

Re: [PATCH v2 59/62] livepatch/klp-build: Introduce klp-build script for generating livepatch modules

2025-06-09 Thread Joe Lawrence
On Mon, Jun 09, 2025 at 10:05:53PM -0400, Joe Lawrence wrote: > + # Copy symbol namespace > + readelf -p .modinfo "$ORIG_DIR/$rel_file" | \ > + gawk -F= '/\ namespaces Errr, that is $PATCHED_DIR/$rel_file if we want to pic

Re: [PATCH v2 59/62] livepatch/klp-build: Introduce klp-build script for generating livepatch modules

2025-06-09 Thread Joe Lawrence
On Mon, Jun 09, 2025 at 04:59:37PM -0700, Josh Poimboeuf wrote: > On Mon, Jun 09, 2025 at 05:20:53PM -0400, Joe Lawrence wrote: > > If you touch sound/soc/sof/intel/, klp-build will error out with: > > > > Building patch module: livepatch-unCVE-2024-58012.ko > &g

Re: [PATCH v2 59/62] livepatch/klp-build: Introduce klp-build script for generating livepatch modules

2025-06-09 Thread Joe Lawrence
ith: Building patch module: livepatch-unCVE-2024-58012.ko ERROR: modpost: module livepatch-unCVE-2024-58012 uses symbol hda_dai_config from namespace SND_SOC_SOF_INTEL_HDA_COMMON, but does not import it. ERROR: modpost: module livepatch-unCVE-2024-58012 uses symbol hdac_bus_eml_sdw_map_s

Re: [PATCH v2 52/62] objtool/klp: Introduce klp diff subcommand for diffing object files

2025-06-09 Thread Joe Lawrence
y [91] .rodata.nft_tunnel_policy I believe there are others like this, drivers/firmware/iscsi_ibft.o for one, so even though validate_ffunction_fdata_sections() only needs to find one .text. and one .data., not all objects may be able to provide that. At the same time, while we're here, what about other .text.* section prefixes? -- Joe

Re: [PATCH v2 59/62] livepatch/klp-build: Introduce klp-build script for generating livepatch modules

2025-06-06 Thread Joe Lawrence
cp -f "$file" "$patched_file" > + found=1 > + done > + xtrace_restore > + > + [[ -n "$found" ]] || die "no changes detected" > + Minor nit here, I gave it a patch for files that didn't compile and because because files() was presumably empty: ./scripts/livepatch/klp-build: line 564: found: unbound variable since found was only declared local, but never set inside the loop. -- Joe

Re: [PATCH v2 59/62] livepatch/klp-build: Introduce klp-build script for generating livepatch modules

2025-06-06 Thread Joe Lawrence
On 6/6/25 4:28 PM, Josh Poimboeuf wrote: > On Fri, Jun 06, 2025 at 12:03:45PM -0700, Josh Poimboeuf wrote: >> On Fri, Jun 06, 2025 at 09:05:59AM -0400, Joe Lawrence wrote: >>> Should the .cmd file copy come from the reference SRC and not original >>> ORIG director

Re: [PATCH v2 59/62] livepatch/klp-build: Introduce klp-build script for generating livepatch modules

2025-06-06 Thread Joe Lawrence
files Fixing patches Building patched kernel Copying patched object files Diffing objects vmlinux.o: changed function: cmdline_proc_show Building patch module: livepatch-test.ko <...>/klp-tmp/kmod/.vmlinux.o.cmd: No such file or directory make[2]: *** [scripts/Makefile.modpost:145: <...>/klp-tmp/kmod/Module.symvers] Error 1 make[1]: *** [<...>/Makefile:1936: modpost] Error 2 make: *** [Makefile:236: __sub-make] Error 2 The above edit worked for both your upstream branch and my downstream backport. -- Joe

Re: [PATCH v2 49/62] kbuild,objtool: Defer objtool validation step for CONFIG_LIVEPATCH

2025-05-28 Thread Joe Lawrence
against `.text'+173ecc * Note: I dropped ("[PATCH v2 45/62] x86/extable: Define ELF section entry size for exception tables") since it doesn't build as per the comment I left on that patch. -- Joe

Re: [PATCH v2 45/62] x86/extable: Define ELF section entry size for exception tables

2025-05-28 Thread Joe Lawrence
t; + BUILD_BUG_ON(EXTABLE_SIZE != sizeof(struct exception_table_entry)); > + but referenced in kernel/ where a non-x86 build like ppc64le build won't know what EXTABLE_SIZE is :( -- Joe

Re: [PATCH v2 35/62] objtool: Refactor add_jump_destinations()

2025-05-23 Thread Joe Lawrence
if (dest_sym->return_thunk) { > add_return_call(file, insn, true); > continue; > - } else if (func) { > - /* > - * External sibling call or internal sibling call with > - * STT_FUNC reloc. > - */ > - ret = add_call_dest(file, insn, reloc->sym, true); > - if (ret) > - return ret; > - continue; > - } else if (reloc->sym->sec->idx) { > - dest_sec = reloc->sym->sec; > - dest_off = reloc->sym->sym.st_value + > -arch_dest_reloc_offset(reloc_addend(reloc)); Way back in ("[PATCH v2 18/62] objtool: Fix x86 addend calculation"), arch_dest_reloc_offset() was replaced with arch_insn_adjusted_addend(), so I think that patch missed this callsite and breaks bisectability. -- Joe

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
IDs. The test itself (patch 3) introduces a C helper because apparently python doesn't have socket.SO_INCOMING_NAPI_ID. Thanks, Joe v4: - Updated the macro guard in patch 2 - Removed the remote deploy from patch 3 v3: https://lore.kernel.org/netdev/20250418013719.12094-1-jdam...@f

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
test itself (patch 4) introduces a C helper because apparently python doesn't have socket.SO_INCOMING_NAPI_ID. Thanks, Joe v2: - No longer an RFC - Minor whitespace change in patch 1 (no functional change). - Patches 2-4 new in v2 rfcv1: https://lore.kernel.org/netdev/2025032930.39

[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
IDs. The test itself (patch 4) introduces a C helper because apparently python doesn't have socket.SO_INCOMING_NAPI_ID. Thanks, Joe v3: - Dropped patch 3 from v2 as it is no longer necessary. - Patch 3 from this series (which was patch 4 in the v2) - Sorted .gitignore alphabetically

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: [PATCH v2 10/12] checkpatch: Deprecate srcu_read_lock_lite() and srcu_read_unlock_lite()

2025-04-05 Thread Joe Perches
On Mon, 2025-03-31 at 14:03 -0700, Paul E. McKenney wrote: > Uses of srcu_read_lock_lite() and srcu_read_unlock_lite() are better > served by the new srcu_read_lock_fast() and srcu_read_unlock_fast() APIs. > As in srcu_read_lock_lite() and srcu_read_unlock_lite() would never have > happened had I t

Re: [PATCH v2 10/12] checkpatch: Deprecate srcu_read_lock_lite() and srcu_read_unlock_lite()

2025-04-01 Thread Joe Perches
On Tue, 2025-04-01 at 21:23 -0700, Paul E. McKenney wrote: > On Tue, Apr 01, 2025 at 08:48:44PM -0700, Joe Perches wrote: > > On Tue, 2025-04-01 at 07:05 -0700, Paul E. McKenney wrote: > > > On Mon, Mar 31, 2025 at 11:53:25PM -0700, Joe Perches wrote: > > > > On

Re: [PATCH v2 10/12] checkpatch: Deprecate srcu_read_lock_lite() and srcu_read_unlock_lite()

2025-04-01 Thread Joe Perches
On Tue, 2025-04-01 at 07:05 -0700, Paul E. McKenney wrote: > On Mon, Mar 31, 2025 at 11:53:25PM -0700, Joe Perches wrote: > > On Mon, 2025-03-31 at 14:03 -0700, Paul E. McKenney wrote: > > > Uses of srcu_read_lock_lite() and srcu_read_unlock_lite() are better >

Re: [PATCH v3 0/2] selftests: livepatch: test if ftrace can trace a livepatched function

2025-03-25 Thread Joe Lawrence
> https://lore.kernel.org/r/20250318-ftrace-sftest-livepatch-v2-0-60cb0aa95...@gmail.com > For both patches: Acked-by: Joe Lawrence Thanks, -- Joe

Re: [PATCH v2 2/2] selftests: livepatch: test if ftrace can trace a livepatched function

2025-03-24 Thread Joe Lawrence
quot;selftests: livepatch: rename KLP_SYSFS_DIR to SYSFS_KLP_DIR") tweaked the functions.sh::SYSFS_KLP_DIR and then updated all of the test-*.sh scripts to use the variable instead of the spelled out "/sys/kernel/livepatch" string. So if there if there is another patchset version, s/\/sys\/kernel\/livepatch/$SYSFS_KLP_DIR/g -- Joe

Re: [PATCH v2 1/2] selftests: livepatch: add new ftrace helpers functions

2025-03-24 Thread Joe Lawrence
from certain whether which order is better than the other. The only reason for bringing it up is that shellcheck warns on this patch's usage. [1] https://www.shellcheck.net/ -- Joe

Re: [PATCH v2 1/2] selftests: livepatch: add new ftrace helpers functions

2025-03-24 Thread Joe Lawrence
ot;$SYSFS_TRACING_DIR/tracing_on" > +} > + > +# check_traced_functions(functions...) - check whether each function > appeared in the trace log > +#functions - list of functions to be checked > +function check_traced_functions() { > + local function > + > + for function in "$@"; do > + if ! grep -q "$function" "$SYSFS_TRACING_DIR/trace" ; then Small suggestion here: grep on "$function" may find partial string matches, like: $ echo 'hamburger' | grep 'ham' hamburger so it's probably safer to user --word-regexp to avoid longer function names inadvertently matching: $ echo 'hamburger' | grep -w 'ham' $ echo 'ham' | grep -w 'ham' ham Also, maybe also --fixed-strings for the extra paranoid? Off the top of my head, I don't think any C function characters are special regex (like $ ^ [ ] etc.) so it's probably safe w/o. -- Joe

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
osed and extending sendfile based on the SO_ZEROCOPY sock flag being set are both unacceptable solutions. If you happen to have a suggestion of some piece of code that I should read (other than the iouring implementation) to inform how I might build an RFCv2, I would appreciate the pointer. Thanks for your time and energy, Joe

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
dback. I based my code on the vfs/for-next tree, but am happy to rebase on another tree if desired. The cc-list got a little out of control, so I manually trimmed it down quite a bit; sorry if I missed anyone I should have CC'd in the process. Thanks, Joe [1]: https://lore.kernel.org/netdev/

Re: [PATCH v1 18/19] Documentation/livepatch: Update documentation for state, callbacks, and shadow variables

2025-03-07 Thread Joe Lawrence
On 3/7/25 07:26, Petr Mladek wrote: > On Thu 2025-03-06 17:54:41, Joe Lawrence wrote: >> >> With that in mind, a livepatch state could be thought of as an >> indication of "a context needing special handling in a (versioned) way". > > I am not sure abou

[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

Re: [PATCH v1 18/19] Documentation/livepatch: Update documentation for state, callbacks, and shadow variables

2025-03-06 Thread Joe Lawrence
In a perfect world, we could describe livepatching states absent callbacks and shadow variables. The documentation is a bit circular as one needs to understand them before fully grasping the purpose of the states. But to use them, you will first need to understand how to set them up in the states. :) Maybe there is no better way, but first I need to correct my understanding. Thanks, -- Joe

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

2025-03-06 Thread Joe Damato
as been left as suggested by Jakub [5] for future work. See the commit message of patch 3 for an example of how to get the NAPI to queue mapping information. See the commit message of patch 4 for an example of how NAPI IDs are persistent despite queue count changes. Thanks, Joe [1]: https://lore.ke

[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
for an example of how to get the NAPI to queue mapping information. See the commit message of patch 4 for an example of how NAPI IDs are persistent despite queue count changes. Thanks, Joe [1]: https://lore.kernel.org/netdev/20250221142650.3c74d...@kernel.org/ [2]: https://lore.ke

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
mit message of patch 4 for an example of how NAPI IDs are persistent despite queue count changes. Thanks, Joe v4: - Dropped Jakub's patch (previously patch 1). - Significant refactor from v3 affecting patches 1-3. - Patch 4 added tags from Jason and Gerhard. rfcv3: https

[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
d for AF_XDP do not have the xsk attribute present. I've run the included test on: - my mlx5 machine (via NETIF=) - without setting NETIF And the test seems to pass in both cases. Thanks, Joe [1]: https://lore.kernel.org/netdev/20250113143109.60afa...@kernel.org/ [2]: https://lore.kernel.

[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
ve run the included test on: - my mlx5 machine (via NETIF=) - without setting NETIF And the test seems to pass in both cases. Thanks, Joe [1]: https://lore.kernel.org/netdev/20250113143109.60afa...@kernel.org/ [2]: https://lore.kernel.org/netdev/20250129172431.65773-1-jdam...@fastly.com/ v7:

[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
F And the test seems to pass in both cases. Thanks, Joe [1]: https://lore.kernel.org/netdev/20250113143109.60afa...@kernel.org/ [2]: https://lore.kernel.org/netdev/20250129172431.65773-1-jdam...@fastly.com/ v7: - Added CONFIG_XDP_SOCKETS to selftests/driver/net/config as suggested by

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

2025-02-12 Thread Joe Damato
t; > I'd keep your test as is (fail hard if XSK is not there), but > > let's see if Paolo/Jakub have any other suggestions. > > No strong preference. Stan is right that validating the environment > is definitely a non-goal for the upstream tests. But if you already > added and tested the checks Joe you can keep them, up to you. OK. I guess I'll just leave them? They are as described earlier in the thread.

  1   2   3   4   5   6   7   8   9   10   >