Re: [PATCH net-next 5/8] net: mscc: Add initial Ocelot switch support

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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

--
To unsubscribe from this list: send the line "unsubscribe devicetree" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html



[Index of Archives]     [Device Tree Compilter]     [Device Tree Spec]     [Linux Driver Backports]     [Video for Linux]     [Linux USB Devel]     [Linux PCI Devel]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [XFree86]     [Yosemite Backpacking]


  Powered by Linux