[VLAN] Using a switch fabric to emulate multiple NICs

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

 



Hi list,

I need the vlan code to do something rather unusual, and I think I know how to do it but I thought
I'd check it with you first to see if it is sane....

We've designed a PowerPC based embedded board whose integrated MII bus is attached to a switch
fabric containing 10 other ports.  What we want is for this to be made to look like 10 seperate
NICs, namely eth0, eth1, ..., eth9.

My idea is to configure the switch fabric to tag each frame entering the PHY from the outside world
with a VID which identifies the port on which it entered.  In the other direction frames from
the CPU would have their tags removed by the switch fabric and used to determine to which
port they should be sent. This way all I need to do is to use the vlan module to create 10
net_devices over the top of the original net_device.

This leaves two remaining problems:

	i) How do I make the vlan devices look like eth0 ... eth9

	ii) How do I enable mii-tool ethN to configure portN of the switch fabric.

Here are my ideas... please let me know what you think of them:

i)  I need to add a new VLAN_NAME_TYPE, say VLAN_NAME_TYPE_NEXT_ETH_N.  This will require changing
vlan.c, vlanproc.c, and vconfig.c.  If this is selected then vlan_name_type will be rewritten to
"eth%d".  I also need to ensure my original device is called something other than eth0, say raw0.

ii) I need to add an ioctl handler to vlan.c and set newdev->do_ioctl.  This handler needs
to pass all ioctls on to realdev->do_ioctl() EXCEPT for SIOCGMIIPHY and SIOCDEVPRIVATE.  These
latter ioctls ask the driver what the PHYs MDIO address is.  The original driver cannot know this
since the device to which it is connected contains several PHYs and responds to several MDIO phy
addresses.

Therefore I think this needs to be specified when the vlan device is created with an optional extra
parameter, e.g.

	vconfig add <interface-name> <vlan_id> [<phy_addr>]

When mii-tool is run it will first ask the vlan module what the phy address is.  The vlan module
will then respond with the phy address specified on the vconfig command line.  Then mii-tool will
ask the vlan module to read or write some data using the phy_address it just obtained.  The vlan
module will then just relay this command to realdev->do_ioctl() which controls the MDIO hardware.

Any comments would be much appreciated.

Regards,

Alex

[Index of Archives]     [Netdev]     [Ethernet Bridging]     [Linux Wireless]     [Kernel Newbies]     [Security]     [Linux for Hams]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux RAID]     [Linux Admin]     [Samba]     [Video 4 Linux]

  Powered by Linux