diff options
author | Stephen Suryaputra <ssuryaextr@gmail.com> | 2021-10-14 09:08:45 -0400 |
---|---|---|
committer | Jakub Kicinski <kuba@kernel.org> | 2021-10-15 15:32:04 -0700 |
commit | 0857d6f8c759d95f89d0436f86cdfd189ef99f20 (patch) | |
tree | ca3d4db9a3a182d244c215e63bd13ae47f6ab9b3 /tools/testing/selftests/net/forwarding/lib.sh | |
parent | 4884ddba7f124da65cafa983b49b27daa460b91d (diff) | |
download | linux-0857d6f8c759d95f89d0436f86cdfd189ef99f20.tar.gz |
ipv6: When forwarding count rx stats on the orig netdev
Commit bdb7cc643fc9 ("ipv6: Count interface receive statistics on the
ingress netdev") does not work when ip6_forward() executes on the skbs
with vrf-enslaved netdev. Use IP6CB(skb)->iif to get to the right one.
Add a selftest script to verify.
Fixes: bdb7cc643fc9 ("ipv6: Count interface receive statistics on the ingress netdev")
Signed-off-by: Stephen Suryaputra <ssuryaextr@gmail.com>
Reviewed-by: David Ahern <dsahern@kernel.org>
Link: https://lore.kernel.org/r/20211014130845.410602-1-ssuryaextr@gmail.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
Diffstat (limited to 'tools/testing/selftests/net/forwarding/lib.sh')
-rw-r--r-- | tools/testing/selftests/net/forwarding/lib.sh | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/tools/testing/selftests/net/forwarding/lib.sh b/tools/testing/selftests/net/forwarding/lib.sh index e7fc5c35b569..92087d423bcf 100644 --- a/tools/testing/selftests/net/forwarding/lib.sh +++ b/tools/testing/selftests/net/forwarding/lib.sh @@ -751,6 +751,14 @@ qdisc_parent_stats_get() | jq '.[] | select(.parent == "'"$parent"'") | '"$selector" } +ipv6_stats_get() +{ + local dev=$1; shift + local stat=$1; shift + + cat /proc/net/dev_snmp6/$dev | grep "^$stat" | cut -f2 +} + humanize() { local speed=$1; shift |