Re: [PATCH v2] selftests: pid_namespace: Add missing sys/mount.h

2025-04-09 Thread Peter Seiderer
Hello T.J., On Tue, 8 Apr 2025 23:02:02 +, "T.J. Mercier" wrote: > pid_max.c: In function ‘pid_max_cb’: > pid_max.c:42:15: error: implicit declaration of function ‘mount’ >[-Wimplicit-function-declaration] >42 | ret = mount("", "/", NULL,

[PATCH net-next v1 1/2] net: pktgen: add strict buffer parsing index check

2025-03-17 Thread Peter Seiderer
he current indirect (but correct) error handling. Reported-by: Dan Carpenter Closes: https://lore.kernel.org/netdev/36cf3ee2-38b1-47e5-a42a-363efeb0ace3@stanley.mountain/ Signed-off-by: Peter Seiderer --- net/core/pktgen.c | 8 1 file changed, 8 insertions(+) diff --git a/net/core/pktgen.c

[PATCH net-next v1 2/2] selftest: net: update proc_net_pktgen (add more imix_weights test cases)

2025-03-17 Thread Peter Seiderer
Add more imix_weights test cases (for incomplete input). Signed-off-by: Peter Seiderer --- tools/testing/selftests/net/proc_net_pktgen.c | 44 +++ 1 file changed, 44 insertions(+) diff --git a/tools/testing/selftests/net/proc_net_pktgen.c b/tools/testing/selftests/net

Re: [PATCH 0/2] selftests/pidfd: Fix missing headers

2025-03-03 Thread Peter Seiderer
Hello Siddharth, On Mon, 3 Mar 2025 02:22:44 +0530, Siddharth Menon wrote: > Fix compilation errors caused by missing headers in the pidfd selftest. > > The errors include: > pidfd_fdinfo_test.c:230:13: error: implicit declaration of function ‘mount’ > pidfd_setns_test.c:172:54: error: implici

[PATCH net-next v8 4/8] net: pktgen: fix mpls maximum labels list parsing

2025-02-27 Thread Peter Seiderer
00f0e,0f0f" > /proc/net/pktgen/lo\@0 -bash: echo: write error: Argument list too long Signed-off-by: Peter Seiderer Reviewed-by: Simon Horman --- Changes v7 -> v8 - rebased on actual net-next/main - slightly rephrase commit message, omit '/16' (suggested by Paol

[PATCH net-next v8 3/8] net: pktgen: remove some superfluous variable initializing

2025-02-27 Thread Peter Seiderer
Remove some superfluous variable initializing before hex32_arg call (as the same init is done here already). Signed-off-by: Peter Seiderer Reviewed-by: Simon Horman --- Changes v7 -> v8 - rebased on actual net-next/main - no changes Changes v6 -> v7 - rebased on actual net-nex

[PATCH net-next v8 1/8] net: pktgen: fix mix of int/long

2025-02-27 Thread Peter Seiderer
Fix mix of int/long (and multiple conversion from/to) by using consequently size_t for i and max and ssize_t for len and adjust function signatures of hex32_arg(), count_trail_chars(), num_arg() and strn_len() accordingly. Signed-off-by: Peter Seiderer Reviewed-by: Simon Horman --- Changes v7

[PATCH net-next v8 6/8] net: pktgen: fix mpls reset parsing

2025-02-27 Thread Peter Seiderer
/proc/net/pktgen/lo\@0 $ grep mpls /proc/net/pktgen/lo\@0 Result: OK: mpls= $ echo "mpls 0001,0002" > /proc/net/pktgen/lo\@0 $ echo "mpls invalid" > /proc/net/pktgen/lo\@0 $ grep mpls /proc/net/pktgen/lo\@0 Result: OK: m

[PATCH net-next v8 8/8] selftest: net: add proc_net_pktgen

2025-02-27 Thread Peter Seiderer
Add some test for /proc/net/pktgen/... interface. - enable 'CONFIG_NET_PKTGEN=m' in tools/testing/selftests/net/config Signed-off-by: Peter Seiderer Reviewed-by: Simon Horman --- Changes v7 -> v8 - rebased on actual net-next/main - fix c99 comments (suggested by Paolo Abeni)

[PATCH net-next v8 0/8] Some pktgen fixes/improvments (part II)

2025-02-27 Thread Peter Seiderer
nski) - fix some checkpatch warnings (Missing a blank line after declarations) - shrink line length by re-naming some variables (command -> cmd, device -> dev) - add 'rate 0' testcase - add 'ratep 0' testcase [1] https://lore.kernel.org/netdev/2024100

[PATCH net-next v8 2/8] net: pktgen: remove extra tmp variable (re-use len instead)

2025-02-27 Thread Peter Seiderer
Remove extra tmp variable in pktgen_if_write (re-use len instead). Signed-off-by: Peter Seiderer Reviewed-by: Simon Horman --- Changes v7 -> v8 - rebased on actual net-next/main - no changes Changes v6 -> v7 - rebased on actual net-next/main - no changes Changes v5 ->

[PATCH net-next v8 7/8] net: pktgen: remove all superfluous index assignements

2025-02-27 Thread Peter Seiderer
Remove all superfluous index ('i += len') assignements (value not used afterwards). Signed-off-by: Peter Seiderer Reviewed-by: Simon Horman --- Changes v7 -> v8 - rebased on actual net-next/main - no changes Changes v6 -> v7 - rebased on actual net-next/main - no cha

[PATCH net-next v8 5/8] net: pktgen: fix access outside of user given buffer in pktgen_if_write()

2025-02-27 Thread Peter Seiderer
Honour the user given buffer size for the hex32_arg(), num_arg(), strn_len(), get_imix_entries() and get_labels() calls (otherwise they will access memory outside of the user given buffer). Signed-off-by: Peter Seiderer Reviewed-by: Simon Horman --- Changes v7 -> v8 - rebased on actual

