lkml.org 
[lkml]   [2018]   [Mar]   [23]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH net-next 5/8] net: mscc: Add initial Ocelot switch support
Hi Alexandre

> +static int ocelot_port_bridge_join(struct ocelot_port *ocelot_port,
> + struct net_device *bridge)
> +{
> + struct ocelot *ocelot = ocelot_port->ocelot;
> +
> + if (!ocelot->bridge_mask) {
> + ocelot->hw_bridge_dev = bridge;
> + } else {
> + if (ocelot->hw_bridge_dev != bridge)
> + return -ENODEV; //TODO: do something clever here
> + }
> +
> + ocelot->bridge_mask |= BIT(ocelot_port->chip_port);
> +
> + return 0;
> +}

I could be missing something here, but this looks way too simple.

By default, you have individual ports. They can just forward frames
between the host CPU and the port. There is no port-to-port traffic
allowed.

You then create a bridge, and add ports to the bridge. When you add a
port, you need to program the hardware that it can now forward frames
from this port to other parts in the same bridge. You also need to
tell other parts in the same bridge it can forward frames to it. You
might also need to tell the port which forwarding database it should
use, since each bridge might have its own.

Andrew

\
 
 \ /
  Last update: 2018-03-23 22:26    [W:0.134 / U:0.400 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site