diff options
author | Daniel Machon <[email protected]> | 2024-10-09 14:49:56 +0200 |
---|---|---|
committer | Jakub Kicinski <[email protected]> | 2024-10-11 15:42:51 -0700 |
commit | 8a6be4bd6fb319cee63d228e37c8dda5fd1eb74a (patch) | |
tree | d8eb39743592e0301443cba686450c256cf64921 /tools/testing/selftests/bpf/prog_tests/autoload.c | |
parent | 22600596b6756b166fd052d5facb66287e6f0bad (diff) |
net: sparx5: fix source port register when mirroring
When port mirroring is added to a port, the bit position of the source
port, needs to be written to the register ANA_AC_PROBE_PORT_CFG. This
register is replicated for n_ports > 32, and therefore we need to derive
the correct register from the port number.
Before this patch, we wrongly calculate the register from portno /
BITS_PER_BYTE, where the divisor ought to be 32, causing any port >=8 to
be written to the wrong register. We fix this, by using do_div(), where
the dividend is the register, the remainder is the bit position and the
divisor is now 32.
Fixes: 4e50d72b3b95 ("net: sparx5: add port mirroring implementation")
Signed-off-by: Daniel Machon <[email protected]>
Reviewed-by: Simon Horman <[email protected]>
Link: https://patch.msgid.link/[email protected]
Signed-off-by: Jakub Kicinski <[email protected]>
Diffstat (limited to 'tools/testing/selftests/bpf/prog_tests/autoload.c')
0 files changed, 0 insertions, 0 deletions