netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCHv2 iproute2] u32: fix TC_U32_TERMINAL printing
@ 2023-03-01 14:21 Hangbin Liu
  2023-03-01 17:55 ` Victor Nogueira
  2023-03-05 17:00 ` patchwork-bot+netdevbpf
  0 siblings, 2 replies; 3+ messages in thread
From: Hangbin Liu @ 2023-03-01 14:21 UTC (permalink / raw)
  To: netdev; +Cc: David Ahern, Stephen Hemminger, Jamal Hadi Salim, Hangbin Liu

We previously printed an asterisk if there was no 'sel' or 'TC_U32_TERMINAL'
flag. However, commit 1ff22754 ("u32: fix json formatting of flowid")
changed the logic to print an asterisk only if there is a 'TC_U32_TERMINAL'
flag. Therefore, we need to fix this regression.

Before the fix, the tdc u32 test failed:

1..11
not ok 1 afa9 - Add u32 with source match
        Could not match regex pattern. Verify command output:
filter protocol ip pref 1 u32 chain 0
filter protocol ip pref 1 u32 chain 0 fh 800: ht divisor 1
filter protocol ip pref 1 u32 chain 0 fh 800::800 order 2048 key ht 800 bkt 0 *flowid 1:1 not_in_hw
  match 7f000001/ffffffff at 12
        action order 1: gact action pass
         random type none pass val 0
         index 1 ref 1 bind 1

After fix, the test passed:
1..11
ok 1 afa9 - Add u32 with source match

Fixes: 1ff227545ce1 ("u32: fix json formatting of flowid")
Signed-off-by: Hangbin Liu <liuhangbin@gmail.com>
---
v2: add tdc test result in the commit description
---
 tc/f_u32.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/tc/f_u32.c b/tc/f_u32.c
index bfe9e5f9..de2d0c9e 100644
--- a/tc/f_u32.c
+++ b/tc/f_u32.c
@@ -1273,7 +1273,7 @@ static int u32_print_opt(struct filter_util *qu, FILE *f, struct rtattr *opt,
 	if (tb[TCA_U32_CLASSID]) {
 		__u32 classid = rta_getattr_u32(tb[TCA_U32_CLASSID]);
 		SPRINT_BUF(b1);
-		if (sel && (sel->flags & TC_U32_TERMINAL))
+		if (!sel || !(sel->flags & TC_U32_TERMINAL))
 			print_string(PRINT_FP, NULL, "*", NULL);
 
 		print_string(PRINT_ANY, "flowid", "flowid %s ",
-- 
2.38.1


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

* Re: [PATCHv2 iproute2] u32: fix TC_U32_TERMINAL printing
  2023-03-01 14:21 [PATCHv2 iproute2] u32: fix TC_U32_TERMINAL printing Hangbin Liu
@ 2023-03-01 17:55 ` Victor Nogueira
  2023-03-05 17:00 ` patchwork-bot+netdevbpf
  1 sibling, 0 replies; 3+ messages in thread
From: Victor Nogueira @ 2023-03-01 17:55 UTC (permalink / raw)
  To: Hangbin Liu, netdev; +Cc: David Ahern, Stephen Hemminger, Jamal Hadi Salim

On 01/03/2023 11:21, Hangbin Liu wrote:
> We previously printed an asterisk if there was no 'sel' or 'TC_U32_TERMINAL'
> flag. However, commit 1ff22754 ("u32: fix json formatting of flowid")
> changed the logic to print an asterisk only if there is a 'TC_U32_TERMINAL'
> flag. Therefore, we need to fix this regression.
> 
> Before the fix, the tdc u32 test failed:
> 
> 1..11
> not ok 1 afa9 - Add u32 with source match
>          Could not match regex pattern. Verify command output:
> filter protocol ip pref 1 u32 chain 0
> filter protocol ip pref 1 u32 chain 0 fh 800: ht divisor 1
> filter protocol ip pref 1 u32 chain 0 fh 800::800 order 2048 key ht 800 bkt 0 *flowid 1:1 not_in_hw
>    match 7f000001/ffffffff at 12
>          action order 1: gact action pass
>           random type none pass val 0
>           index 1 ref 1 bind 1
> 
> After fix, the test passed:
> 1..11
> ok 1 afa9 - Add u32 with source match
> 
> Fixes: 1ff227545ce1 ("u32: fix json formatting of flowid")
> Signed-off-by: Hangbin Liu <liuhangbin@gmail.com>

Reviewed-by: Victor Nogueira <victor@mojatatu.com>

> ---
> v2: add tdc test result in the commit description
> ---
>   tc/f_u32.c | 2 +-
>   1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/tc/f_u32.c b/tc/f_u32.c
> index bfe9e5f9..de2d0c9e 100644
> --- a/tc/f_u32.c
> +++ b/tc/f_u32.c
> @@ -1273,7 +1273,7 @@ static int u32_print_opt(struct filter_util *qu, FILE *f, struct rtattr *opt,
>   	if (tb[TCA_U32_CLASSID]) {
>   		__u32 classid = rta_getattr_u32(tb[TCA_U32_CLASSID]);
>   		SPRINT_BUF(b1);
> -		if (sel && (sel->flags & TC_U32_TERMINAL))
> +		if (!sel || !(sel->flags & TC_U32_TERMINAL))
>   			print_string(PRINT_FP, NULL, "*", NULL);
>   
>   		print_string(PRINT_ANY, "flowid", "flowid %s ",


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

* Re: [PATCHv2 iproute2] u32: fix TC_U32_TERMINAL printing
  2023-03-01 14:21 [PATCHv2 iproute2] u32: fix TC_U32_TERMINAL printing Hangbin Liu
  2023-03-01 17:55 ` Victor Nogueira
@ 2023-03-05 17:00 ` patchwork-bot+netdevbpf
  1 sibling, 0 replies; 3+ messages in thread
From: patchwork-bot+netdevbpf @ 2023-03-05 17:00 UTC (permalink / raw)
  To: Hangbin Liu; +Cc: netdev, dsahern, stephen, jhs

Hello:

This patch was applied to iproute2/iproute2.git (main)
by Stephen Hemminger <stephen@networkplumber.org>:

On Wed,  1 Mar 2023 22:21:00 +0800 you wrote:
> We previously printed an asterisk if there was no 'sel' or 'TC_U32_TERMINAL'
> flag. However, commit 1ff22754 ("u32: fix json formatting of flowid")
> changed the logic to print an asterisk only if there is a 'TC_U32_TERMINAL'
> flag. Therefore, we need to fix this regression.
> 
> Before the fix, the tdc u32 test failed:
> 
> [...]

Here is the summary with links:
  - [PATCHv2,iproute2] u32: fix TC_U32_TERMINAL printing
    https://git.kernel.org/pub/scm/network/iproute2/iproute2.git/commit/?id=2854d69a99f6

You are awesome, thank you!
-- 
Deet-doot-dot, I am a bot.
https://korg.docs.kernel.org/patchwork/pwbot.html



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

end of thread, other threads:[~2023-03-05 17:00 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-03-01 14:21 [PATCHv2 iproute2] u32: fix TC_U32_TERMINAL printing Hangbin Liu
2023-03-01 17:55 ` Victor Nogueira
2023-03-05 17:00 ` patchwork-bot+netdevbpf

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).