* Re: 802.1Q support?
2009-01-12 16:48 802.1Q support? Robin Getz
@ 2009-01-12 20:43 ` Florian Fainelli
2009-01-13 12:31 ` Robin Getz
2009-01-12 20:46 ` Matti Aarnio
2009-01-19 9:14 ` Lennert Buytenhek
2 siblings, 1 reply; 9+ messages in thread
From: Florian Fainelli @ 2009-01-12 20:43 UTC (permalink / raw)
To: Robin Getz; +Cc: netdev
Hi Robin,
Le Monday 12 January 2009 17:48:26 Robin Getz, vous avez écrit :
> I'm trying to understand the "standard" way to control a switch which
> supports VLAN.
>
> Pick any one of:
>
> Infineon XWAY ADM6999 (eight-port 10/100 plus one MII)
> http://www.infineon.com/cms/en/product/channel.html?channel=ff80808112ab681
>d0112ab68ce8d0043
>
> Micrel MS8993M (2 port 10/100 plus one MII)
> http://www.micrel.com/_PDF/Ethernet/ks8993m_pb.pdf
>
> Broadcom BCM5325E (five port 10/100 plus one MII)
> http://www.broadcom.com/collateral/pb/5325E-PB00-R.pdf
>
> Realtek (five port 10/100 plus one MII)
> http://www1.futureelectronics.com/doc/REALTEK%20SEMICONDUCTOR/Realtek%20Sem
>iconductor%20RTL8306SD-GR.pdf
>
> They all have multiple MAC/PHYs which are exposed to the wire, and a single
> MII interface - which normally connects directly to a SOC's MII/MAC.
>
> I would have thought that there would be separate drivers for these in the
> phylib, but I didn't find anything that looked like it would work. (or
> expose the right interface (all the vendor specific VLAN registers) so I
> can program them properly from userspace)...
You can check what we are doing in OpenWrt to be able to change the switch
configuration. There is some work going on to interface switch drivers as PHY
drivers. See :
https://dev.openwrt.org/browser/trunk/target/linux/generic-2.6/patches-2.6.27/650-swconfig.patch
https://dev.openwrt.org/browser/trunk/target/linux/generic-2.6/files/drivers/net/phy/
https://dev.openwrt.org/browser/trunk/package/swconfig
>
> It is possible to hack up the specific EMAC driver to do everything, but
> that doesn't seem like the right way to do it...
Yes, you can also do it that way, though most switches could be reached using
a specific PHY address like how BCM5325 switches are connected to the MAC.
--
Best regards, Florian Fainelli
Email : florian@openwrt.org
http://openwrt.org
-------------------------------
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: 802.1Q support?
2009-01-12 20:43 ` Florian Fainelli
@ 2009-01-13 12:31 ` Robin Getz
2009-01-13 13:29 ` Florian Fainelli
0 siblings, 1 reply; 9+ messages in thread
From: Robin Getz @ 2009-01-13 12:31 UTC (permalink / raw)
To: Florian Fainelli; +Cc: netdev
On Mon 12 Jan 2009 15:43, Florian Fainelli pondered:
> Hi Robin,
>
> Le Monday 12 January 2009 17:48:26 Robin Getz, vous avez écrit :
> > I'm trying to understand the "standard" way to control a switch which
> > supports VLAN.
> >
> > Pick any one of:
> >
> > Infineon XWAY ADM6999 (eight-port 10/100 plus one MII)
> > http://www.infineon.com/cms/en/product/channel.html?channel=ff80808112ab681
> >d0112ab68ce8d0043
> >
> > Micrel MS8993M (2 port 10/100 plus one MII)
> > http://www.micrel.com/_PDF/Ethernet/ks8993m_pb.pdf
> >
> > Broadcom BCM5325E (five port 10/100 plus one MII)
> > http://www.broadcom.com/collateral/pb/5325E-PB00-R.pdf
> >
> > Realtek (five port 10/100 plus one MII)
> > http://www1.futureelectronics.com/doc/REALTEK%20SEMICONDUCTOR/Realtek%20Sem
> >iconductor%20RTL8306SD-GR.pdf
> >
> > They all have multiple MAC/PHYs which are exposed to the wire, and a single
> > MII interface - which normally connects directly to a SOC's MII/MAC.
> >
> > I would have thought that there would be separate drivers for these in the
> > phylib, but I didn't find anything that looked like it would work. (or
> > expose the right interface (all the vendor specific VLAN registers) so I
> > can program them properly from userspace)...
>
> You can check what we are doing in OpenWrt to be able to change the switch
> configuration. There is some work going on to interface switch drivers as PHY
> drivers. See :
>
> https://dev.openwrt.org/browser/trunk/target/linux/generic-2.6/patches-2.6.27/650-swconfig.patch
> https://dev.openwrt.org/browser/trunk/target/linux/generic-2.6/files/drivers/net/phy/
> https://dev.openwrt.org/browser/trunk/package/swconfig
Great - That looks like the way to go -- is there any plan in sending this
to mainline?
It looks like it has been in your tree for ~9 months - so I imagine it
is working pretty well for you?
> > It is possible to hack up the specific EMAC driver to do everything, but
> > that doesn't seem like the right way to do it...
>
> Yes, you can also do it that way, though most switches could be reached using
> a specific PHY address like how BCM5325 switches are connected to the MAC.
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: 802.1Q support?
2009-01-13 12:31 ` Robin Getz
@ 2009-01-13 13:29 ` Florian Fainelli
2009-01-13 16:54 ` Robin Getz
2009-01-19 9:17 ` Lennert Buytenhek
0 siblings, 2 replies; 9+ messages in thread
From: Florian Fainelli @ 2009-01-13 13:29 UTC (permalink / raw)
To: Robin Getz, Felix Fietkau; +Cc: netdev
Le Tuesday 13 January 2009 13:31:20 Robin Getz, vous avez écrit :
> Great - That looks like the way to go -- is there any plan in sending this
> to mainline?
Yes we will definitively submit it for mainline inclusion, Felix, who wrote
the swconfig stuff will probably want to clean it up a bit and/or add
features.
Lennert Buytenhek also proposed a Distributed Switch Architecture which is
worth looking at, though it does not cover more "classical" switches
connection over GPIO, SPI or special PHY address.
>
> It looks like it has been in your tree for ~9 months - so I imagine it
> is working pretty well for you?
Yes, we are shipping this in the Kamikaz 8.09rc1 release, no bug report
related to swconfig have been filed so far ;)
--
Best regards, Florian Fainelli
Email : florian@openwrt.org
http://openwrt.org
-------------------------------
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: 802.1Q support?
2009-01-13 13:29 ` Florian Fainelli
@ 2009-01-13 16:54 ` Robin Getz
2009-01-19 9:07 ` Lennert Buytenhek
2009-01-19 9:17 ` Lennert Buytenhek
1 sibling, 1 reply; 9+ messages in thread
From: Robin Getz @ 2009-01-13 16:54 UTC (permalink / raw)
To: Florian Fainelli; +Cc: netdev
On Tue 13 Jan 2009 08:29, Florian Fainelli pondered:
> Le Tuesday 13 January 2009 13:31:20 Robin Getz, vous avez écrit :
> > Great - That looks like the way to go -- is there any plan in sending this
> > to mainline?
>
> Yes we will definitively submit it for mainline inclusion, Felix, who wrote
> the swconfig stuff will probably want to clean it up a bit and/or add
> features.
>
> Lennert Buytenhek also proposed a Distributed Switch Architecture which is
> worth looking at, though it does not cover more "classical" switches
> connection over GPIO, SPI or special PHY address.
Hmmm ...
https://kerneltrap.org/mailarchive/linux-netdev/2008/9/25/3411164/thread
> The switch driver presents each port on the switch as a separate
> network interface to Linux, polls the switch to maintain software
> link state of those ports, forwards MII management interface
> accesses to those network interfaces (e.g. as done by ethtool) to
> the switch, and exposes the switch's hardware statistics counters
> via the appropriate Linux kernel interfaces.
This exposes eth[n] for every port - and these are managed by the standard
userspace tools?
That seems like it would be more intuitive for end users -- wouldn't it?
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: 802.1Q support?
2009-01-13 16:54 ` Robin Getz
@ 2009-01-19 9:07 ` Lennert Buytenhek
0 siblings, 0 replies; 9+ messages in thread
From: Lennert Buytenhek @ 2009-01-19 9:07 UTC (permalink / raw)
To: Robin Getz; +Cc: Florian Fainelli, netdev
On Tue, Jan 13, 2009 at 11:54:07AM -0500, Robin Getz wrote:
> > > Great - That looks like the way to go -- is there any plan in sending this
> > > to mainline?
> >
> > Yes we will definitively submit it for mainline inclusion, Felix, who wrote
> > the swconfig stuff will probably want to clean it up a bit and/or add
> > features.
> >
> > Lennert Buytenhek also proposed a Distributed Switch Architecture which is
> > worth looking at, though it does not cover more "classical" switches
> > connection over GPIO, SPI or special PHY address.
>
> Hmmm ...
> https://kerneltrap.org/mailarchive/linux-netdev/2008/9/25/3411164/thread
>
> > The switch driver presents each port on the switch as a separate
> > network interface to Linux, polls the switch to maintain software
> > link state of those ports, forwards MII management interface
> > accesses to those network interfaces (e.g. as done by ethtool) to
> > the switch, and exposes the switch's hardware statistics counters
> > via the appropriate Linux kernel interfaces.
>
> This exposes eth[n] for every port - and these are managed by the standard
> userspace tools?
Yep. And the idea is that the HW switch chip will just follow the Linux
networking stack configuration, a la (ugly hack patch, but it shows the
idea):
http://marc.info/?l=linux-netdev&m=123115178119072&w=2
> That seems like it would be more intuitive for end users -- wouldn't it?
Requiring special config tools is backwards, IMHO -- there should be no
difference for the end user between whether there is a hardware offload
present or not.
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: 802.1Q support?
2009-01-13 13:29 ` Florian Fainelli
2009-01-13 16:54 ` Robin Getz
@ 2009-01-19 9:17 ` Lennert Buytenhek
1 sibling, 0 replies; 9+ messages in thread
From: Lennert Buytenhek @ 2009-01-19 9:17 UTC (permalink / raw)
To: Florian Fainelli; +Cc: Robin Getz, Felix Fietkau, netdev
On Tue, Jan 13, 2009 at 02:29:39PM +0100, Florian Fainelli wrote:
> Lennert Buytenhek also proposed a Distributed Switch Architecture which is
> worth looking at, though it does not cover more "classical" switches
> connection over GPIO, SPI or special PHY address.
That's just because there are no drivers for switches that connect over
GPIO or SPI yet. The only thing needed would be an extra field in the
platform data saying which connection method to use, which would be maybe
100 lines of patch at most.
(FWIW, when you use 88e6xxx switches in multi-chip addressing mode, they
do listen to one special PHY address only.)
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: 802.1Q support?
2009-01-12 16:48 802.1Q support? Robin Getz
2009-01-12 20:43 ` Florian Fainelli
@ 2009-01-12 20:46 ` Matti Aarnio
2009-01-19 9:14 ` Lennert Buytenhek
2 siblings, 0 replies; 9+ messages in thread
From: Matti Aarnio @ 2009-01-12 20:46 UTC (permalink / raw)
To: Robin Getz; +Cc: netdev
On Mon, Jan 12, 2009 at 11:48:26AM -0500, Robin Getz wrote:
> I'm trying to understand the "standard" way to control a switch which
> supports VLAN.
"Standard" way would be to telnet to it, and issue IOS commands..
(or any other variant of things.)
> Pick any one of:
>
> Infineon XWAY ADM6999 (eight-port 10/100 plus one MII)
> http://www.infineon.com/cms/en/product/channel.html?channel=ff80808112ab681d0112ab68ce8d0043
>
> Micrel MS8993M (2 port 10/100 plus one MII)
> http://www.micrel.com/_PDF/Ethernet/ks8993m_pb.pdf
>
> Broadcom BCM5325E (five port 10/100 plus one MII)
> http://www.broadcom.com/collateral/pb/5325E-PB00-R.pdf
>
> Realtek (five port 10/100 plus one MII)
> http://www1.futureelectronics.com/doc/REALTEK%20SEMICONDUCTOR/Realtek%20Semiconductor%20RTL8306SD-GR.pdf
>
> They all have multiple MAC/PHYs which are exposed to the wire, and a
> single MII interface - which normally connects directly to a SOC's MII/MAC.
>
> I would have thought that there would be separate drivers for these in the
> phylib, but I didn't find anything that looked like it would work.
> (or expose the right interface (all the vendor specific VLAN registers) so
> I can program them properly from userspace)...
>
> It is possible to hack up the specific EMAC driver to do everything, but
> that doesn't seem like the right way to do it...
In Linux Kernel there is VLAN support - but that happens well inside the
network stack, not at network card drivers.
Doing something similar to what vconfig tool does is definitely an option.
Doing it with vconfig ? Probably not. Layering problem, you see.
> Any pointers appreciated.
> Thanks.
/Matti Aarnio
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: 802.1Q support?
2009-01-12 16:48 802.1Q support? Robin Getz
2009-01-12 20:43 ` Florian Fainelli
2009-01-12 20:46 ` Matti Aarnio
@ 2009-01-19 9:14 ` Lennert Buytenhek
2 siblings, 0 replies; 9+ messages in thread
From: Lennert Buytenhek @ 2009-01-19 9:14 UTC (permalink / raw)
To: Robin Getz; +Cc: netdev
On Mon, Jan 12, 2009 at 11:48:26AM -0500, Robin Getz wrote:
> I'm trying to understand the "standard" way to control a switch which supports
> VLAN.
>
> Pick any one of:
>
> Infineon XWAY ADM6999 (eight-port 10/100 plus one MII)
> http://www.infineon.com/cms/en/product/channel.html?channel=ff80808112ab681d0112ab68ce8d0043
>
> Micrel MS8993M (2 port 10/100 plus one MII)
> http://www.micrel.com/_PDF/Ethernet/ks8993m_pb.pdf
>
> Broadcom BCM5325E (five port 10/100 plus one MII)
> http://www.broadcom.com/collateral/pb/5325E-PB00-R.pdf
>
> Realtek (five port 10/100 plus one MII)
> http://www1.futureelectronics.com/doc/REALTEK%20SEMICONDUCTOR/Realtek%20Semiconductor%20RTL8306SD-GR.pdf
>
> They all have multiple MAC/PHYs which are exposed to the wire, and a single
> MII interface - which normally connects directly to a SOC's MII/MAC.
The DSA subsystem in the mainline kernel (net/dsa) needs three things:
1. A way to initialise and configure the switch chip.
2. A way to tell, for packets received from the switch, which
physical interface this packet came from.
3. A way to tell the switch to transmit packets out a certain
physical interface.
All switch chips currently supported use MDIO accesses for (1), but at
least some of the chips also support configuration by sending the
commands via specially crafted ethernet frames (which would be easy to
add support for), or you can use SPI, or toggle GPIOs, or whatever you
want.
(2) and (3) are typically done by adding a couple of bytes to the
ethernet packet. Marvell switches support at least four different
methods (three of them implemented), Micrel switches have their own
method, Broadcom switches probably have their own method, etc. Note
that you're not limited to conveying this info in the packet payload
-- as long as you provide a packet transmit function and have a way
of delivering received packets to the right hook, you can use any
method you want, including specifying the physical port number in
the packet DMA descriptor, reading/writing the physical port number
to a special register, etc.
> I would have thought that there would be separate drivers for these in the
> phylib, but I didn't find anything that looked like it would work. (or expose
> the right interface (all the vendor specific VLAN registers) so I can program
> them properly from userspace)...
phylib isn't the right place, IMHO, since the switch isn't necessarily
configured via MDIO (or even attached to MDIO).
^ permalink raw reply [flat|nested] 9+ messages in thread