Re: [RFC net-next v3 09/10] net: bridge: mrp: Integrate MRP into the bridge

From: Horatiu Vultur
Date: Sun Jan 26 2020 - 08:01:55 EST


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.

Then maybe I shoukd change the check to be something like:
if (unlikely(skb->protocol == htons(ETH_P_MRP)))

>
> > +
> > + if (p->state == BR_STATE_BLOCKING)
> > + goto drop;
> > +#endif
>
> Is this needed? The next block of code is a switch statement on
> p->state. The default case, which BR_STATE_BLOCKING should hit, is
> drop.

Yes you are rigth, it is not needed anymore.

>
> This function is on the hot path. So we should try to optimize it as
> much as possible.
>
> Andrew

--
/Horatiu