]> git.baikalelectronics.ru Git - kernel.git/commit
net: dsa: mv88e6xxx: Fix counting of ATU violations
authorAndrew Lunn <andrew@lunn.ch>
Tue, 5 Feb 2019 23:02:58 +0000 (00:02 +0100)
committerDavid S. Miller <davem@davemloft.net>
Wed, 6 Feb 2019 00:37:52 +0000 (16:37 -0800)
commit3dffaad8f31c62ad3e64c15fdcc0653607d132c3
tree1d1d2945642d71dccad3b7c4b5c1a6e3a3924cfd
parent48bc18642ec7ec6c78ea1989aa2b4f1c61f9c12f
net: dsa: mv88e6xxx: Fix counting of ATU violations

The ATU port vector contains a bit per port of the switch. The code
wrongly used it as a port number, and incremented a port counter. This
resulted in the wrong interfaces counter being incremented, and
potentially going off the end of the array of ports.

Fix this by using the source port ID for the violation, which really
is a port number.

Reported-by: Chris Healy <Chris.Healy@zii.aero>
Tested-by: Chris Healy <Chris.Healy@zii.aero>
Fixes: e991e4f180f8 ("net: dsa: mv88e6xxx: Keep ATU/VTU violation statistics")
Signed-off-by: Andrew Lunn <andrew@lunn.ch>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/dsa/mv88e6xxx/global1_atu.c