netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH net-next] selftests/tc-testing: Adapt tc police action tests for Gb rounding changes
@ 2025-09-12 15:46 Victor Nogueira
  2025-09-14  5:06 ` Cong Wang
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: Victor Nogueira @ 2025-09-12 15:46 UTC (permalink / raw)
  To: jhs, xiyou.wangcong, jiri, kuba, pabeni; +Cc: netdev, jay.vosburgh

For the tc police action, iproute2 rounds up mtu and burst sizes to a
higher order representation. For example, if the user specifies the default
mtu for a police action instance (4294967295 bytes), iproute2 will output
it as 4096Mb when this action instance is dumped. After Jay's changes [1],
iproute2 will round up to Gb, so 4096Mb becomes 4Gb. With that in mind,
fix police's tc test output so that it works both with the current
iproute2 version and Jay's.

[1] https://lore.kernel.org/netdev/20250907014216.2691844-1-jay.vosburgh@canonical.com/

Signed-off-by: Victor Nogueira <victor@mojatatu.com>
---
 tools/testing/selftests/tc-testing/tc-tests/actions/police.json | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/tools/testing/selftests/tc-testing/tc-tests/actions/police.json b/tools/testing/selftests/tc-testing/tc-tests/actions/police.json
index 5596f4df0e9f..b2cc6ea74450 100644
--- a/tools/testing/selftests/tc-testing/tc-tests/actions/police.json
+++ b/tools/testing/selftests/tc-testing/tc-tests/actions/police.json
@@ -879,7 +879,7 @@
         "cmdUnderTest": "$TC actions add action police pkts_rate 1000 pkts_burst 200 index 1",
         "expExitCode": "0",
         "verifyCmd": "$TC actions ls action police",
-        "matchPattern": "action order [0-9]*:  police 0x1 rate 0bit burst 0b mtu 4096Mb pkts_rate 1000 pkts_burst 200",
+        "matchPattern": "action order [0-9]*:  police 0x1 rate 0bit burst 0b mtu (4Gb|4096Mb) pkts_rate 1000 pkts_burst 200",
         "matchCount": "1",
         "teardown": [
             "$TC actions flush action police"
-- 
2.51.0


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

* Re: [PATCH net-next] selftests/tc-testing: Adapt tc police action tests for Gb rounding changes
  2025-09-12 15:46 [PATCH net-next] selftests/tc-testing: Adapt tc police action tests for Gb rounding changes Victor Nogueira
@ 2025-09-14  5:06 ` Cong Wang
  2025-09-15 22:14 ` Jay Vosburgh
  2025-09-15 23:20 ` patchwork-bot+netdevbpf
  2 siblings, 0 replies; 4+ messages in thread
From: Cong Wang @ 2025-09-14  5:06 UTC (permalink / raw)
  To: Victor Nogueira; +Cc: jhs, jiri, kuba, pabeni, netdev, jay.vosburgh

On Fri, Sep 12, 2025 at 8:46 AM Victor Nogueira <victor@mojatatu.com> wrote:
>
> For the tc police action, iproute2 rounds up mtu and burst sizes to a
> higher order representation. For example, if the user specifies the default
> mtu for a police action instance (4294967295 bytes), iproute2 will output
> it as 4096Mb when this action instance is dumped. After Jay's changes [1],
> iproute2 will round up to Gb, so 4096Mb becomes 4Gb. With that in mind,
> fix police's tc test output so that it works both with the current
> iproute2 version and Jay's.
>
> [1] https://lore.kernel.org/netdev/20250907014216.2691844-1-jay.vosburgh@canonical.com/
>
> Signed-off-by: Victor Nogueira <victor@mojatatu.com>

Reviewed-by: Cong Wang <cwang@multikernel.io>

Thanks!

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

