All of lore.kernel.org
 help / color / mirror / Atom feed
From: Andrew Lunn <andrew@lunn.ch>
To: Vladimir Oltean <olteanv@gmail.com>
Cc: David Miller <davem@davemloft.net>,
	netdev <netdev@vger.kernel.org>,
	Vivien Didelot <vivien.didelot@gmail.com>,
	Florian Fainelli <f.fainelli@gmail.com>
Subject: Re: [PATCH net-next 0/2] mv88e6xxx: Allow config of ATU hash algorithm
Date: Fri, 4 Oct 2019 15:00:18 +0200	[thread overview]
Message-ID: <20191004130018.GB3817@lunn.ch> (raw)
In-Reply-To: <CA+h21hq8G2fMZenAF_inYxQXePJe41Lk6U8AsJ-7e19YYTp7Wg@mail.gmail.com>

On Fri, Oct 04, 2019 at 11:44:02AM +0300, Vladimir Oltean wrote:
> Hi Andrew,
> 
> On Fri, 4 Oct 2019 at 10:55, Andrew Lunn <andrew@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?

Hi Vladimir

I have a second patchset which gives you an idea of the fill level. It
is documented that there are 4 buckets, and you can get the number of
buckets which are used at each level. The patch will also give the
total number of ATU entries.

The datasheet does not specify how the hashing is performed, just that
there are 4 possible configurations. We founds that the default
configuration does not work too well when all the equipment is from
one vendor, so the OUI is the same. By changing the algorithm we got a
better spread. Maybe it is giving more weight to the lower bits of the
MAC address?

Given the level of undocumented black magic, i don't know if we can do
a more generic configuration.

  Andrew

      reply	other threads:[~2019-10-04 13:00 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-10-04  1:35 [PATCH net-next 0/2] mv88e6xxx: Allow config of ATU hash algorithm Andrew Lunn
2019-10-04  1:35 ` [PATCH net-next 1/2] net: dsa: Add support for devlink device parameters Andrew Lunn
2019-10-04  1:35 ` [PATCH net-next 2/2] net: dsa: mv88e6xxx: Add devlink param for ATU hash algorithm Andrew Lunn
2019-10-04 14:47   ` Vivien Didelot
2019-10-04  2:14 ` [PATCH net-next 0/2] mv88e6xxx: Allow config of " Jakub Kicinski
2019-10-04 12:47   ` Andrew Lunn
2019-10-04  8:44 ` Vladimir Oltean
2019-10-04 13:00   ` Andrew Lunn [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20191004130018.GB3817@lunn.ch \
    --to=andrew@lunn.ch \
    --cc=davem@davemloft.net \
    --cc=f.fainelli@gmail.com \
    --cc=netdev@vger.kernel.org \
    --cc=olteanv@gmail.com \
    --cc=vivien.didelot@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.