All of lore.kernel.org
 help / color / mirror / Atom feed
* Question Print Formatting iproute2
@ 2020-07-27  4:46 Briana Oursler
  2020-07-27 19:31 ` Petr Machata
  2020-07-27 23:47 ` Stephen Hemminger
  0 siblings, 2 replies; 11+ messages in thread
From: Briana Oursler @ 2020-07-27  4:46 UTC (permalink / raw)
  To: netdev
  Cc: Stephen Hemminger, Alexey Kuznetsov, Petr Machata,
	Davide Caratti, Stefano Brivio, Jiri Pirko, Briana Oursler

I have a patch I've written to address a format specifier change that
breaks some tests in tc-testing, but I wanted to ask about the change
and for some guidance with respect to how formatters are approached in
iproute2. 

On a recent run of tdc tests I ran ./tdc.py -c qdisc and found:

1..91
not ok 1 8b6e - Create RED with no flags
        Could not match regex pattern. Verify command output:
qdisc red 1: root refcnt 2 limit 1Mb min 100Kb max 300Kb

not ok 2 342e - Create RED with adaptive flag
        Could not match regex pattern. Verify command output:
qdisc red 1: root refcnt 2 limit 1Mb min 100Kb max 300Kbadaptive

not ok 3 2d4b - Create RED with ECN flag
        Could not match regex pattern. Verify command output:
qdisc red 1: root refcnt 2 limit 1Mb min 100Kb max 300Kbecn

not ok 4 650f - Create RED with flags ECN, adaptive
        Could not match regex pattern. Verify command output:
qdisc red 1: root refcnt 2 limit 1Mb min 100Kb max 300Kbecn adaptive

not ok 5 5f15 - Create RED with flags ECN, harddrop
        Could not match regex pattern. Verify command output:
qdisc red 1: root refcnt 2 limit 1Mb min 100Kb max 300Kbecn harddrop

not ok 6 53e8 - Create RED with flags ECN, nodrop
        Could not match regex pattern. Verify command output:
qdisc red 1: root refcnt 2 limit 1Mb min 100Kb max 300Kbecn nodrop

ok 7 d091 - Fail to create RED with only nodrop flag
not ok 8 af8e - Create RED with flags ECN, nodrop, harddrop
        Could not match regex pattern. Verify command output:
qdisc red 1: root refcnt 2 limit 1Mb min 100Kb max 300Kbecn harddrop
nodrop

I git bisected and found d0e450438571("tc: q_red: Add support for
qevents "mark" and "early_drop"), the commit that introduced the
formatting change causing the break. 

-       print_string(PRINT_FP, NULL, "max %s ", sprint_size(qopt->qth_max, b3));
+       print_string(PRINT_FP, NULL, "max %s", sprint_size(qopt->qth_max, b3));

I made a patch that adds a space after the format specifier in the
iproute2 tc/q_red.c and tested it using: tdc.py -c qdisc. After the
change, all the broken tdc qdisc red tests return ok. I'm including the
patch under the scissors line.

I wanted to ask the ML if adding the space after the specifier is preferred usage.
The commit also had: 
 -               print_uint(PRINT_ANY, "ewma", "ewma %u ", qopt->Wlog);
 +               print_uint(PRINT_ANY, "ewma", " ewma %u ", qopt->Wlog);

so I wanted to check with everyone.

Thanks 
>8------------------------------------------------------------------------8<
From 1e7bee22a799a320bd230ad959d459b386bec26d Mon Sep 17 00:00:00 2001
Subject: [RFC iproute2-next] tc: Add space after format specifier

Add space after format specifier in print_string call. Fixes broken
qdisc tests within tdc testing suite.

Fixes: d0e450438571("tc: q_red: Add support for
qevents "mark" and "early_drop")

Signed-off-by: Briana Oursler <briana.oursler@gmail.com>
---
 tc/q_red.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/tc/q_red.c b/tc/q_red.c
index dfef1bf8..7106645a 100644
--- a/tc/q_red.c
+++ b/tc/q_red.c
@@ -222,7 +222,7 @@ static int red_print_opt(struct qdisc_util *qu, FILE *f, struct rtattr *opt)
 	print_uint(PRINT_JSON, "min", NULL, qopt->qth_min);
 	print_string(PRINT_FP, NULL, "min %s ", sprint_size(qopt->qth_min, b2));
 	print_uint(PRINT_JSON, "max", NULL, qopt->qth_max);
-	print_string(PRINT_FP, NULL, "max %s", sprint_size(qopt->qth_max, b3));
+	print_string(PRINT_FP, NULL, "max %s ", sprint_size(qopt->qth_max, b3));
 
 	tc_red_print_flags(qopt->flags);
 

base-commit: 1ca65af1c5e131861a3989cca3c7ca8b067e0833
-- 
2.27.0


^ permalink raw reply related	[flat|nested] 11+ messages in thread