* Re: [PATCH net-next] selftests/tc-testing: Adapt tc police action tests for Gb rounding changes
  2025-09-12 15:46 [PATCH net-next] selftests/tc-testing: Adapt tc police action tests for Gb rounding changes Victor Nogueira
  2025-09-14  5:06 ` Cong Wang
@ 2025-09-15 22:14 ` Jay Vosburgh
  2025-09-15 23:20 ` patchwork-bot+netdevbpf
  2 siblings, 0 replies; 4+ messages in thread
From: Jay Vosburgh @ 2025-09-15 22:14 UTC (permalink / raw)
  To: Victor Nogueira; +Cc: jhs, xiyou.wangcong, jiri, kuba, pabeni, netdev

Victor Nogueira <victor@mojatatu.com> wrote:

>For the tc police action, iproute2 rounds up mtu and burst sizes to a
>higher order representation. For example, if the user specifies the default
>mtu for a police action instance (4294967295 bytes), iproute2 will output
>it as 4096Mb when this action instance is dumped. After Jay's changes [1],
>iproute2 will round up to Gb, so 4096Mb becomes 4Gb. With that in mind,
>fix police's tc test output so that it works both with the current
>iproute2 version and Jay's.
>
>[1] https://lore.kernel.org/netdev/20250907014216.2691844-1-jay.vosburgh@canonical.com/
>
>Signed-off-by: Victor Nogueira <victor@mojatatu.com>

Reviewed-by: Jay Vosburgh <jay.vosburgh@canonical.com>


>---
> tools/testing/selftests/tc-testing/tc-tests/actions/police.json | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
>diff --git a/tools/testing/selftests/tc-testing/tc-tests/actions/police.json b/tools/testing/selftests/tc-testing/tc-tests/actions/police.json
>index 5596f4df0e9f..b2cc6ea74450 100644
>--- a/tools/testing/selftests/tc-testing/tc-tests/actions/police.json
>+++ b/tools/testing/selftests/tc-testing/tc-tests/actions/police.json
>@@ -879,7 +879,7 @@
>         "cmdUnderTest": "$TC actions add action police pkts_rate 1000 pkts_burst 200 index 1",
>         "expExitCode": "0",
>         "verifyCmd": "$TC actions ls action police",
>-        "matchPattern": "action order [0-9]*:  police 0x1 rate 0bit burst 0b mtu 4096Mb pkts_rate 1000 pkts_burst 200",
>+        "matchPattern": "action order [0-9]*:  police 0x1 rate 0bit burst 0b mtu (4Gb|4096Mb) pkts_rate 1000 pkts_burst 200",
>         "matchCount": "1",
>         "teardown": [
>             "$TC actions flush action police"
>-- 
>2.51.0
>

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

* Re: [PATCH net-next] selftests/tc-testing: Adapt tc police action tests for Gb rounding changes
  2025-09-12 15:46 [PATCH net-next] selftests/tc-testing: Adapt tc police action tests for Gb rounding changes Victor Nogueira
  2025-09-14  5:06 ` Cong Wang
  2025-09-15 22:14 ` Jay Vosburgh
@ 2025-09-15 23:20 ` patchwork-bot+netdevbpf
  2 siblings, 0 replies; 4+ messages in thread
From: patchwork-bot+netdevbpf @ 2025-09-15 23:20 UTC (permalink / raw)
  To: Victor Nogueira
  Cc: jhs, xiyou.wangcong, jiri, kuba, pabeni, netdev, jay.vosburgh

Hello:

This patch was applied to netdev/net-next.git (main)
by Jakub Kicinski <kuba@kernel.org>:

On Fri, 12 Sep 2025 12:46:16 -0300 you wrote:
> For the tc police action, iproute2 rounds up mtu and burst sizes to a
> higher order representation. For example, if the user specifies the default
> mtu for a police action instance (4294967295 bytes), iproute2 will output
> it as 4096Mb when this action instance is dumped. After Jay's changes [1],
> iproute2 will round up to Gb, so 4096Mb becomes 4Gb. With that in mind,
> fix police's tc test output so that it works both with the current
> iproute2 version and Jay's.
> 
> [...]

Here is the summary with links:
  - [net-next] selftests/tc-testing: Adapt tc police action tests for Gb rounding changes
    https://git.kernel.org/netdev/net-next/c/b7df2e7eaef7

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] 4+ messages in thread

end of thread, other threads:[~2025-09-15 23:20 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-09-12 15:46 [PATCH net-next] selftests/tc-testing: Adapt tc police action tests for Gb rounding changes Victor Nogueira
2025-09-14  5:06 ` Cong Wang
2025-09-15 22:14 ` Jay Vosburgh
2025-09-15 23:20 ` 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).