]> git.baikalelectronics.ru Git - kernel.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)
committerDavid S. Miller <davem@davemloft.net>
Tue, 6 Oct 2020 13:05:47 +0000 (06:05 -0700)
commitee5aaa90f8549cb1b7b3592254e996ac485e2f6b
treec4e25edfb21365054bc2c37c6a674c19b1339068
parentb9d9d4821a31ce07d2a60d8d2e541bf2536cb136
net: mscc: ocelot: divide watermark value by 60 when writing to SYS_ATOP

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: 99c1e05296dd ("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>
drivers/net/ethernet/mscc/ocelot.c