diff mbox series

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

Message ID 20250213110025.1436160-3-ps.report@gmx.net (mailing list archive)
State Superseded
Delegated to: Netdev Maintainers
Headers show
Series Some pktgen fixes/improvments (part I) | expand

Checks

Context Check Description
netdev/series_format success Posting correctly formatted
netdev/tree_selection success Clearly marked for net-next
netdev/ynl success Generated files up to date; no warnings/errors; no diff in generated;
netdev/fixes_present success Fixes tag not required for -next series
netdev/header_inline success No static functions without inline keyword in header files
netdev/build_32bit success Errors and warnings before: 0 this patch: 0
netdev/build_tools success No tools touched, skip
netdev/cc_maintainers success CCed 5 of 5 maintainers
netdev/build_clang success Errors and warnings before: 1 this patch: 1
netdev/verify_signedoff success Signed-off-by tag matches author and committer
netdev/deprecated_api success None detected
netdev/check_selftest success No net selftest shell script
netdev/verify_fixes success No Fixes tag
netdev/build_allmodconfig_warn success Errors and warnings before: 0 this patch: 0
netdev/checkpatch success total: 0 errors, 0 warnings, 0 checks, 7 lines checked
netdev/build_clang_rust success No Rust files in patch. Skipping build
netdev/kdoc success Errors and warnings before: 0 this patch: 0
netdev/source_inline success Was 0 now: 0
netdev/contest success net-next-2025-02-15--03-00 (tests: 891)

Commit Message

Peter Seiderer Feb. 13, 2025, 11 a.m. UTC
Enable more flexible parameters syntax, allowing 'param=value' in
addition to the already supported 'param value' pattern (additional
this gives the skipping '=' in count_trail_chars() a purpose).

Tested with:

	$ 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/pktgen/lo\@0
	$ echo "min_pkt_size = 999" > /proc/net/pktgen/lo\@0

Signed-off-by: Peter Seiderer <ps.report@gmx.net>
---
Changes v4 -> v5
  - split up patchset into part i/ii (suggested by Simon Horman)

Changes v3 -> v4:
  - rephrase commit message (suggested by Paolo Abeni)

Changes v2 -> v3:
  - no changes

Changes v1 -> v2:
  - no changes
---
 net/core/pktgen.c | 1 +
 1 file changed, 1 insertion(+)

Comments

Simon Horman Feb. 16, 2025, 9:21 a.m. UTC | #1
On Thu, Feb 13, 2025 at 12:00:19PM +0100, Peter Seiderer wrote:
> Enable more flexible parameters syntax, allowing 'param=value' in
> addition to the already supported 'param value' pattern (additional
> this gives the skipping '=' in count_trail_chars() a purpose).
> 
> Tested with:
> 
> 	$ 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/pktgen/lo\@0
> 	$ echo "min_pkt_size = 999" > /proc/net/pktgen/lo\@0
> 
> Signed-off-by: Peter Seiderer <ps.report@gmx.net>

Reviewed-by: Simon Horman <horms@kernel.org>
diff mbox series

Patch

diff --git a/net/core/pktgen.c b/net/core/pktgen.c
index 496aa16773e7..4f8ec6c9bed4 100644
--- a/net/core/pktgen.c
+++ b/net/core/pktgen.c
@@ -823,6 +823,7 @@  static int strn_len(const char __user * user_buffer, unsigned int maxlen)
 		case '\r':
 		case '\t':
 		case ' ':
+		case '=':
 			goto done_str;
 		default:
 			break;