]> git.baikalelectronics.ru Git - kernel.git/commit
dsa: mv88e6xxx: Optimise atu_get
authorAndrew Lunn <andrew@lunn.ch>
Wed, 4 Jan 2017 18:56:24 +0000 (19:56 +0100)
committerDavid S. Miller <davem@davemloft.net>
Wed, 4 Jan 2017 21:34:34 +0000 (16:34 -0500)
commit0bfd9f551b3c3959d325729633894afc2482c52e
tree08199c61b7afd56297b5ad1258327561023e205c
parent518fd6d0080e6728159ac07fb5e3ba049a620980
dsa: mv88e6xxx: Optimise atu_get

Lookup in the ATU can be performed starting from a given MAC
address. This is faster than starting with the first possible MAC
address and iterating all entries.

Entries are returned in numeric order. So if the MAC address returned
is bigger than what we are searching for, we know it is not in the
ATU.

Using the benchmark provided by Volodymyr Bendiuga
<volodymyr.bendiuga@gmail.com>,

https://www.spinics.net/lists/netdev/msg411550.html

on an Marvell Armada 370 RD, the test to add a number of static fdb
entries went from 1.616531 seconds to 0.312052 seconds.

Signed-off-by: Andrew Lunn <andrew@lunn.ch>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/dsa/mv88e6xxx/chip.c
include/linux/etherdevice.h