* Re: Question Print Formatting iproute2
  2020-07-27  4:46 Question Print Formatting iproute2 Briana Oursler
@ 2020-07-27 19:31 ` Petr Machata
  2020-07-27 20:37   ` Stephen Hemminger
  2020-07-28  4:12   ` Briana Oursler
  2020-07-27 23:47 ` Stephen Hemminger
  1 sibling, 2 replies; 11+ messages in thread
From: Petr Machata @ 2020-07-27 19:31 UTC (permalink / raw)
  To: Briana Oursler
  Cc: netdev, Stephen Hemminger, Alexey Kuznetsov, Davide Caratti,
	Stefano Brivio, Jiri Pirko


Briana Oursler <briana.oursler@gmail.com> writes:

> I git bisected and found d0e450438571("tc: q_red: Add support for
> qevents "mark" and "early_drop"), the commit that introduced the
> formatting change causing the break.
>
> -       print_string(PRINT_FP, NULL, "max %s ", sprint_size(qopt->qth_max, b3));
> +       print_string(PRINT_FP, NULL, "max %s", sprint_size(qopt->qth_max, b3));
>
> I made a patch that adds a space after the format specifier in the
> iproute2 tc/q_red.c and tested it using: tdc.py -c qdisc. After the
> change, all the broken tdc qdisc red tests return ok. I'm including the
> patch under the scissors line.
>
> I wanted to ask the ML if adding the space after the specifier is preferred usage.
> The commit also had:
>  -               print_uint(PRINT_ANY, "ewma", "ewma %u ", qopt->Wlog);
>  +               print_uint(PRINT_ANY, "ewma", " ewma %u ", qopt->Wlog);
>
> so I wanted to check with everyone.

Yeah, I outsmarted myself with those space changes. Those two chunks
need reversing, and qevents need to have the space changed. This should
work:

modified	  tc/q_red.c
@@ -222,12 +222,12 @@ static int red_print_opt(struct qdisc_util *qu, FILE *f, struct rtattr *opt)
 	print_uint(PRINT_JSON, "min", NULL, qopt->qth_min);
 	print_string(PRINT_FP, NULL, "min %s ", sprint_size(qopt->qth_min, b2));
 	print_uint(PRINT_JSON, "max", NULL, qopt->qth_max);
-	print_string(PRINT_FP, NULL, "max %s", sprint_size(qopt->qth_max, b3));
+	print_string(PRINT_FP, NULL, "max %s ", sprint_size(qopt->qth_max, b3));

 	tc_red_print_flags(qopt->flags);

 	if (show_details) {
-		print_uint(PRINT_ANY, "ewma", " ewma %u ", qopt->Wlog);
+		print_uint(PRINT_ANY, "ewma", "ewma %u ", qopt->Wlog);
 		if (max_P)
 			print_float(PRINT_ANY, "probability",
 				    "probability %lg ", max_P / pow(2, 32));
modified	  tc/tc_qevent.c
@@ -82,8 +82,9 @@ void qevents_print(struct qevent_util *qevents, FILE *f)
 			}

 			open_json_object(NULL);
-			print_string(PRINT_ANY, "kind", " qevent %s", qevents->id);
+			print_string(PRINT_ANY, "kind", "qevent %s", qevents->id);
 			qevents->print_qevent(qevents, f);
+			print_string(PRINT_FP, NULL, "%s", " ");
 			close_json_object();
 		}
 	}

Are you going to take care of this, or should I?

