Netdev List
 help / color / mirror / Atom feed
From: Vladimir Oltean <vladimir.oltean@nxp.com>
To: Florian Fainelli <f.fainelli@gmail.com>
Cc: Roopa Prabhu <roopa@nvidia.com>, Andrew Lunn <andrew@lunn.ch>,
	"netdev@vger.kernel.org" <netdev@vger.kernel.org>
Subject: Re: [RFC PATCH 0/4] Faster ndo_fdb_dump for drivers with shared FDB
Date: Thu, 23 Sep 2021 22:49:04 +0000	[thread overview]
Message-ID: <20210923224903.mrln22qqfdthzrvm@skbuf> (raw)
In-Reply-To: <187e4376-e7bb-3e12-f746-8cb3d11f0dc4@gmail.com>

On Thu, Sep 23, 2021 at 03:29:07PM -0700, Florian Fainelli wrote:
> > Does something like this have any chance of being accepted?
> > https://patchwork.kernel.org/project/netdevbpf/cover/20210821210018.1314952-1-vladimir.oltean@nxp.com/
> 
> Had not seen the link you just posted, in premise speeding up the FDB
> dump sounds good to me, especially given that we typically have these
> slow buses to work with.

I didn't copy you because you were on vacation.

> These questions are probably super stupid and trivial and I really
> missed reviewing properly your latest work, how do we manage to keep the
> bridge's FDB and hardware FDB in sync given that switches don't
> typically tell us when they learn new addresses?

We don't, that's the premise, you didn't miss anything there. I mean in
the switchdev world, I see that an interrupt is the primary mechanism,
and we do have DSA switches which are theoretically capable of notifying
of new addresses, but not through interrupts but over Ethernet, of
course. Ocelot for example supports sending "learn frames" to the CPU -
these are just like flooded frames, except that a "flooded" frame is one
with unknown MAC DA, and a "learn" frame is one with unknown MAC SA.
I've been thinking whether it's worth adding support for learn frames
coming from Ocelot/Felix in DSA, and it doesn't really look like it.
Anyway, when the DSA tagging protocol receives a "learn" frame, it needs
to consume_skb() it, then trigger some sort of switchdev atomic notifier
for that MAC SA (SWITCHDEV_FDB_ADD_TO_BRIDGE), but sadly that is only
the beginning of a long series of complications, because we also need to
know when the hardware has fogotten it, and it doesn't look like
"forget" frames are a thing. So because the risk of having an address
expire in hardware while it is still present in software is kind of
high, the only option left is to make the hardware entry static, and
(a) delete it manually when the software entry expires
(b) set up a second alert which triggers a MAC SA has been received on a
    port other than the destination port which is pointed towards by an
    existing FDB entry. In short, "station migration alert". Because the
    FDB entry is static, we need to migrate it by hand, in software.
So it all looks kind of clunky. Whereas what we do now is basically
assume that the amount of frames with unknown MAC DA reaching the CPU
via flooding is more or less equal and equally distributed with the
frames with unknown MAC SA reaching the CPU. I have not yet encountered
a use case where the two are tragically different, in a way that could
be solved only with SWITCHDEV_FDB_ADD_TO_BRIDGE events and in no other way.


Anyway, huge digression, the idea was that DSA doesn't synchronize FDBs
and that is the reason in the first place why we have an .ndo_fdb_dump
implementation. Theoretically if all hardware drivers were perfect,
you'd only have the .ndo_fdb_dump implementation done for the bridge,
vxlan, things like that. So that is why I asked Roopa whether hacking up
rtnl_fdb_dump in this way, transforming it into a state machine even
more complicated than it already was, is acceptable. We aren't the
primary use case of it, I think.

  reply	other threads:[~2021-09-23 22:49 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-08-21 21:00 [RFC PATCH 0/4] Faster ndo_fdb_dump for drivers with shared FDB Vladimir Oltean
2021-08-21 21:00 ` [RFC PATCH 1/4] net: rtnetlink: create a netlink cb context struct for fdb dump Vladimir Oltean
2021-08-21 21:00 ` [RFC PATCH 2/4] net: rtnetlink: add a minimal state machine for dumping shared FDBs Vladimir Oltean
2021-08-21 21:00 ` [RFC PATCH 3/4] net: dsa: implement a shared FDB dump procedure Vladimir Oltean
2021-08-21 21:00 ` [RFC PATCH 4/4] net: dsa: sja1105: implement shared FDB dump Vladimir Oltean
2021-09-23 15:25 ` [RFC PATCH 0/4] Faster ndo_fdb_dump for drivers with shared FDB Vladimir Oltean
2021-09-23 22:29   ` Florian Fainelli
2021-09-23 22:49     ` Vladimir Oltean [this message]
2021-09-24 10:03       ` Nikolay Aleksandrov
2021-09-25 14:31         ` Roopa Prabhu

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=20210923224903.mrln22qqfdthzrvm@skbuf \
    --to=vladimir.oltean@nxp.com \
    --cc=andrew@lunn.ch \
    --cc=f.fainelli@gmail.com \
    --cc=netdev@vger.kernel.org \
    --cc=roopa@nvidia.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox