]> 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)
commitc1ad42037d3fcef609e79d0d2422b7b0645d2bb8
treec4e25edfb21365054bc2c37c6a674c19b1339068
parentdbbbb84d186a04f7222ad5b44953e10859866fa1
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: 1bed22a67906 ("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