^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: Question Print Formatting iproute2
  2020-07-27 19:31 ` Petr Machata
@ 2020-07-27 20:37   ` Stephen Hemminger
  2020-07-28  4:12   ` Briana Oursler
  1 sibling, 0 replies; 11+ messages in thread
From: Stephen Hemminger @ 2020-07-27 20:37 UTC (permalink / raw)
  To: Petr Machata
  Cc: Briana Oursler, netdev, Alexey Kuznetsov, Davide Caratti,
	Stefano Brivio, Jiri Pirko

On Mon, 27 Jul 2020 21:31:36 +0200
Petr Machata <petrm@mellanox.com> wrote:

> Briana Oursler <briana.oursler@gmail.com> writes:
> 
> > I git bisected and found d0e450438571("tc: q_red: Add support for
> > qevents "mark" and "early_drop"), the commit that introduced the
> > formatting change causing the break.
> >
> > -       print_string(PRINT_FP, NULL, "max %s ", sprint_size(qopt->qth_max, b3));
> > +       print_string(PRINT_FP, NULL, "max %s", sprint_size(qopt->qth_max, b3));
> >
> > I made a patch that adds a space after the format specifier in the
> > iproute2 tc/q_red.c and tested it using: tdc.py -c qdisc. After the
> > change, all the broken tdc qdisc red tests return ok. I'm including the
> > patch under the scissors line.
> >
> > I wanted to ask the ML if adding the space after the specifier is preferred usage.
> > The commit also had:
> >  -               print_uint(PRINT_ANY, "ewma", "ewma %u ", qopt->Wlog);
> >  +               print_uint(PRINT_ANY, "ewma", " ewma %u ", qopt->Wlog);
> >
> > so I wanted to check with everyone.  
> 
> Yeah, I outsmarted myself with those space changes. Those two chunks
> need reversing, and qevents need to have the space changed. This should
> work:
> 
> modified	  tc/q_red.c
> @@ -222,12 +222,12 @@ static int red_print_opt(struct qdisc_util *qu, FILE *f, struct rtattr *opt)
>  	print_uint(PRINT_JSON, "min", NULL, qopt->qth_min);
>  	print_string(PRINT_FP, NULL, "min %s ", sprint_size(qopt->qth_min, b2));
>  	print_uint(PRINT_JSON, "max", NULL, qopt->qth_max);
> -	print_string(PRINT_FP, NULL, "max %s", sprint_size(qopt->qth_max, b3));
> +	print_string(PRINT_FP, NULL, "max %s ", sprint_size(qopt->qth_max, b3));
> 
>  	tc_red_print_flags(qopt->flags);
> 
>  	if (show_details) {
> -		print_uint(PRINT_ANY, "ewma", " ewma %u ", qopt->Wlog);
> +		print_uint(PRINT_ANY, "ewma", "ewma %u ", qopt->Wlog);
>  		if (max_P)
>  			print_float(PRINT_ANY, "probability",
>  				    "probability %lg ", max_P / pow(2, 32));
> modified	  tc/tc_qevent.c
> @@ -82,8 +82,9 @@ void qevents_print(struct qevent_util *qevents, FILE *f)
>  			}
> 
>  			open_json_object(NULL);
> -			print_string(PRINT_ANY, "kind", " qevent %s", qevents->id);
> +			print_string(PRINT_ANY, "kind", "qevent %s", qevents->id);
>  			qevents->print_qevent(qevents, f);
> +			print_string(PRINT_FP, NULL, "%s", " ");
>  			close_json_object();
>  		}
>  	}
> 
> Are you going to take care of this, or should I?

Missing spaces makes it impossible to read adding extra spaces is annoying, 
From a long term perspective it is better if anything that is trying to
parse output pro grammatically should use JSON output format. With JSON
it is easier to handle new data and not as dependent on ordering.
Plus if some tests used JSON, maybe the issues would be found sooner.

^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: Question Print Formatting iproute2
  2020-07-27  4:46 Question Print Formatting iproute2 Briana Oursler
  2020-07-27 19:31 ` Petr Machata