Re: [PATCH net-next v7 4/8] net: pktgen: fix mpls maximum labels list parsing

2025-02-27 Thread Peter Seiderer
Hello Paolo, On Thu, 27 Feb 2025 11:24:48 +0100, Paolo Abeni wrote: > On 2/24/25 10:22 AM, Peter Seiderer wrote: > > Fix mpls maximum labels list parsing up to MAX_MPLS_LABELS/16 entries > > (instead of up to MAX_MPLS_LABELS - 1). > > Very minor nit... > > The above

Re: [PATCH net-next v7 6/8] net: pktgen: fix mpls reset parsing

2025-02-27 Thread Peter Seiderer
On Thu, 27 Feb 2025 11:19:33 +0100, Paolo Abeni wrote: > On 2/24/25 10:22 AM, Peter Seiderer wrote: > > diff --git a/net/core/pktgen.c b/net/core/pktgen.c > > index ae5e81e62733..bb13a4591709 100644 > > --- a/net/core/pktgen.c > > +++ b/net/core/pktgen.c > > @@

Re: [PATCH net-next v7 1/8] net: pktgen: fix mix of int/long

2025-02-24 Thread Peter Seiderer
Hello *, On Mon, 24 Feb 2025 10:22:35 +0100, Peter Seiderer wrote: > Fix mix of int/long (and multiple conversion from/to) by using consequently > size_t for i and max and ssize_t for len and adjust function signatures > of hex32_arg(), count_trail_chars(), num_arg() and strn_len() ac

[PATCH net-next v7 3/8] net: pktgen: remove some superfluous variable initializing

2025-02-24 Thread Peter Seiderer
Remove some superfluous variable initializing before hex32_arg call (as the same init is done here already). Signed-off-by: Peter Seiderer Reviewed-by: Simon Horman --- Changes v6 -> v7 - rebased on actual net-next/main - no changes Changes v5 -> v6 - adjust to dropped patch

[PATCH net-next v7 8/8] selftest: net: add proc_net_pktgen

2025-02-24 Thread Peter Seiderer
Add some test for /proc/net/pktgen/... interface. - enable 'CONFIG_NET_PKTGEN=m' in tools/testing/selftests/net/config Signed-off-by: Peter Seiderer --- Changes v6 -> v7 - rebased on actual net-next/main - fixed conflict in tools/testing/selftests/net/config Changes v5 -> v

[PATCH net-next v7 1/8] net: pktgen: fix mix of int/long

2025-02-24 Thread Peter Seiderer
Fix mix of int/long (and multiple conversion from/to) by using consequently size_t for i and max and ssize_t for len and adjust function signatures of hex32_arg(), count_trail_chars(), num_arg() and strn_len() accordingly. Signed-off-by: Peter Seiderer --- Changes v6 -> v7 - rebased on act

[PATCH net-next v7 5/8] net: pktgen: fix access outside of user given buffer in pktgen_if_write()

2025-02-24 Thread Peter Seiderer
Honour the user given buffer size for the hex32_arg(), num_arg(), strn_len(), get_imix_entries() and get_labels() calls (otherwise they will access memory outside of the user given buffer). Signed-off-by: Peter Seiderer Reviewed-by: Simon Horman --- Changes v6 -> v7 - rebased on actual

[PATCH net-next v7 0/8] Some pktgen fixes/improvments (part II)

2025-02-24 Thread Peter Seiderer
- shrink line length by re-naming some variables (command -> cmd, device -> dev) - add 'rate 0' testcase - add 'ratep 0' testcase [1] https://lore.kernel.org/netdev/20241006221221.3744995-1-artem.chernys...@red-soft.ru/ [2] https://lore.kernel.org/netdev/20250

[PATCH net-next v7 2/8] net: pktgen: remove extra tmp variable (re-use len instead)

