Subject: RSTP with a hardware switch?

From: Stanislav Meduna <[email-masked]>
Date: Mon, 02 Jun 2014 15:25:11 +0200

Hi,

I have a 3-port (1 CPU, 2 external) LAN9303 switch with an ability
to set the port status to learning, forwarding etc, pass BPDUs
to CPU even if not forwarding and similar tasks. Using the vlan
tagging feature it is principially possible to expose the ports
as eth0.1, eth0.2 etc, send packets only to specific ports etc.

This is an embedded device where the main task is not the
networking. It "just" needs to have redundant connections
to the same network, as it will be typically wired in a ring
with other such devices and to a RSTP-capable switch at the
end of the ring.

So I need to run a RSTP with this switch and as the CPU power
is limited, I would like to let the hardware do all the
learning and forwarding and only run the RSTP state machine
in software. Unfortunately the existing implementations
such as http://sourceforge.net/projects/mstpd/ expect to
see the bridge and its ports via the bridging infrastructure.

Is there anything in the kernel to help with this task?
If not, what is the suggested way of implementing this?

My present idea is to patch the network driver to use specific
VLANs for the BPDUs and normal traffic and do everything else
in userspace (basically take the daemon and hack other ways
of setting the port status). This however means duplicating
existing interfaces which seems a bit ugly.

Anyone already doing something like this?

If there is a better place to ask this, please suggest it.
Please Cc: when replying.

Thanks
-- 
                                      Stano