@ 2020-07-27 23:47 ` Stephen Hemminger
  2020-07-28  4:14   ` Briana Oursler
  2020-07-28  5:20   ` [PATCH iproute2] tc: Add space after format specifier Briana Oursler
  1 sibling, 2 replies; 11+ messages in thread
From: Stephen Hemminger @ 2020-07-27 23:47 UTC (permalink / raw)
  To: Briana Oursler
  Cc: netdev, Alexey Kuznetsov, Petr Machata, Davide Caratti,
	Stefano Brivio, Jiri Pirko

On Sun, 26 Jul 2020 21:46:16 -0700
Briana Oursler <briana.oursler@gmail.com> wrote:

> I have a patch I've written to address a format specifier change that
> breaks some tests in tc-testing, but I wanted to ask about the change
> and for some guidance with respect to how formatters are approached in
> iproute2. 
> 
> On a recent run of tdc tests I ran ./tdc.py -c qdisc and found:
> 
> 1..91
> not ok 1 8b6e - Create RED with no flags
>         Could not match regex pattern. Verify command output:
> qdisc red 1: root refcnt 2 limit 1Mb min 100Kb max 300Kb
> 
> not ok 2 342e - Create RED with adaptive flag
>         Could not match regex pattern. Verify command output:
> qdisc red 1: root refcnt 2 limit 1Mb min 100Kb max 300Kbadaptive
> 
> not ok 3 2d4b - Create RED with ECN flag
>         Could not match regex pattern. Verify command output:
> qdisc red 1: root refcnt 2 limit 1Mb min 100Kb max 300Kbecn
> 
> not ok 4 650f - Create RED with flags ECN, adaptive
>         Could not match regex pattern. Verify command output:
> qdisc red 1: root refcnt 2 limit 1Mb min 100Kb max 300Kbecn adaptive
> 
> not ok 5 5f15 - Create RED with flags ECN, harddrop
>         Could not match regex pattern. Verify command output:
> qdisc red 1: root refcnt 2 limit 1Mb min 100Kb max 300Kbecn harddrop
> 
> not ok 6 53e8 - Create RED with flags ECN, nodrop
>         Could not match regex pattern. Verify command output:
> qdisc red 1: root refcnt 2 limit 1Mb min 100Kb max 300Kbecn nodrop
> 
> ok 7 d091 - Fail to create RED with only nodrop flag
> not ok 8 af8e - Create RED with flags ECN, nodrop, harddrop
>         Could not match regex pattern. Verify command output:
> qdisc red 1: root refcnt 2 limit 1Mb min 100Kb max 300Kbecn harddrop
> nodrop
> 
> I git bisected and found d0e450438571("tc: q_red: Add support for
> qevents "mark" and "early_drop"), the commit that introduced the
> formatting change causing the break. 
> 
> -       print_string(PRINT_FP, NULL, "max %s ", sprint_size(qopt->qth_max, b3));
> +       print_string(PRINT_FP, NULL, "max %s", sprint_size(qopt->qth_max, b3));
> 
> I made a patch that adds a space after the format specifier in the
> iproute2 tc/q_red.c and tested it using: tdc.py -c qdisc. After the
> change, all the broken tdc qdisc red tests return ok. I'm including the
> patch under the scissors line.
> 
> I wanted to ask the ML if adding the space after the specifier is preferred usage.
> The commit also had: 
>  -               print_uint(PRINT_ANY, "ewma", "ewma %u ", qopt->Wlog);
>  +               print_uint(PRINT_ANY, "ewma", " ewma %u ", qopt->Wlog);
> 
> so I wanted to check with everyone.
> 
> Thanks 
> >8------------------------------------------------------------------------8<  
> From 1e7bee22a799a320bd230ad959d459b386bec26d Mon Sep 17 00:00:00 2001
> Subject: [RFC iproute2-next] tc: Add space after format specifier
> 
> Add space after format specifier in print_string call. Fixes broken
> qdisc tests within tdc testing suite.
> 
> Fixes: d0e450438571("tc: q_red: Add support for
> qevents "mark" and "early_drop")
> 
> Signed-off-by: Briana Oursler <briana.oursler@gmail.com>
> ---
>  tc/q_red.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/tc/q_red.c b/tc/q_red.c
> index dfef1bf8..7106645a 100644
> --- a/tc/q_red.c
> +++ b/tc/q_red.c
> @@ -222,7 +222,7 @@ static int red_print_opt(struct qdisc_util *qu, FILE *f, struct rtattr *opt)
>  	print_uint(PRINT_JSON, "min", NULL, qopt->qth_min);
>  	print_string(PRINT_FP, NULL, "min %s ", sprint_size(qopt->qth_min, b2));
>  	print_uint(PRINT_JSON, "max", NULL, qopt->qth_max);
> -	print_string(PRINT_FP, NULL, "max %s", sprint_size(qopt->qth_max, b3));
> +	print_string(PRINT_FP, NULL, "max %s ", sprint_size(qopt->qth_max, b3));
>  
>  	tc_red_print_flags(qopt->flags);
>  
> 
> base-commit: 1ca65af1c5e131861a3989cca3c7ca8b067e0833

Looks fine, please resend a normal patch targeted at current iproute2
not next.


^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: Question Print Formatting iproute2
  2020-07-27 19:31 ` Petr Machata
  2020-07-27 20:37   ` Stephen Hemminger
@ 2020-07-28  4:12   ` Briana Oursler
  1 sibling, 0 replies; 11+ messages in thread
From: Briana Oursler @ 2020-07-28  4:12 UTC (permalink / raw)
  To: Petr Machata
  Cc: netdev, Stephen Hemminger, Alexey Kuznetsov, Davide Caratti,
	Stefano Brivio, Jiri Pirko

On Mon, 2020-07-27 at 21:31 +0200, Petr Machata wrote:
> Briana Oursler <briana.oursler@gmail.com> writes:
> 
> > I git bisected and found d0e450438571("tc: q_red: Add support for
> > qevents "mark" and "early_drop"), the commit that introduced the
> > formatting change causing the break.
> > 
> > -       print_string(PRINT_FP, NULL, "max %s ", sprint_size(qopt-
> > >qth_max, b3));
> > +       print_string(PRINT_FP, NULL, "max %s", sprint_size(qopt-
> > >qth_max, b3));
> > 
> > I made a patch that adds a space after the format specifier in the
> > iproute2 tc/q_red.c and tested it using: tdc.py -c qdisc. After the
> > change, all the broken tdc qdisc red tests return ok. I'm including
> > the
> > patch under the scissors line.
> > 
> > I wanted to ask the ML if adding the space after the specifier is
> > preferred usage.
> > The commit also had:
> >  -               print_uint(PRINT_ANY, "ewma", "ewma %u ", qopt-
> > >Wlog);
> >  +               print_uint(PRINT_ANY, "ewma", " ewma %u ", qopt-
> > >Wlog);
> > 
> > so I wanted to check with everyone.
> 
> Yeah, I outsmarted myself with those space changes. Those two chunks
> need reversing, and qevents need to have the space changed. This
> should
> work:
> 
Thank you for the response. I see what you are saying. I had not seen
the qevents, I'll put all 3 in.