2025-02-24 Thread Peter Seiderer
Remove extra tmp variable in pktgen_if_write (re-use len instead). Signed-off-by: Peter Seiderer Reviewed-by: Simon Horman --- Changes v6 -> v7 - rebased on actual net-next/main - no changes Changes v5 -> v6 - no changes Changes v4 -> v5 - split up patchset into part i/ii (

[PATCH net-next v7 4/8] net: pktgen: fix mpls maximum labels list parsing

2025-02-24 Thread Peter Seiderer
00f0e,0f0f" > /proc/net/pktgen/lo\@0 -bash: echo: write error: Argument list too long Signed-off-by: Peter Seiderer Reviewed-by: Simon Horman --- Changes v6 -> v7 - rebased on actual net-next/main - no changes Changes v5 -> v6 - adjust to dropped patch ''net

[PATCH net-next v7 6/8] net: pktgen: fix mpls reset parsing

2025-02-24 Thread Peter Seiderer
/proc/net/pktgen/lo\@0 $ grep mpls /proc/net/pktgen/lo\@0 Result: OK: mpls= $ echo "mpls 0001,0002" > /proc/net/pktgen/lo\@0 $ echo "mpls invalid" > /proc/net/pktgen/lo\@0 $ grep mpls /proc/net/pktgen/lo\@0 Result:

[PATCH net-next v7 7/8] net: pktgen: remove all superfluous index assignements

2025-02-24 Thread Peter Seiderer
Remove all superfluous index ('i += len') assignements (value not used afterwards). Signed-off-by: Peter Seiderer Reviewed-by: Simon Horman --- Changes v6 -> v7 - rebased on actual net-next/main - no changes Changes v5 -> v6 - add rev-by Simon Horman Changes v4 -&g

[PATCH net-next v6 0/8] Some pktgen fixes/improvments (part II)

2025-02-21 Thread Peter Seiderer
obe pktgen to FIXTURE_SETUP() (suggested by Jakub Kicinski) - fix some checkpatch warnings (Missing a blank line after declarations) - shrink line length by re-naming some variables (command -> cmd, device -> dev) - add 'rate 0' testcase - add 'ratep 0&#

[PATCH net-next v6 6/8] net: pktgen: fix mpls reset parsing

2025-02-21 Thread Peter Seiderer
/proc/net/pktgen/lo\@0 $ grep mpls /proc/net/pktgen/lo\@0 Result: OK: mpls= $ echo "mpls 0001,0002" > /proc/net/pktgen/lo\@0 $ echo "mpls invalid" > /proc/net/pktgen/lo\@0 $ grep mpls /proc/net/pktgen/lo\@0 Result: OK:

[PATCH net-next v6 8/8] selftest: net: add proc_net_pktgen

2025-02-21 Thread Peter Seiderer
Add some test for /proc/net/pktgen/... interface. - enable 'CONFIG_NET_PKTGEN=m' in tools/testing/selftests/net/config Signed-off-by: Peter Seiderer --- Changes v5 -> v6 - no changes Changes v4 -> v5 - split up patchset into part i/ii (suggested by Simon Horman) - addapt

[PATCH net-next v6 1/8] net: pktgen: fix mix of int/long

2025-02-21 Thread Peter Seiderer
Fix mix of int/long (and multiple conversion from/to) by using consequently size_t for i and max and ssize_t for len and adjust function signatures of hex32_arg(), count_trail_chars(), num_arg() and strn_len() accordingly. Signed-off-by: Peter Seiderer --- Changes v5 -> v6 - adjust to drop

[PATCH net-next v6 5/8] net: pktgen: fix access outside of user given buffer in pktgen_if_write()

2025-02-21 Thread Peter Seiderer
Honour the user given buffer size for the hex32_arg(), num_arg(), strn_len(), get_imix_entries() and get_labels() calls (otherwise they will access memory outside of the user given buffer). Signed-off-by: Peter Seiderer Reviewed-by: Simon Horman --- Changes v5 -> v6 - adjust to dropped pa

[PATCH net-next v6 7/8] net: pktgen: remove all superfluous index assignements

2025-02-21 Thread Peter Seiderer
Remove all superfluous index ('i += len') assignements (value not used afterwards). Signed-off-by: Peter Seiderer Reviewed-by: Simon Horman --- Changes v5 -> v6 - add rev-by Simon Horman Changes v4 -> v5 - new patch (suggested by Simon Horman) --- net/co

[PATCH net-next v6 3/8] net: pktgen: remove some superfluous variable initializing

2025-02-21 Thread Peter Seiderer
Remove some superfluous variable initializing before hex32_arg call (as the same init is done here already). Signed-off-by: Peter Seiderer Reviewed-by: Simon Horman --- Changes v5 -> v6 - adjust to dropped patch ''net: pktgen: use defines for the various dec/hex number p

[PATCH net-next v6 4/8] net: pktgen: fix mpls maximum labels list parsing

2025-02-21 Thread Peter Seiderer
00f0e,0f0f" > /proc/net/pktgen/lo\@0 -bash: echo: write error: Argument list too long Signed-off-by: Peter Seiderer Reviewed-by: Simon Horman --- Changes v5 -> v6 - adjust to dropped patch ''net: pktgen: use defines for the various dec/hex number parsing digi

[PATCH net-next v6 2/8] net: pktgen: remove extra tmp variable (re-use len instead)

2025-02-21 Thread Peter Seiderer
Remove extra tmp variable in pktgen_if_write (re-use len instead). Signed-off-by: Peter Seiderer Reviewed-by: Simon Horman --- Changes v5 -> v6 - no changes Changes v4 -> v5 - split up patchset into part i/ii (suggested by Simon Horman) - add rev-by Simon Horman Changes v3 -> v

Re: [PATCH] selftests: pid_namespace and pidfd missing include

2025-02-20 Thread Peter Seiderer
On Tue, 18 Feb 2025 17:26:19 -0700, Shuah Khan wrote: > On 2/12/25 17:24, Alessandro Zanni wrote: > >> Running "make kselftest" results in several errors like these: > >> > >> pidfd_fdinfo_test.c:231:36: error: ‘MS_REC’ undeclared (first use in > >> this function) > >>231 | r = mount

[PATCH net-next v6 6/7] net: pktgen: fix ctrl interface command parsing

2025-02-19 Thread Peter Seiderer
ith patch applied $ echo -n "reset" > /proc/net/pktgen/pgctrl Signed-off-by: Peter Seiderer Reviewed-by: Simon Horman --- Changes v5 -> v6 - no changes Changes v4 -> v5 - split up patchset into part i/ii (suggested by Simon Horman) Changes v3 -> v4 - add rev-by

[PATCH net-next v6 3/7] net: pktgen: fix hex32_arg parsing for short reads

2025-02-19 Thread Peter Seiderer
Result: OK: mpls=1230 - with patch applied $ echo "mpls 123" > /proc/net/pktgen/lo\@0 $ grep mpls /proc/net/pktgen/lo\@0 mpls: 0123 Result: OK: mpls=0123 Signed-off-by: Peter Seiderer Reviewed-by: Simon Horman --- Chang

[PATCH net-next v6 7/7] net: pktgen: fix access outside of user given buffer in pktgen_thread_write()

2025-02-19 Thread Peter Seiderer
Honour the user given buffer size for the strn_len() calls (otherwise strn_len() will access memory outside of the user given buffer). Signed-off-by: Peter Seiderer Reviewed-by: Simon Horman --- Changes v5 -> v6 - no changes Changes v4 -> v5 - split up patchset into part i/ii (sugges

[PATCH net-next v6 1/7] net: pktgen: replace ENOTSUPP with EOPNOTSUPP

2025-02-19 Thread Peter Seiderer
Replace ENOTSUPP with EOPNOTSUPP, fixes checkpatch hint WARNING: ENOTSUPP is not a SUSV4 error code, prefer EOPNOTSUPP and e.g. $ echo "clone_skb 1" > /proc/net/pktgen/lo\@0 -bash: echo: write error: Unknown error 524 Signed-off-by: Peter Seiderer Reviewed-by: Simon Horman

[PATCH net-next v6 4/7] net: pktgen: fix 'rate 0' error handling (return -EINVAL)

2025-02-19 Thread Peter Seiderer
applied $ echo "rate 0" > /proc/net/pktgen/lo\@0 -bash: echo: write error: Invalid argument $ grep "Result:" /proc/net/pktgen/lo\@0 Result: Idle Signed-off-by: Peter Seiderer Reviewed-by: Simon Horman --- Changes v5 -> v6 - no changes Changes

[PATCH net-next v6 0/7] Some pktgen fixes/improvments (part I)

2025-02-19 Thread Peter Seiderer
after declarations) - shrink line length by re-naming some variables (command -> cmd, device -> dev) - add 'rate 0' testcase - add 'ratep 0' testcase [1] https://lore.kernel.org/netdev/20241006221221.3744995-1-artem.chernys...@red-soft.ru/ [2] https://lore

[PATCH net-next v6 5/7] net: pktgen: fix 'ratep 0' error handling (return -EINVAL)

2025-02-19 Thread Peter Seiderer
applied $ echo "ratep 0" > /proc/net/pktgen/lo\@0 -bash: echo: write error: Invalid argument $ grep "Result:" /proc/net/pktgen/lo\@0 Result: Idle Signed-off-by: Peter Seiderer Reviewed-by: Simon Horman --- Changes v5 -> v6 - no change

[PATCH net-next v6 2/7] net: pktgen: enable 'param=value' parsing

2025-02-19 Thread Peter Seiderer
> /proc/net/pktgen/lo\@0 $ echo "min_pkt_size=999" > /proc/net/pktgen/lo\@0 $ echo "min_pkt_size =999" > /proc/net/pktgen/lo\@0 $ echo "min_pkt_size= 999" > /proc/net/pktgen/lo\@0 $ echo "min_pkt_size = 999" > /proc/net/pktge

Re: [PATCH net-next v5 8/8] net: pktgen: use defines for the various dec/hex number parsing digits lengths

2025-02-19 Thread Peter Seiderer
> On Thu, 13 Feb 2025 12:00:25 +0100 Peter Seiderer wrote: > > > > > Use defines for the various dec/hex number parsing digits lengths > > > > > (hex32_arg/num_arg calls). > > > > > > > > I don't understand the v

[PATCH net-next v5 4/8] net: pktgen: fix mpls maximum labels list parsing

2025-02-13 Thread Peter Seiderer
00f0e,0f0f" > /proc/net/pktgen/lo\@0 -bash: echo: write error: Argument list too long Signed-off-by: Peter Seiderer --- Changes v4 -> v5 - split up patchset into part i/ii (suggested by Simon Horman) - change patch description ('Fixes:' -> 'Addresses the f

[PATCH net-next v5 7/8] net: pktgen: remove all superfluous index assignements

2025-02-13 Thread Peter Seiderer
Remove all superfluous index ('i += len') assignements (value not used afterwards). Signed-off-by: Peter Seiderer --- Changes v4 -> v5 - new patch (suggested by Simon Horman) --- net/core/pktgen.c | 52 ++- 1 file changed, 6 inse

[PATCH net-next v5 8/8] selftest: net: add proc_net_pktgen

2025-02-13 Thread Peter Seiderer
Add some test for /proc/net/pktgen/... interface. - enable 'CONFIG_NET_PKTGEN=m' in tools/testing/selftests/net/config Signed-off-by: Peter Seiderer --- Changes v4 -> v5 - split up patchset into part i/ii (suggested by Simon Horman) - addapt to dropped patch 'net: pktgen:

[PATCH net-next v5 5/8] net: pktgen: fix access outside of user given buffer in pktgen_if_write()

2025-02-13 Thread Peter Seiderer
Honour the user given buffer size for the hex32_arg(), num_arg(), strn_len(), get_imix_entries() and get_labels() calls (otherwise they will access memory outside of the user given buffer). Signed-off-by: Peter Seiderer Reviewed-by: Simon Horman --- Changes v4 -> v5 - split up patchset i

[PATCH net-next v5 1/8] net: pktgen: fix mix of int/long

2025-02-13 Thread Peter Seiderer
Fix mix of int/long (and multiple conversion from/to) by using consequently size_t for i and max and ssize_t for len and adjust function signatures of hex32_arg(), count_trail_chars(), num_arg() and strn_len() accordingly. Signed-off-by: Peter Seiderer --- Changes v4 -> v5 - split up patch

[PATCH net-next v5 3/8] net: pktgen: remove some superfluous variable initializing

2025-02-13 Thread Peter Seiderer
Remove some superfluous variable initializing before hex32_arg call (as the same init is done here already). Signed-off-by: Peter Seiderer Reviewed-by: Simon Horman --- Changes v4 -> v5 - split up patchset into part i/ii (suggested by Simon Horman) - add rev-by Simon Horman Changes

[PATCH net-next v5 6/8] net: pktgen: fix mpls reset parsing

2025-02-13 Thread Peter Seiderer
/proc/net/pktgen/lo\@0 $ grep mpls /proc/net/pktgen/lo\@0 Result: OK: mpls= $ echo "mpls 0001,0002" > /proc/net/pktgen/lo\@0 $ echo "mpls invalid" > /proc/net/pktgen/lo\@0 $ grep mpls /proc/net/pktgen/lo\@0 Result:

[PATCH net-next v5 2/8] net: pktgen: remove extra tmp variable (re-use len instead)

2025-02-13 Thread Peter Seiderer
Remove extra tmp variable in pktgen_if_write (re-use len instead). Signed-off-by: Peter Seiderer Reviewed-by: Simon Horman --- Changes v4 -> v5 - split up patchset into part i/ii (suggested by Simon Horman) - add rev-by Simon Horman Changes v3 -> v4 - new patch (factored out of

[PATCH net-next v5 0/8] Some pktgen fixes/improvments (part II)

2025-02-13 Thread Peter Seiderer
(Missing a blank line after declarations) - shrink line length by re-naming some variables (command -> cmd, device -> dev) - add 'rate 0' testcase - add 'ratep 0' testcase [1] https://lore.kernel.org/netdev/20241006221221.3744995-1-artem.chernys...@red-soft.ru/

[PATCH net-next v5 6/8] net: pktgen: fix ctrl interface command parsing

2025-02-13 Thread Peter Seiderer
ith patch applied $ echo -n "reset" > /proc/net/pktgen/pgctrl Signed-off-by: Peter Seiderer Reviewed-by: Simon Horman --- Changes v4 -> v5 - split up patchset into part i/ii (suggested by Simon Horman) Changes v3 -> v4 - add rev-by Simon Horman Changes

[PATCH net-next v5 0/8] Some pktgen fixes/improvments (part I)

2025-02-13 Thread Peter Seiderer
mand -> cmd, device -> dev) - add 'rate 0' testcase - add 'ratep 0' testcase [1] https://lore.kernel.org/netdev/20241006221221.3744995-1-artem.chernys...@red-soft.ru/ [2] https://lore.kernel.org/netdev/20250109083039.14004-1-pchel...@ispras.ru/ [3] https://git.

[PATCH net-next v5 5/8] net: pktgen: fix 'ratep 0' error handling (return -EINVAL)

2025-02-13 Thread Peter Seiderer
applied $ echo "ratep 0" > /proc/net/pktgen/lo\@0 -bash: echo: write error: Invalid argument $ grep "Result:" /proc/net/pktgen/lo\@0 Result: Idle Signed-off-by: Peter Seiderer Reviewed-by: Simon Horman --- Changes v4 -> v5 - split u

[PATCH net-next v5 3/8] net: pktgen: fix hex32_arg parsing for short reads

2025-02-13 Thread Peter Seiderer
Result: OK: mpls=1230 - with patch applied $ echo "mpls 123" > /proc/net/pktgen/lo\@0 $ grep mpls /proc/net/pktgen/lo\@0 mpls: 0123 Result: OK: mpls=0123 Signed-off-by: Peter Seiderer Reviewed-by: Simon Horman --- Changes v4 -

[PATCH net-next v5 7/8] net: pktgen: fix access outside of user given buffer in pktgen_thread_write()

2025-02-13 Thread Peter Seiderer
Honour the user given buffer size for the strn_len() calls (otherwise strn_len() will access memory outside of the user given buffer). Signed-off-by: Peter Seiderer Reviewed-by: Simon Horman --- Changes v4 -> v5 - split up patchset into part i/ii (suggested by Simon Horman) Changes v3 -&

[PATCH net-next v5 4/8] net: pktgen: fix 'rate 0' error handling (return -EINVAL)

2025-02-13 Thread Peter Seiderer
applied $ echo "rate 0" > /proc/net/pktgen/lo\@0 -bash: echo: write error: Invalid argument $ grep "Result:" /proc/net/pktgen/lo\@0 Result: Idle Signed-off-by: Peter Seiderer Reviewed-by: Simon Horman --- Changes v4 -> v5 - split up patchset i

[PATCH net-next v5 8/8] net: pktgen: use defines for the various dec/hex number parsing digits lengths

2025-02-13 Thread Peter Seiderer
Use defines for the various dec/hex number parsing digits lengths (hex32_arg/num_arg calls). Signed-off-by: Peter Seiderer Reviewed-by: Simon Horman --- Changes v4 -> v5 - split up patchset into part i/ii (suggested by Simon Horman) - add rev-by Simon Horman Changes v3 -> v4 - new

[PATCH net-next v5 2/8] net: pktgen: enable 'param=value' parsing

2025-02-13 Thread Peter Seiderer
> /proc/net/pktgen/lo\@0 $ echo "min_pkt_size=999" > /proc/net/pktgen/lo\@0 $ echo "min_pkt_size =999" > /proc/net/pktgen/lo\@0 $ echo "min_pkt_size= 999" > /proc/net/pktgen/lo\@0 $ echo "min_pkt_size = 999" > /proc/net/pktg

[PATCH net-next v5 1/8] net: pktgen: replace ENOTSUPP with EOPNOTSUPP

2025-02-13 Thread Peter Seiderer
Replace ENOTSUPP with EOPNOTSUPP, fixes checkpatch hint WARNING: ENOTSUPP is not a SUSV4 error code, prefer EOPNOTSUPP and e.g. $ echo "clone_skb 1" > /proc/net/pktgen/lo\@0 -bash: echo: write error: Unknown error 524 Signed-off-by: Peter Seiderer Reviewed-by: Simon Horman

Re: [PATCH net-next v4 00/17] Some pktgen fixes/improvments

2025-02-11 Thread Peter Seiderer
Hello Simon, On Thu, 6 Feb 2025 13:51:54 +, Simon Horman wrote: > On Wed, Feb 05, 2025 at 02:11:36PM +0100, Peter Seiderer wrote: > > hile taking a look at '[PATCH net] pktgen: Avoid out-of-range in > > get_imix_entries' ([1]) and '[PATCH net v2] pktgen: A

Re: [PATCH net-next v4 09/17] net: pktgen: align some variable declarations to the most common pattern

2025-02-11 Thread Peter Seiderer
Hello Simon, On Thu, 6 Feb 2025 13:25:38 +, Simon Horman wrote: > On Wed, Feb 05, 2025 at 02:11:45PM +0100, Peter Seiderer wrote: > > Align some variable declarations (in get_imix_entries and get_labels) to > > the most common pattern (int instead of ssize_t/long) and

[PATCH net-next v4 13/17] net: pktgen: fix access outside of user given buffer in pktgen_if_write()

2025-02-05 Thread Peter Seiderer
Honour the user given buffer size for the hex32_arg(), num_arg(), strn_len(), get_imix_entries() and get_labels() calls (otherwise they will access memory outside of the user given buffer). Signed-off-by: Peter Seiderer --- Changes v3 -> v4: - replace C99 comment (suggested by Paolo Ab

[PATCH net-next v4 16/17] net: pktgen: fix mpls reset parsing

2025-02-05 Thread Peter Seiderer
/proc/net/pktgen/lo\@0 $ grep mpls /proc/net/pktgen/lo\@0 Result: OK: mpls= $ echo "mpls 0001,0002" > /proc/net/pktgen/lo\@0 $ echo "mpls invalid" > /proc/net/pktgen/lo\@0 $ grep mpls /proc/net/pktgen/lo\@0 Result: OK:

[PATCH net-next v4 05/17] net: pktgen: fix 'ratep 0' error handling (return -EINVAL)

2025-02-05 Thread Peter Seiderer
applied $ echo "ratep 0" > /proc/net/pktgen/lo\@0 -bash: echo: write error: Invalid argument $ grep "Result:" /proc/net/pktgen/lo\@0 Result: Idle Signed-off-by: Peter Seiderer Reviewed-by: Simon Horman --- Changes v3 -> v4 - add rev-by

[PATCH net-next v4 14/17] net: pktgen: hex32_arg/num_arg error out in case no characters are available

2025-02-05 Thread Peter Seiderer
In hex32_arg() and num_arg() error out in case no characters are available (maxlen = 0). Signed-off-by: Peter Seiderer --- Changes v3 -> v4 - new patch (factored out of patch 'net: pktgen: fix access outside of user given buffer in pktgen_if_write()') --- net/core/pktgen.c

[PATCH net-next v4 09/17] net: pktgen: align some variable declarations to the most common pattern

2025-02-05 Thread Peter Seiderer
Align some variable declarations (in get_imix_entries and get_labels) to the most common pattern (int instead of ssize_t/long) and adjust function return value accordingly. Signed-off-by: Peter Seiderer --- Changes v3 -> v4 - new patch (factored out of patch 'net: pktgen: fix access ou

[PATCH net-next v4 08/17] net: pktgen: use defines for the various dec/hex number parsing digits lengths

2025-02-05 Thread Peter Seiderer
Use defines for the various dec/hex number parsing digits lengths (hex32_arg/num_arg calls). Signed-off-by: Peter Seiderer --- Changes v3 -> v4 - new patch (suggested by Simon Horman) --- net/core/pktgen.c | 80 ++- 1 file changed, 44 inserti

[PATCH net-next v4 07/17] net: pktgen: fix access outside of user given buffer in pktgen_thread_write()

2025-02-05 Thread Peter Seiderer
Honour the user given buffer size for the strn_len() calls (otherwise strn_len() will access memory outside of the user given buffer). Signed-off-by: Peter Seiderer Reviewed-by: Simon Horman --- Changes v3 -> v4 - add rev-by Simon Horman Changes v2 -> v3: - no changes Changes v1

[PATCH net-next v4 11/17] net: pktgen: remove some superfluous variable initializing

2025-02-05 Thread Peter Seiderer
Remove some superfluous variable initializing before hex32_arg call (as the same init is done here already). Signed-off-by: Peter Seiderer --- Changes v3 -> v4 - new patch (factored out of patch 'net: pktgen: fix access outside of user given buffer in pktgen_if_write()')

[PATCH net-next v4 17/17] selftest: net: add proc_net_pktgen

2025-02-05 Thread Peter Seiderer
Add some test for /proc/net/pktgen/... interface. - enable 'CONFIG_NET_PKTGEN=m' in tools/testing/selftests/net/config Signed-off-by: Peter Seiderer --- Changes v3 -> v4: - no changes Changes v2 -> v3: - fix typo in change description ('v1 -> v1' and tyop)

[PATCH net-next v4 15/17] net: pktgen: num_arg error out in case no valid character is parsed

2025-02-05 Thread Peter Seiderer
In num_arg() error out in case no valid character is parsed. Signed-off-by: Peter Seiderer --- Changes v3 -> v4 - new patch (factored out of patch 'net: pktgen: fix access outside of user given buffer in pktgen_if_write()') --- net/core/pktgen.c | 3 +++ 1 file changed,

[PATCH net-next v4 01/17] net: pktgen: replace ENOTSUPP with EOPNOTSUPP

2025-02-05 Thread Peter Seiderer
Replace ENOTSUPP with EOPNOTSUPP, fixes checkpatch hint WARNING: ENOTSUPP is not a SUSV4 error code, prefer EOPNOTSUPP and e.g. $ echo "clone_skb 1" > /proc/net/pktgen/lo\@0 -bash: echo: write error: Unknown error 524 Signed-off-by: Peter Seiderer Reviewed-by: Simon Horman

[PATCH net-next v4 12/17] net: pktgen: fix mpls maximum labels list parsing

2025-02-05 Thread Peter Seiderer
gt; /proc/net/pktgen/lo\@0 -bash: echo: write error: Argument list too long Signed-off-by: Peter Seiderer --- Changes v3 -> v4 - new patch (factored out of patch 'net: pktgen: fix access outside of user given buffer in pktgen_if_write()') --- net/core/pktgen.c | 6

[PATCH net-next v4 10/17] net: pktgen: remove extra tmp variable (re-use len instead)

2025-02-05 Thread Peter Seiderer
Remove extra tmp variable in pktgen_if_write (re-use len instead). Signed-off-by: Peter Seiderer --- Changes v3 -> v4 - new patch (factored out of patch 'net: pktgen: fix access outside of user given buffer in pktgen_if_write()') --- net/core/pktgen.c | 9 - 1 fi

[PATCH net-next v4 06/17] net: pktgen: fix ctrl interface command parsing

2025-02-05 Thread Peter Seiderer
ith patch applied $ echo -n "reset" > /proc/net/pktgen/pgctrl Signed-off-by: Peter Seiderer Reviewed-by: Simon Horman --- Changes v3 -> v4 - add rev-by Simon Horman Changes v2 -> v3: - new patch --- net/core/pktgen.c | 14 -- 1 file changed, 8 insertio

[PATCH net-next v4 02/17] net: pktgen: enable 'param=value' parsing

2025-02-05 Thread Peter Seiderer
> /proc/net/pktgen/lo\@0 $ echo "min_pkt_size=999" > /proc/net/pktgen/lo\@0 $ echo "min_pkt_size =999" > /proc/net/pktgen/lo\@0 $ echo "min_pkt_size= 999" > /proc/net/pktgen/lo\@0 $ echo "min_pkt_size = 999" > /proc/net

[PATCH net-next v4 03/17] net: pktgen: fix hex32_arg parsing for short reads

2025-02-05 Thread Peter Seiderer
Result: OK: mpls=1230 - with patch applied $ echo "mpls 123" > /proc/net/pktgen/lo\@0 $ grep mpls /proc/net/pktgen/lo\@0 mpls: 0123 Result: OK: mpls=0123 Signed-off-by: Peter Seiderer Reviewed-by: Simon Horman --- Changes v3

[PATCH net-next v4 04/17] net: pktgen: fix 'rate 0' error handling (return -EINVAL)

2025-02-05 Thread Peter Seiderer
applied $ echo "rate 0" > /proc/net/pktgen/lo\@0 -bash: echo: write error: Invalid argument $ grep "Result:" /proc/net/pktgen/lo\@0 Result: Idle Signed-off-by: Peter Seiderer Reviewed-by: Simon Horman --- Changes v3 -> v4 - add rev-by

[PATCH net-next v4 00/17] Some pktgen fixes/improvments

2025-02-05 Thread Peter Seiderer
some checkpatch warnings (Missing a blank line after declarations) - shrink line length by re-naming some variables (command -> cmd, device -> dev) - add 'rate 0' testcase - add 'ratep 0' testcase [1] https://lore.kernel.org/netdev/20241006221221.3744995-1-artem.che

Re: [PATCH net-next v3 08/10] net: pktgen: fix access outside of user given buffer in pktgen_if_write()

2025-02-05 Thread Peter Seiderer
Hello Simon, On Tue, 4 Feb 2025 10:52:51 +, Simon Horman wrote: > On Mon, Feb 03, 2025 at 06:01:59PM +0100, Peter Seiderer wrote: > > Honour the user given buffer size for the hex32_arg(), num_arg(), > > strn_len(), get_imix_entries() and get_labels() calls (otherwise they

Re: [PATCH net-next v3 08/10] net: pktgen: fix access outside of user given buffer in pktgen_if_write()

2025-02-05 Thread Peter Seiderer
Hello Paolo, On Tue, 4 Feb 2025 11:40:21 +0100, Paolo Abeni wrote: > Hi, > > On 2/3/25 6:01 PM, Peter Seiderer wrote: > > @@ -806,6 +812,9 @@ static long num_arg(const char __user *user_buffer, > > unsigned long maxlen, > >

Re: [PATCH net-next v3 02/10] net: pktgen: enable 'param=value' parsing

2025-02-05 Thread Peter Seiderer
Hello Paolo, On Tue, 4 Feb 2025 11:55:57 +0100, Paolo Abeni wrote: > On 2/3/25 6:01 PM, Peter Seiderer wrote: > > Enable additional to 'parm value' the 'param=value' parsing > > It could be language bias on my side, by I find the above statement hard >

Re: [PATCH] selftests: pidfd: Fix compiling warning of pidfs_setns

2025-02-05 Thread Peter Seiderer
Hello *, On Wed, 5 Feb 2025 13:50:31 +0800, I Hsin Cheng wrote: > In the compilation of pidfs_setns_test.c , a warning as the following > will pop out. > > pidfd_setns_test.c: In function ‘current_nsset_setup’: > pidfd_setns_test.c:173:54: warning: implicit declaration of function \ > ‘ioctl’

Re: [PATCH] selftests: pidfd: Fix compiling errors and warning

2025-02-05 Thread Peter Seiderer
Hello *, On Wed, 5 Feb 2025 13:39:26 +0800, I Hsin Cheng wrote: > When compiling selftests files under tools/testing/selftests/pidfd/ , > some compiling errors and warnings will pop out as the following. > > CC pidfd_fdinfo_test > pidfd_fdinfo_test.c: In function ‘child_fdinfo_nspid_t

Re: [PATCH v7 2/6] selftests/pidfd: add missing system header imcludes to pidfd tests

2025-02-05 Thread Peter Seiderer
Hello *, On Thu, 30 Jan 2025 20:40:27 +, Lorenzo Stoakes wrote: > The pidfd_fdinfo_test.c and pidfd_setns_test.c tests appear to be missing > fundamental system header imports required to execute correctly. Add these. > > Signed-off-by: Lorenzo Stoakes > --- > tools/testing/selftests/pidf

[PATCH net-next v3 07/10] net: pktgen: fix access outside of user given buffer in pktgen_thread_write()

2025-02-03 Thread Peter Seiderer
Honour the user given buffer size for the strn_len() calls (otherwise strn_len() will access memory outside of the user given buffer). Signed-off-by: Peter Seiderer --- Changes v2 -> v3: - no changes Changes v1 -> v2: - no changes --- net/core/pktgen.c | 7 --- 1 file chan

[PATCH net-next v3 06/10] net: pktgen: fix ctrl interface command parsing

2025-02-03 Thread Peter Seiderer
ith patch applied $ echo -n "reset" > /proc/net/pktgen/pgctrl Signed-off-by: Peter Seiderer --- Changes v2 -> v3: - new patch --- net/core/pktgen.c | 14 -- 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/net/core/pktgen.c b/net/core/pktgen.c in

[PATCH net-next v3 08/10] net: pktgen: fix access outside of user given buffer in pktgen_if_write()

2025-02-03 Thread Peter Seiderer
. Signed-off-by: Peter Seiderer --- Changes v2 -> v3: - no changes Changes v1 -> v2: - additional fix get_imix_entries() and get_labels() --- net/core/pktgen.c | 211 ++ 1 file changed, 139 insertions(+), 72 deletions(-) diff --git a/net/core/pktg

[PATCH net-next v3 04/10] net: pktgen: fix 'rate 0' error handling (return -EINVAL)

2025-02-03 Thread Peter Seiderer
applied $ echo "rate 0" > /proc/net/pktgen/lo\@0 -bash: echo: write error: Invalid argument $ grep "Result:" /proc/net/pktgen/lo\@0 Result: Idle Signed-off-by: Peter Seiderer --- Changes v2 -> v3: - no changes Changes v1 -> v2: - new

[PATCH net-next v3 09/10] net: pktgen: fix mpls reset parsing

2025-02-03 Thread Peter Seiderer
/proc/net/pktgen/lo\@0 $ grep mpls /proc/net/pktgen/lo\@0 Result: OK: mpls= $ echo "mpls 0001,0002" > /proc/net/pktgen/lo\@0 $ echo "mpls invalid" > /proc/net/pktgen/lo\@0 $ grep mpls /proc/net/pktgen/lo\@0 Result: OK

[PATCH net-next v3 03/10] net: pktgen: fix hex32_arg parsing for short reads

2025-02-03 Thread Peter Seiderer
Result: OK: mpls=1230 - with patch applied $ echo "mpls 123" > /proc/net/pktgen/lo\@0 $ grep mpls /proc/net/pktgen/lo\@0 mpls: 0123 Result: OK: mpls=0123 Signed-off-by: Peter Seiderer --- Changes v1 -> v2: - no changes Ch

[PATCH net-next v3 10/10] selftest: net: add proc_net_pktgen

2025-02-03 Thread Peter Seiderer
Add some test for /proc/net/pktgen/... interface. - enable 'CONFIG_NET_PKTGEN=m' in tools/testing/selftests/net/config Signed-off-by: Peter Seiderer --- Changes v2 -> v3: - fix typo in change description ('v1 -> v1' and tyop) - rename some vars to better matc

[PATCH net-next v3 05/10] net: pktgen: fix 'ratep 0' error handling (return -EINVAL)

2025-02-03 Thread Peter Seiderer
applied $ echo "ratep 0" > /proc/net/pktgen/lo\@0 -bash: echo: write error: Invalid argument $ grep "Result:" /proc/net/pktgen/lo\@0 Result: Idle Signed-off-by: Peter Seiderer --- Changes v2 -> v3: - no changes Changes v1 -> v2: -

[PATCH net-next v3 00/10] Some pktgen fixes/improvments

2025-02-03 Thread Peter Seiderer
add 'rate 0' testcase - add 'ratep 0' testcase [1] https://lore.kernel.org/netdev/20241006221221.3744995-1-artem.chernys...@red-soft.ru/ [2] https://lore.kernel.org/netdev/20250109083039.14004-1-pchel...@ispras.ru/ [3] https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.gi

[PATCH net-next v3 02/10] net: pktgen: enable 'param=value' parsing

2025-02-03 Thread Peter Seiderer
/pktgen/lo\@0 $ echo "min_pkt_size =999" > /proc/net/pktgen/lo\@0 $ echo "min_pkt_size= 999" > /proc/net/pktgen/lo\@0 $ echo "min_pkt_size = 999" > /proc/net/pktgen/lo\@0 Signed-off-by: Peter Seiderer --- Changes v2 -> v3: - no c

[PATCH net-next v3 01/10] net: pktgen: replace ENOTSUPP with EOPNOTSUPP

2025-02-03 Thread Peter Seiderer
Replace ENOTSUPP with EOPNOTSUPP, fixes checkpatch hint WARNING: ENOTSUPP is not a SUSV4 error code, prefer EOPNOTSUPP and e.g. $ echo "clone_skb 1" > /proc/net/pktgen/lo\@0 -bash: echo: write error: Unknown error 524 Signed-off-by: Peter Seiderer --- Changes v2 -> v

[PATCH net-next v2 6/8] net: pktgen: fix access outside of user given buffer in pktgen_thread_write()

2025-01-22 Thread Peter Seiderer
Honour the user given buffer size for the strn_len() calls (otherwise strn_len() will access memory outside of the user given buffer). Signed-off-by: Peter Seiderer --- Changes v1 -> v2: - no changes --- net/core/pktgen.c | 7 --- 1 file changed, 4 insertions(+), 3 deletions(-) d

  1   2   >