]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
net: mscc: ocelot: divide watermark value by 60 when writing to SYS_ATOP
authorVladimir Oltean <vladimir.oltean@nxp.com>
Mon, 5 Oct 2020 09:09:11 +0000 (12:09 +0300)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 14 Oct 2020 09:55:58 +0000 (11:55 +0200)
commit29c60e82c6a5461a789f6696bf4a66ad347f7fd3
tree15a7b6984197073f47f8d4e783f518c696023d58
parent9fd541ad02bd2bb34a1f931068afd5313336d4e4
net: mscc: ocelot: divide watermark value by 60 when writing to SYS_ATOP

[ Upstream commit 601e984f23abcaa7cf3eb078c13de4db3cf6a4f0 ]

Tail dropping is enabled for a port when:

1. A source port consumes more packet buffers than the watermark encoded
   in SYS:PORT:ATOP_CFG.ATOP.

AND

2. Total memory use exceeds the consumption watermark encoded in
   SYS:PAUSE_CFG:ATOP_TOT_CFG.

The unit of these watermarks is a 60 byte memory cell. That unit is
programmed properly into ATOP_TOT_CFG, but not into ATOP. Actually when
written into ATOP, it would get truncated and wrap around.

Fixes: a556c76adc05 ("net: mscc: Add initial Ocelot switch support")
Signed-off-by: Vladimir Oltean <vladimir.oltean@nxp.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/net/ethernet/mscc/ocelot.c