> modified	  tc/q_red.c
> @@ -222,12 +222,12 @@ static int red_print_opt(struct qdisc_util *qu,
> FILE *f, struct rtattr *opt)
>  	print_uint(PRINT_JSON, "min", NULL, qopt->qth_min);
>  	print_string(PRINT_FP, NULL, "min %s ", sprint_size(qopt-
> >qth_min, b2));
>  	print_uint(PRINT_JSON, "max", NULL, qopt->qth_max);
> -	print_string(PRINT_FP, NULL, "max %s", sprint_size(qopt-
> >qth_max, b3));
> +	print_string(PRINT_FP, NULL, "max %s ", sprint_size(qopt-
> >qth_max, b3));
> 
>  	tc_red_print_flags(qopt->flags);
> 
>  	if (show_details) {
> -		print_uint(PRINT_ANY, "ewma", " ewma %u ", qopt->Wlog);
> +		print_uint(PRINT_ANY, "ewma", "ewma %u ", qopt->Wlog);
>  		if (max_P)
>  			print_float(PRINT_ANY, "probability",
>  				    "probability %lg ", max_P / pow(2,
> 32));
> modified	  tc/tc_qevent.c
> @@ -82,8 +82,9 @@ void qevents_print(struct qevent_util *qevents,
> FILE *f)
>  			}
> 
>  			open_json_object(NULL);
> -			print_string(PRINT_ANY, "kind", " qevent %s",
> qevents->id);
> +			print_string(PRINT_ANY, "kind", "qevent %s",
> qevents->id);
>  			qevents->print_qevent(qevents, f);
> +			print_string(PRINT_FP, NULL, "%s", " ");
>  			close_json_object();
>  		}
>  	}
> 
> Are you going to take care of this, or should I?

I will, I'll amend the commit I included so it will have the other
changes you suggest and send as a regular patch. 


