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

Peter Seiderer posted 10 patches 1 year ago
There is a newer version of this series
[PATCH net-next v3 02/10] net: pktgen: enable 'param=value' parsing
Posted by Peter Seiderer 1 year ago
Enable additional to 'parm value' the 'param=value' parsing (otherwise
skipping '=' in count_trail_chars() is useless).

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 v2 -> v3:
  - no changes

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

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;
-- 
2.48.1

Re: [PATCH net-next v3 02/10] net: pktgen: enable 'param=value' parsing
Posted by Paolo Abeni 1 year ago
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
to parse. Could you please rephrase it?

IMHO something alike:

"""
Enable more flexible parameters syntax, allowing "param=value" in
addition to the already supported "param value" pattern.
"""

Thanks,

Paolo
Re: [PATCH net-next v3 02/10] net: pktgen: enable 'param=value' parsing
Posted by Peter Seiderer 1 year ago
Hello Paolo,

On Tue, 4 Feb 2025 11:55:57 +0100, Paolo Abeni <pabeni@redhat.com> 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
> to parse. Could you please rephrase it?
>
> IMHO something alike:
>
> """
> Enable more flexible parameters syntax, allowing "param=value" in
> addition to the already supported "param value" pattern.
> """

You are right, thanks for review and improved commit description,
will fix it in the next patch iteration...

Regards,
Peter

>
> Thanks,
>
> Paolo
>