netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Andrew Lunn <andrew@lunn.ch>
To: Horatiu Vultur <horatiu.vultur@microchip.com>
Cc: Nikolay Aleksandrov <nikolay@cumulusnetworks.com>,
	roopa@cumulusnetworks.com, davem@davemloft.net,
	UNGLinuxDriver@microchip.com, alexandre.belloni@bootlin.com,
	allan.nielsen@microchip.com, netdev@vger.kernel.org,
	linux-kernel@vger.kernel.org, bridge@lists.linux-foundation.org
Subject: Re: [PATCH 0/3] Add NETIF_F_HW_BRIDGE feature
Date: Fri, 23 Aug 2019 15:25:38 +0200	[thread overview]
Message-ID: <20190823132538.GO13020@lunn.ch> (raw)
In-Reply-To: <20190823122657.njk2tcgur2zu74i7@soft-dev3.microsemi.net>

> > > Why do the devices have to be from the same driver ?
> After seeing yours and Andrews comments I realize that I try to do two
> things, but I have only explained one of them.
> 
> Here is what I was trying to do:
> A. Prevent ports from going into promisc mode, if it is not needed.

The switch definition is promisc is a bit odd. You really need to
split it into two use cases.

The Linux interface is not a member of a bridge. In this case, promisc
mode would mean all frames ingressing the port should be forwarded to
the CPU. Without promisc, you can program the hardware to just accept
frames with the interfaces MAC address. So this is just the usual
behaviour of an interface.

When the interface is part of the bridge, then you can turn on all the
learning and not forward frames to the CPU, unless the CPU asks for
them. But you need to watch out for various flags. By default, you
should flood to the CPU, unknown destinations to the CPU etc. But some
of these can be turned off by flags.

> B. Prevent adding the CPU to the flood-mask (in Ocelot we have a
> flood-mask controlling who should be included when flooding due to
> destination unknown).

So destination unknown should be flooded to the CPU. The CPU might
know where to send the frame.

> To solve item "B", the network driver needs to detect if there is a
> foreign interfaces added to the bridge. If that is the case then to add
> the CPU port to the flooding mask otherwise no.

It is not just a foreign interface. What about the MAC address on the
bridge interface?

> > > This is too specific targeting some devices.
> Maybe I was wrong to mention specific HW in the commit message. The
> purpose of the patch was to add an optimization (not to copy all the
> frames to the CPU) for HW that is capable of learning and flooding the
> frames.

To some extent, this is also tied to your hardware not learning MAC
addresses from frames passed from the CPU. You should also consider
fixing this. The SW bridge does send out notifications when it
adds/removes MAC addresses to its tables. You probably want to receive
this modifications, and use them to program your hardware to forward
frames to the CPU when needed.

       Andrew

  reply	other threads:[~2019-08-23 13:25 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-08-22 19:07 [PATCH 0/3] Add NETIF_F_HW_BRIDGE feature Horatiu Vultur
2019-08-22 19:07 ` [PATCH 1/3] net: Add HW_BRIDGE offload feature Horatiu Vultur
2019-08-22 20:08   ` Andrew Lunn
2019-08-23 12:39     ` Horatiu Vultur
2019-08-23 23:30       ` Florian Fainelli
2019-08-25 10:44         ` Horatiu Vultur
2019-08-22 19:07 ` [PATCH 2/3] net: mscc: Use NETIF_F_HW_BRIDGE Horatiu Vultur
2019-08-22 19:07 ` [PATCH 3/3] net: mscc: Implement promisc mode Horatiu Vultur
2019-08-22 22:09 ` [PATCH 0/3] Add NETIF_F_HW_BRIDGE feature Nikolay Aleksandrov
2019-08-22 22:26   ` Nikolay Aleksandrov
2019-08-23 12:26     ` Horatiu Vultur
2019-08-23 13:25       ` Andrew Lunn [this message]
2019-08-23 15:57         ` Horatiu Vultur
2019-08-22 22:32 ` David Miller
2019-08-23 23:25 ` Florian Fainelli
2019-08-24  7:42   ` Jiri Pirko
2019-08-25 16:30     ` Horatiu Vultur
2019-08-24 12:05 ` [Bridge] " Stephen Hemminger

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=20190823132538.GO13020@lunn.ch \
    --to=andrew@lunn.ch \
    --cc=UNGLinuxDriver@microchip.com \
    --cc=alexandre.belloni@bootlin.com \
    --cc=allan.nielsen@microchip.com \
    --cc=bridge@lists.linux-foundation.org \
    --cc=davem@davemloft.net \
    --cc=horatiu.vultur@microchip.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=netdev@vger.kernel.org \
    --cc=nikolay@cumulusnetworks.com \
    --cc=roopa@cumulusnetworks.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;
as well as URLs for NNTP newsgroup(s).