^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: Question Print Formatting iproute2
  2020-07-27 23:47 ` Stephen Hemminger
@ 2020-07-28  4:14   ` Briana Oursler
  2020-07-28  5:20   ` [PATCH iproute2] tc: Add space after format specifier Briana Oursler
  1 sibling, 0 replies; 11+ messages in thread
From: Briana Oursler @ 2020-07-28  4:14 UTC (permalink / raw)
  To: Stephen Hemminger
  Cc: netdev, Alexey Kuznetsov, Petr Machata, Davide Caratti,
	Stefano Brivio, Jiri Pirko

On Mon, 2020-07-27 at 16:47 -0700, Stephen Hemminger wrote:
> On Sun, 26 Jul 2020 21:46:16 -0700
> Briana Oursler <briana.oursler@gmail.com> wrote:
> 
> > I have a patch I've written to address a format specifier change
> > that
> > breaks some tests in tc-testing, but I wanted to ask about the
> > change
> > and for some guidance with respect to how formatters are approached
> > in
> > iproute2. 
> > 
> > On a recent run of tdc tests I ran ./tdc.py -c qdisc and found:
> > 
> > 1..91
> > not ok 1 8b6e - Create RED with no flags
> >         Could not match regex pattern. Verify command output:
> > qdisc red 1: root refcnt 2 limit 1Mb min 100Kb max 300Kb
> > 
> > not ok 2 342e - Create RED with adaptive flag
> >         Could not match regex pattern. Verify command output:
> > qdisc red 1: root refcnt 2 limit 1Mb min 100Kb max 300Kbadaptive
> > 
> > not ok 3 2d4b - Create RED with ECN flag
> >         Could not match regex pattern. Verify command output:
> > qdisc red 1: root refcnt 2 limit 1Mb min 100Kb max 300Kbecn
> > 
> > not ok 4 650f - Create RED with flags ECN, adaptive
> >         Could not match regex pattern. Verify command output:
> > qdisc red 1: root refcnt 2 limit 1Mb min 100Kb max 300Kbecn
> > adaptive
> > 
> > not ok 5 5f15 - Create RED with flags ECN, harddrop
> >         Could not match regex pattern. Verify command output:
> > qdisc red 1: root refcnt 2 limit 1Mb min 100Kb max 300Kbecn
> > harddrop
> > 
> > not ok 6 53e8 - Create RED with flags ECN, nodrop
> >         Could not match regex pattern. Verify command output:
> > qdisc red 1: root refcnt 2 limit 1Mb min 100Kb max 300Kbecn nodrop
> > 
> > ok 7 d091 - Fail to create RED with only nodrop flag
> > not ok 8 af8e - Create RED with flags ECN, nodrop, harddrop
> >         Could not match regex pattern. Verify command output:
> > qdisc red 1: root refcnt 2 limit 1Mb min 100Kb max 300Kbecn
> > harddrop
> > nodrop
> > 
> > I git bisected and found d0e450438571("tc: q_red: Add support for
> > qevents "mark" and "early_drop"), the commit that introduced the
> > formatting change causing the break. 
> > 
> > -       print_string(PRINT_FP, NULL, "max %s ", sprint_size(qopt-
> > >qth_max, b3));
> > +       print_string(PRINT_FP, NULL, "max %s", sprint_size(qopt-
> > >qth_max, b3));
> > 
> > I made a patch that adds a space after the format specifier in the
> > iproute2 tc/q_red.c and tested it using: tdc.py -c qdisc. After the
> > change, all the broken tdc qdisc red tests return ok. I'm including
> > the
> > patch under the scissors line.
> > 
> > I wanted to ask the ML if adding the space after the specifier is
> > preferred usage.
> > The commit also had: 
> >  -               print_uint(PRINT_ANY, "ewma", "ewma %u ", qopt-
> > >Wlog);
> >  +               print_uint(PRINT_ANY, "ewma", " ewma %u ", qopt-
> > >Wlog);
> > 
> > so I wanted to check with everyone.
> > 
> > Thanks 
> > > 8--------------------------------------------------------------
> > > ----------8<  
> > From 1e7bee22a799a320bd230ad959d459b386bec26d Mon Sep 17 00:00:00
> > 2001
> > Subject: [RFC iproute2-next] tc: Add space after format specifier
> > 
> > Add space after format specifier in print_string call. Fixes broken
> > qdisc tests within tdc testing suite.
> > 
> > Fixes: d0e450438571("tc: q_red: Add support for
> > qevents "mark" and "early_drop")
> > 
> > Signed-off-by: Briana Oursler <briana.oursler@gmail.com>
> > ---
> >  tc/q_red.c | 2 +-
> >  1 file changed, 1 insertion(+), 1 deletion(-)
> > 
> > diff --git a/tc/q_red.c b/tc/q_red.c
> > index dfef1bf8..7106645a 100644
> > --- a/tc/q_red.c
> > +++ b/tc/q_red.c
> > @@ -222,7 +222,7 @@ static int red_print_opt(struct qdisc_util *qu,
> > FILE *f, struct rtattr *opt)
> >  	print_uint(PRINT_JSON, "min", NULL, qopt->qth_min);
> >  	print_string(PRINT_FP, NULL, "min %s ", sprint_size(qopt-
> > >qth_min, b2));
> >  	print_uint(PRINT_JSON, "max", NULL, qopt->qth_max);
> > -	print_string(PRINT_FP, NULL, "max %s", sprint_size(qopt-
> > >qth_max, b3));
> > +	print_string(PRINT_FP, NULL, "max %s ", sprint_size(qopt-
> > >qth_max, b3));
> >  
> >  	tc_red_print_flags(qopt->flags);
> >  
> > 
> > base-commit: 1ca65af1c5e131861a3989cca3c7ca8b067e0833
> 
> Looks fine, please resend a normal patch targeted at current iproute2
> not next.
> 
Will do, thank you.


^ permalink raw reply	[flat|nested] 11+ messages in thread

* [PATCH iproute2] tc: Add space after format specifier
  2020-07-27 23:47 ` Stephen Hemminger
  2020-07-28  4:14   ` Briana Oursler
@ 2020-07-28  5:20   ` Briana Oursler
  2020-07-28  5:53     ` Briana Oursler
                       ` (2 more replies)
  1 sibling, 3 replies; 11+ messages in thread
From: Briana Oursler @ 2020-07-28  5:20 UTC (permalink / raw)
  To: Stephen Hemminger
  Cc: Petr Machata, Alexey Kuznetsov, Davide Caratti, Stefano Brivio,
	netdev, Briana Oursler

Add space after format specifier in print_string call. Fixes broken
qdisc tests within tdc testing suite. Per suggestion from Petr Machata,
remove a space and change spacing in tc/q_event.c to complete the fix.

Tested fix in tdc using:
./tdc.py -c qdisc

All qdisc RED tests return ok.

Fixes: d0e450438571("tc: q_red: Add support for
qevents "mark" and "early_drop")

Signed-off-by: Briana Oursler <briana.oursler@gmail.com>
---
 tc/q_red.c     | 4 ++--
 tc/tc_qevent.c | 3 ++-
 2 files changed, 4 insertions(+), 3 deletions(-)

diff --git a/tc/q_red.c b/tc/q_red.c
index dfef1bf8..df788f8f 100644
--- a/tc/q_red.c
+++ b/tc/q_red.c
@@ -222,12 +222,12 @@ static int red_print_opt(struct qdisc_util *qu, FILE *f, struct rtattr *opt)
 	print_uint(PRINT_JSON, "min", NULL, qopt->qth_min);
 	print_string(PRINT_FP, NULL, "min %s ", sprint_size(qopt->qth_min, b2));
 	print_uint(PRINT_JSON, "max", NULL, qopt->qth_max);
