Re: [PATCH net-next v4 3/3] net: sched: make skip_sw actually skip software

From: Marcelo Ricardo Leitner
Date: Wed Mar 27 2024 - 20:48:40 EST


On Mon, Mar 25, 2024 at 08:47:36PM +0000, Asbjørn Sloth Tønnesen wrote:
..
> +----------------------------+--------+--------+--------+
> | tests with only skip_sw rules below: |
> +----------------------------+--------+--------+--------+
> | 1 non-matching rule | 2694.7 | 3058.7 | 1.14x |
> | 1 n-m rule, match trap | 2611.2 | 3323.1 | 1.27x |
> | 1 n-m rule, goto non-chain | 2886.8 | 2945.9 | 1.02x |
> | 5 non-matching rules | 1958.2 | 3061.3 | 1.56x |
> | 5 n-m rules, match trap | 1911.9 | 3327.0 | 1.74x |
> | 5 n-m rules, goto non-chain| 2883.1 | 2947.5 | 1.02x |
> | 10 non-matching rules | 1466.3 | 3062.8 | 2.09x |
> | 10 n-m rules, match trap | 1444.3 | 3317.9 | 2.30x |
> | 10 n-m rules,goto non-chain| 2883.1 | 2939.5 | 1.02x |
> | 25 non-matching rules | 838.5 | 3058.9 | 3.65x |
> | 25 n-m rules, match trap | 824.5 | 3323.0 | 4.03x |
> | 25 n-m rules,goto non-chain| 2875.8 | 2944.7 | 1.02x |
> | 50 non-matching rules | 488.1 | 3054.7 | 6.26x |
[A]

> | 50 n-m rules, match trap | 484.9 | 3318.5 | 6.84x |

Interesting. I can't explain why it consistently got 10% better than
[A] after the patch. If you check tcf_classify(), even though it
resumes to action, it still searches for the right chain. Maybe
something works differently in the driver.

In on the logs,
https://files.fiberby.net/ast/2024/tc_skip_sw/v2_tests/test_runs/netnext/tests/non_matching_and_trap_007/tc.txt

filter protocol 802.1Q pref 8 flower chain 0
filter protocol 802.1Q pref 8 flower chain 0 handle 0x1
vlan_ethtype ip
eth_type ipv4
dst_ip 10.53.22.3
skip_sw
in_hw in_hw_count 1
action order 1: gact action trap
random type none pass val 0
index 8 ref 1 bind 1 installed 20 sec used 0 sec
Action statistics:
Sent 29894330340 bytes 439622505 pkt (dropped 0, overlimits 0 requeues 0)
Sent software 0 bytes 0 pkt
Sent hardware 29894330340 bytes 439622505 pkt
backlog 0b 0p requeues 0
used_hw_stats delayed

It matched nicely.

> | 50 n-m rules,goto non-chain| 2884.1 | 2939.7 | 1.02x |
[B]

If we compare [A] and [B], there's still a 5.9% increase, plus
not requiring somewhat hacky rules.

Reviewed-by: Marcelo Ricardo Leitner <marcelo.leitner@xxxxxxxxx>