Hi Andrew, On Fri, 4 Oct 2019 at 10:55, Andrew Lunn <and...@lunn.ch> wrote: > > The Marvell switches allow the hash algorithm for MAC addresses in the > address translation unit to be configured. Add support to the DSA core > to allow DSA drivers to make use of devlink parameters, and allow the > ATU hash to be get/set via such a parameter. >
What is the hash algorithm used by mv88e6xxx? In sja1105 it is simply crc32 over the {DMAC, VLAN} key, with a configurable polynomial (stored in Koopman notation, but that is maybe irrelevant). Are you really changing the algorithm, but only the hashing function's seed? If the sja1105 is in any way similar to mv88e6xxx, maybe it would make sense to devise a more generic devlink attribute? Also, I believe the hashing function is only relevant if the ATU's CAM is set- (not fully-) associative. Then it would make sense to maybe let the user know what the total number of FDB entries and buckets is? I am not clear even after looking at the mv88e6xxx_g1_atu_* functions. How would they know they need to change the hash function, and what to change it to? > Andrew Lunn (2): > net: dsa: Add support for devlink device parameters > net: dsa: mv88e6xxx: Add devlink param for ATU hash algorithm. > > drivers/net/dsa/mv88e6xxx/chip.c | 136 +++++++++++++++++++++++- > drivers/net/dsa/mv88e6xxx/chip.h | 4 + > drivers/net/dsa/mv88e6xxx/global1.h | 3 + > drivers/net/dsa/mv88e6xxx/global1_atu.c | 30 ++++++ > include/net/dsa.h | 23 ++++ > net/dsa/dsa.c | 48 +++++++++ > net/dsa/dsa2.c | 7 +- > 7 files changed, 249 insertions(+), 2 deletions(-) > > -- > 2.23.0 > Regards, -Vladimir