-	print_string(PRINT_FP, NULL, "max %s", sprint_size(qopt->qth_max, b3));
+	print_string(PRINT_FP, NULL, "max %s ", sprint_size(qopt->qth_max, b3));
 
 	tc_red_print_flags(qopt->flags);
 
 	if (show_details) {
-		print_uint(PRINT_ANY, "ewma", " ewma %u ", qopt->Wlog);
+		print_uint(PRINT_ANY, "ewma", "ewma %u ", qopt->Wlog);
 		if (max_P)
 			print_float(PRINT_ANY, "probability",
 				    "probability %lg ", max_P / pow(2, 32));
diff --git a/tc/tc_qevent.c b/tc/tc_qevent.c
index 2c010fcf..34568070 100644
--- a/tc/tc_qevent.c
+++ b/tc/tc_qevent.c
@@ -82,8 +82,9 @@ void qevents_print(struct qevent_util *qevents, FILE *f)
 			}
 
 			open_json_object(NULL);
-			print_string(PRINT_ANY, "kind", " qevent %s", qevents->id);
+			print_string(PRINT_ANY, "kind", "qevent %s", qevents->id);
 			qevents->print_qevent(qevents, f);
+			print_string(PRINT_FP, NULL, "%s", " ");
 			close_json_object();
 		}
 	}
-- 
2.27.0


^ permalink raw reply related	[flat|nested] 11+ messages in thread

* Re: [PATCH iproute2] tc: Add space after format specifier
  2020-07-28  5:20   ` [PATCH iproute2] tc: Add space after format specifier Briana Oursler
@ 2020-07-28  5:53     ` Briana Oursler
  2020-07-29 15:24       ` David Ahern
  2020-07-28 13:24     ` Petr Machata
  2020-07-29 17:07     ` David Ahern
  2 siblings, 1 reply; 11+ messages in thread
From: Briana Oursler @ 2020-07-28  5:53 UTC (permalink / raw)
  To: Stephen Hemminger
  Cc: Petr Machata, Alexey Kuznetsov, Davide Caratti, Stefano Brivio, netdev

On Mon, 2020-07-27 at 22:20 -0700, Briana Oursler wrote:
> Add space after format specifier in print_string call. Fixes broken
> qdisc tests within tdc testing suite. Per suggestion from Petr
> Machata,
> remove a space and change spacing in tc/q_event.c to complete the
> fix.
> 
> Tested fix in tdc using:
> ./tdc.py -c qdisc
> 
> All qdisc RED tests return ok.
> 
> Fixes: d0e450438571("tc: q_red: Add support for
> qevents "mark" and "early_drop")
> 
> Signed-off-by: Briana Oursler <briana.oursler@gmail.com>
> ---
>  tc/q_red.c     | 4 ++--
>  tc/tc_qevent.c | 3 ++-
>  2 files changed, 4 insertions(+), 3 deletions(-)
> 
> diff --git a/tc/q_red.c b/tc/q_red.c
> index dfef1bf8..df788f8f 100644
> --- a/tc/q_red.c
> +++ b/tc/q_red.c
> @@ -222,12 +222,12 @@ static int red_print_opt(struct qdisc_util *qu,
> FILE *f, struct rtattr *opt)
>  	print_uint(PRINT_JSON, "min", NULL, qopt->qth_min);
>  	print_string(PRINT_FP, NULL, "min %s ", sprint_size(qopt-
> >qth_min, b2));
>  	print_uint(PRINT_JSON, "max", NULL, qopt->qth_max);
> -	print_string(PRINT_FP, NULL, "max %s", sprint_size(qopt-
> >qth_max, b3));
> +	print_string(PRINT_FP, NULL, "max %s ", sprint_size(qopt-
> >qth_max, b3));
>  
>  	tc_red_print_flags(qopt->flags);
>  
>  	if (show_details) {
> -		print_uint(PRINT_ANY, "ewma", " ewma %u ", qopt->Wlog);
> +		print_uint(PRINT_ANY, "ewma", "ewma %u ", qopt->Wlog);
>  		if (max_P)
>  			print_float(PRINT_ANY, "probability",
>  				    "probability %lg ", max_P / pow(2,
> 32));
> diff --git a/tc/tc_qevent.c b/tc/tc_qevent.c
> index 2c010fcf..34568070 100644
> --- a/tc/tc_qevent.c
> +++ b/tc/tc_qevent.c
> @@ -82,8 +82,9 @@ void qevents_print(struct qevent_util *qevents,
> FILE *f)
>  			}
>  
>  			open_json_object(NULL);
> -			print_string(PRINT_ANY, "kind", " qevent %s",
> qevents->id);
> +			print_string(PRINT_ANY, "kind", "qevent %s",
> qevents->id);
>  			qevents->print_qevent(qevents, f);
> +			print_string(PRINT_FP, NULL, "%s", " ");
>  			close_json_object();
>  		}
>  	}

I made the subject PATCH iproute2 after the question discussion with
everyone, but I realized that the patch it fixes is in iproute2-next
but not yet in iproute2. Sorry about the confusion. Should I resend to
iproute2-next?


^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: [PATCH iproute2] tc: Add space after format specifier
  2020-07-28  5:20   ` [PATCH iproute2] tc: Add space after format specifier Briana Oursler
  2020-07-28  5:53     ` Briana Oursler
@ 2020-07-28 13:24     ` Petr Machata
  2020-07-29 17:07     ` David Ahern
  2 siblings, 0 replies; 11+ messages in thread
From: Petr Machata @ 2020-07-28 13:24 UTC (permalink / raw)
  To: Briana Oursler
  Cc: Stephen Hemminger, Alexey Kuznetsov, Davide Caratti,
	Stefano Brivio, netdev


Briana Oursler <briana.oursler@gmail.com> writes:

> Add space after format specifier in print_string call. Fixes broken
> qdisc tests within tdc testing suite. Per suggestion from Petr Machata,
> remove a space and change spacing in tc/q_event.c to complete the fix.
>
> Tested fix in tdc using:
> ./tdc.py -c qdisc
>
> All qdisc RED tests return ok.
>
> Fixes: d0e450438571("tc: q_red: Add support for
> qevents "mark" and "early_drop")
>
> Signed-off-by: Briana Oursler <briana.oursler@gmail.com>

Tested-by: Petr Machata <petrm@mellanox.com>

Thanks for taking care of this!

^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: [PATCH iproute2] tc: Add space after format specifier
  2020-07-28  5:53     ` Briana Oursler
