From: Andrew Lunn <andrew@lunn.ch>
To: Horatiu Vultur <horatiu.vultur@microchip.com>
Cc: linux-kernel@vger.kernel.org, netdev@vger.kernel.org,
bridge@lists.linux-foundation.org, jiri@resnulli.us,
ivecera@redhat.com, davem@davemloft.net,
roopa@cumulusnetworks.com, nikolay@cumulusnetworks.com,
anirudh.venkataramanan@intel.com, olteanv@gmail.com,
jeffrey.t.kirsher@intel.com, UNGLinuxDriver@microchip.com
Subject: Re: [RFC net-next v3 09/10] net: bridge: mrp: Integrate MRP into the bridge
Date: Sun, 26 Jan 2020 18:12:51 +0100 [thread overview]
Message-ID: <20200126171251.GK18311@lunn.ch> (raw)
In-Reply-To: <20200126130111.o75gskwe2fmfd4g5@soft-dev3.microsemi.net>
On Sun, Jan 26, 2020 at 02:01:11PM +0100, Horatiu Vultur wrote:
> The 01/25/2020 17:16, Andrew Lunn wrote:
> > EXTERNAL EMAIL: Do not click links or open attachments unless you know the content is safe
> >
> > > br_netif_receive_skb(struct net *net, struct sock *sk, struct sk_buff *skb)
> > > @@ -338,6 +341,17 @@ rx_handler_result_t br_handle_frame(struct sk_buff **pskb)
> > > return RX_HANDLER_CONSUMED;
> > > }
> > > }
> > > +#ifdef CONFIG_BRIDGE_MRP
> > > + /* If there is no MRP instance do normal forwarding */
> > > + if (!p->mrp_aware)
> > > + goto forward;
> > > +
> > > + if (skb->protocol == htons(ETH_P_MRP))
> > > + return RX_HANDLER_PASS;
> >
> > What MAC address is used for these MRP frames? It would make sense to
> > use a L2 link local destination address, since i assume they are not
> > supposed to be forwarded by the bridge. If so, you could extend the
> > if (unlikely(is_link_local_ether_addr(dest))) condition.
>
> The MAC addresses used by MRP frames are:
> 0x1, 0x15, 0x4e, 0x0, 0x0, 0x1 - used by MRP_Test frames
> 0x1, 0x15, 0x4e, 0x0, 0x0, 0x2 - used by the rest of MRP frames.
>
> If we will add support also for MIM/MIC. These requires 2 more MAC
> addresses:
> 0x1, 0x15, 0x4e, 0x0, 0x0, 0x3 - used by MRP_InTest frames.
> 0x1, 0x15, 0x4e, 0x0, 0x0, 0x4 - used by the other MRP interconnect
> frames.
Hi Horatiu
I made the wrong guess about how this protocol worked when i said L2
link local. These MAC addresses are L2 multicast.
And you are using a raw socket to receive them into userspace when
needed.
'Thinking allowed' here.
+------------------------------------------+
| |
+-->|H1|<---------->|H2|<---------->|H3|<--+
eth0 eth1 eth0 eth1 eth0 eth1
^
|
Blocked
There are three major classes of user case here:
1) Pure software solution
You need the software bridge in the client to forward these frames
from the left side to the right side. (Does the standard give these
two ports names)? In the master, the left port is blocked, so the
bridge drops them anyway. You have a RAW socket open on both eth0 and
eth1, so you get to see the frames, even if the bridge drops them.
2) Hardware offload to an MRP unaware switch.
I'm thinking about a plain switch supported by DSA, Marvell, Broadcom,
etc. It has no special knowledge of MRP.
Ideally, you want the switch to forward MRP_Test frames left to right
for a client. In a master, i think you have a problem, since the port
is blocked. The hardware is unlikely to recognise these frames as
special, since they are not in the 01-80-C2-XX-XX-XX block, and let
them through. So your raw socket is never going to see them, and you
cannot detect open/closed ring.
I don't know how realistic it is to support MRP in this case, and i
also don't think you can fall back to a pure software solution,
because the software bridge is going to offload the basic bridge
operation to the hardware. It would be nice if you could detect this,
and return -EOPNOTSUPP.
3) Hardware offload to an MRP aware switch.
For a client, you tell it which port is left, which is right, and
assume it forwards the frames. For a master, you again tell it which
is left, which is right, and ask it send MRP_Test frames out right,
and report changes in open/closed on the right port. You don't need
the CPU to see the MRP_Test frames, so the switch has no need to
forward them to the CPU.
We should think about the general case of a bridge with many ports,
and many pairs of ports using MRP. This makes the forwarding of these
frames interesting. Given that they are multicast, the default action
of the software bridge is that it will flood them. Does the protocol
handle seeing MRP_Test from some other loop? Do we need to avoid this?
You could avoid this by adding MDB entries to the bridge. However,
this does not scale to more then one ring. I don't think an MDB is
associated to an ingress port. So you cannot say
0x1, 0x15, 0x4e, 0x0, 0x0, 0x1 ingress port1 egress port2
0x1, 0x15, 0x4e, 0x0, 0x0, 0x1 ingress port3 egress port4
The best you can say is
0x1, 0x15, 0x4e, 0x0, 0x0, 0x1 egress port2, port4
I'm sure there are other issues i'm missing, but it is interesting to
think about all this.
Andrew
next prev parent reply other threads:[~2020-01-26 17:13 UTC|newest]
Thread overview: 56+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-01-24 16:18 [RFC net-next v3 00/10] net: bridge: mrp: Add support for Media Redundancy Protocol (MRP) Horatiu Vultur
2020-01-24 16:18 ` [RFC net-next v3 01/10] net: bridge: mrp: Expose mrp attributes Horatiu Vultur
2020-01-24 16:18 ` [RFC net-next v3 02/10] net: bridge: mrp: Expose function br_mrp_port_open Horatiu Vultur
2020-01-24 17:37 ` Andrew Lunn
2020-01-25 11:29 ` Horatiu Vultur
2020-01-24 16:18 ` [RFC net-next v3 03/10] net: bridge: mrp: Add MRP interface used by netlink Horatiu Vultur
2020-01-24 17:43 ` Andrew Lunn
2020-01-25 11:37 ` Horatiu Vultur
2020-01-25 15:20 ` Andrew Lunn
2020-01-25 19:16 ` Allan W. Nielsen
2020-01-26 13:28 ` Horatiu Vultur
2020-01-26 15:39 ` Andrew Lunn
2020-02-20 9:08 ` Nikolay Aleksandrov
2020-02-20 13:00 ` Allan W. Nielsen
2020-01-24 16:18 ` [RFC net-next v3 04/10] net: bridge: mrp: Add generic netlink interface to configure MRP Horatiu Vultur
2020-01-25 15:34 ` Andrew Lunn
2020-01-25 19:28 ` Allan W. Nielsen
2020-01-26 13:39 ` Horatiu Vultur
2020-01-24 16:18 ` [RFC net-next v3 05/10] net: bridge: mrp: Update MRP interface to add switchdev support Horatiu Vultur
2020-01-24 16:18 ` [RFC net-next v3 06/10] net: bridge: mrp: switchdev: Extend switchdev API to offload MRP Horatiu Vultur
2020-01-25 16:35 ` Andrew Lunn
2020-01-26 13:22 ` Horatiu Vultur
2020-01-26 15:59 ` Andrew Lunn
2020-01-27 11:04 ` Allan W. Nielsen
2020-01-27 14:41 ` Jürgen Lambrecht
[not found] ` <c5733ddb-a837-b866-54bf-c631baf36c54@televic.com>
2020-01-27 15:06 ` Andrew Lunn
2020-01-28 9:50 ` Jürgen Lambrecht
2020-01-27 11:29 ` Jürgen Lambrecht
2020-01-27 12:27 ` Allan W. Nielsen
2020-01-27 14:39 ` Jürgen Lambrecht
2020-01-28 9:58 ` Allan W. Nielsen
2020-01-24 16:18 ` [RFC net-next v3 07/10] net: bridge: mrp: switchdev: Implement MRP API for switchdev Horatiu Vultur
2020-01-24 16:18 ` [RFC net-next v3 08/10] net: bridge: mrp: Connect MRP api with the switchev API Horatiu Vultur
2020-01-24 16:18 ` [RFC net-next v3 09/10] net: bridge: mrp: Integrate MRP into the bridge Horatiu Vultur
2020-01-25 15:42 ` Andrew Lunn
2020-01-26 12:49 ` Horatiu Vultur
2020-01-25 16:16 ` Andrew Lunn
2020-01-26 13:01 ` Horatiu Vultur
2020-01-26 17:12 ` Andrew Lunn [this message]
2020-01-27 10:57 ` Allan W. Nielsen
2020-01-27 13:02 ` Horatiu Vultur
2020-01-27 13:40 ` Andrew Lunn
2020-01-28 9:56 ` Jürgen Lambrecht
2020-01-28 10:17 ` Allan W. Nielsen
2020-01-24 16:18 ` [RFC net-next v3 10/10] net: bridge: mrp: Update Kconfig and Makefile Horatiu Vultur
2020-01-24 20:34 ` [RFC net-next v3 00/10] net: bridge: mrp: Add support for Media Redundancy Protocol (MRP) Allan W. Nielsen
2020-01-24 21:05 ` Vinicius Costa Gomes
2020-01-25 9:44 ` Allan W. Nielsen
2020-01-25 16:23 ` Andrew Lunn
2020-01-25 19:12 ` Allan W. Nielsen
2020-01-25 21:18 ` Vinicius Costa Gomes
2020-01-28 10:35 ` Jürgen Lambrecht
2020-02-18 12:18 ` Allan W. Nielsen
2020-02-18 16:55 ` Jakub Kicinski
2020-02-20 10:48 ` Nikolay Aleksandrov
2020-02-20 12:58 ` Allan W. Nielsen
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=20200126171251.GK18311@lunn.ch \
--to=andrew@lunn.ch \
--cc=UNGLinuxDriver@microchip.com \
--cc=anirudh.venkataramanan@intel.com \
--cc=bridge@lists.linux-foundation.org \
--cc=davem@davemloft.net \
--cc=horatiu.vultur@microchip.com \
--cc=ivecera@redhat.com \
--cc=jeffrey.t.kirsher@intel.com \
--cc=jiri@resnulli.us \
--cc=linux-kernel@vger.kernel.org \
--cc=netdev@vger.kernel.org \
--cc=nikolay@cumulusnetworks.com \
--cc=olteanv@gmail.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).