summaryrefslogtreecommitdiff
path: root/include/linux
diff options
context:
space:
mode:
authorChristian Marangi <ansuelsmth@gmail.com>2022-12-29 19:33:32 +0300
committerDavid S. Miller <davem@davemloft.net>2023-01-01 12:27:12 +0300
commit9807ae69746196ee4bbffe7d22d22ab2b61c6ed0 (patch)
tree85fd24d2f28a59d0b45ad627b338c3f87ae46aa0 /include/linux
parentd039535850ee47079d59527e96be18d8e0daa84b (diff)
downloadlinux-9807ae69746196ee4bbffe7d22d22ab2b61c6ed0.tar.xz
net: dsa: qca8k: fix wrong length value for mgmt eth packet
The assumption that Documentation was right about how this value work was wrong. It was discovered that the length value of the mgmt header is in step of word size. As an example to process 4 byte of data the correct length to set is 2. To process 8 byte 4, 12 byte 6, 16 byte 8... Odd values will always return the next size on the ack packet. (length of 3 (6 byte) will always return 8 bytes of data) This means that a value of 15 (0xf) actually means reading/writing 32 bytes of data instead of 16 bytes. This behaviour is totally absent and not documented in the switch Documentation. In fact from Documentation the max value that mgmt eth can process is 16 byte of data while in reality it can process 32 bytes at once. To handle this we always round up the length after deviding it for word size. We check if the result is odd and we round another time to align to what the switch will provide in the ack packet. The workaround for the length limit of 15 is still needed as the length reg max value is 0xf(15) Reported-by: Ronald Wahl <ronald.wahl@raritan.com> Tested-by: Ronald Wahl <ronald.wahl@raritan.com> Fixes: 90386223f44e ("net: dsa: qca8k: add support for larger read/write size with mgmt Ethernet") Signed-off-by: Christian Marangi <ansuelsmth@gmail.com> Cc: stable@vger.kernel.org # v5.18+ Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'include/linux')
0 files changed, 0 insertions, 0 deletions