@ 2020-07-29 15:24       ` David Ahern
  0 siblings, 0 replies; 11+ messages in thread
From: David Ahern @ 2020-07-29 15:24 UTC (permalink / raw)
  To: Briana Oursler, Stephen Hemminger
  Cc: Petr Machata, Alexey Kuznetsov, Davide Caratti, Stefano Brivio, netdev

On 7/27/20 11:53 PM, Briana Oursler wrote:
> I made the subject PATCH iproute2 after the question discussion with
> everyone, but I realized that the patch it fixes is in iproute2-next
> but not yet in iproute2. Sorry about the confusion. Should I resend to
> iproute2-next?

no, it is fine.


^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: [PATCH iproute2] tc: Add space after format specifier
  2020-07-28  5:20   ` [PATCH iproute2] tc: Add space after format specifier Briana Oursler
  2020-07-28  5:53     ` Briana Oursler
  2020-07-28 13:24     ` Petr Machata
@ 2020-07-29 17:07     ` David Ahern
  2 siblings, 0 replies; 11+ messages in thread
From: David Ahern @ 2020-07-29 17:07 UTC (permalink / raw)
  To: Briana Oursler, Stephen Hemminger
  Cc: Petr Machata, Alexey Kuznetsov, Davide Caratti, Stefano Brivio, netdev

On 7/27/20 11:20 PM, Briana Oursler wrote:
> Add space after format specifier in print_string call. Fixes broken
> qdisc tests within tdc testing suite. Per suggestion from Petr Machata,
> remove a space and change spacing in tc/q_event.c to complete the fix.
> 
> Tested fix in tdc using:
> ./tdc.py -c qdisc
> 
> All qdisc RED tests return ok.
> 
> Fixes: d0e450438571("tc: q_red: Add support for
> qevents "mark" and "early_drop")
> 
> Signed-off-by: Briana Oursler <briana.oursler@gmail.com>
> ---
>  tc/q_red.c     | 4 ++--
>  tc/tc_qevent.c | 3 ++-
>  2 files changed, 4 insertions(+), 3 deletions(-)
> 

Applied to iproute2-next after fixing the 'Fixes' line. It should be a
single line before the Signed-off-by


^ permalink raw reply	[flat|nested] 11+ messages in thread

end of thread, other threads:[~2020-07-29 17:07 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-07-27  4:46 Question Print Formatting iproute2 Briana Oursler
2020-07-27 19:31 ` Petr Machata
2020-07-27 20:37   ` Stephen Hemminger
2020-07-28  4:12   ` Briana Oursler
2020-07-27 23:47 ` Stephen Hemminger
2020-07-28  4:14   ` Briana Oursler
2020-07-28  5:20   ` [PATCH iproute2] tc: Add space after format specifier Briana Oursler
2020-07-28  5:53     ` Briana Oursler
2020-07-29 15:24       ` David Ahern
2020-07-28 13:24     ` Petr Machata
2020-07-29 17:07     ` David Ahern

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.