Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revision Previous revision
Next revision
Previous revision
docs:techref:hardware:switch [2020/10/22 08:34] – Mention Linux switchdev lga1150docs:techref:hardware:switch [2024/08/11 20:52] (current) – [Realtek] fix link linus
Line 1: Line 1:
 ====== Ethernet Network Switch ====== ====== Ethernet Network Switch ======
 Many devices supported by OpenWrt contain an Ethernet network switch. Most switches are //configurable// and driver options are available. Typical features include ethernet frame tagging and [[docs:guide-user:network:vlan:switch_configuration|VLAN]] support. We require two software components: Many devices supported by OpenWrt contain an Ethernet network switch. Most switches are //configurable// and driver options are available. Typical features include ethernet frame tagging and [[docs:guide-user:network:vlan:switch_configuration|VLAN]] support. We require two software components:
-  - kind of a driver +  - kind of a driver 
-  - utility+  - utility
  
 ===== DSA Distributed Network Switch ===== ===== DSA Distributed Network Switch =====
  
-The preferred contemporary driver architecture for ethernet switches in the Linux kernel is [[https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/tree/Documentation/networking/dsa/dsa.rst|DSA (distributed switch architecture)]].+The preferred contemporary driver architecture for ethernet switches in the Linux kernel is [[https://www.kernel.org/doc/html/latest/networking/dsa/dsa.html|DSA (distributed switch architecture)]].
  
  
 For a user the main difference to past OpenWrt switch drivers is that all the switch ports that on a consumer router have names such as **LAN1**, **LAN2**, ... or **WAN** also appear as independent network interfaces in userspace and those can be handled like any other network interfaces using the ''[[docs:techref:ip|ip]]'' tool or ''[[docs:techref:ethtool|ethtool]]''. For a user the main difference to past OpenWrt switch drivers is that all the switch ports that on a consumer router have names such as **LAN1**, **LAN2**, ... or **WAN** also appear as independent network interfaces in userspace and those can be handled like any other network interfaces using the ''[[docs:techref:ip|ip]]'' tool or ''[[docs:techref:ethtool|ethtool]]''.
  
-The Linux kernel also has [[https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/tree/Documentation/networking/dsa/configuration.rst|userspace configuration examples]] on how to use the DSA switches in Linux.+The Linux kernel also has [[https://www.kernel.org/doc/html/latest/networking/dsa/configuration.html|userspace configuration examples]] on how to use the DSA switches in Linux.
  
  
Line 23: Line 23:
 Only master targets actually having DSA enabled are listed. Only master targets actually having DSA enabled are listed.
  
-Architecture      ^ Kernel       ^ Notes          ^ +Target      ^ Kernel       ^ Notes          ^ 
-| Gemini            | 5.         | +| bcm53xx           | 5.10? |         | 
-| IMX6              | 5.         | +| Gemini            | 5.10          | 
-| Kirkwood          | 5.         | +| IMX6              | 5.10  |         | 
-| Mediatek/mt7623   | 5.         | +| IPQ40xx           | 5.15          | 
-| Mvebu             | 5.         | +| Kirkwood          | 5.10  |         | 
-| Ramips/mt7621     | 5. | See [[https://github.com/openwrt/openwrt/pull/2942|Github PR #2942]] (merged) for improvements  |+| Lantiq            | 5.10          | 
 +| Mediatek/MT7623   | 5.10          | 
 +| Mvebu             | 5.10  |         | 
 +| Realtek           | 5.10          | 
 +| Ramips/MT7621     | 5.10  | See [[https://github.com/openwrt/openwrt/pull/2942|Github PR #2942]] (merged) for improvements  |
 ===== Switchdev ===== ===== Switchdev =====
  
-**Note**: not to be confused with [[https://www.kernel.org/doc/Documentation/networking/switchdev.txt|Linux switchdev]], which DSA is based on.+**Note**: not to be confused with [[https://www.kernel.org/doc/html/latest/networking/switchdev.html|Linux switchdev]], which DSA is based on.
  
 The previous switch driver model invented by OpenWrt was switchdev and the corresponding configuration utility was ''[[docs:techref:swconfig|swconfig]]''. This is used in legacy patches and userspace, but is not recommended when implementing switch drivers for new devices. Please write new code using DSA and help out to convert old drivers to DSA if you can. The previous switch driver model invented by OpenWrt was switchdev and the corresponding configuration utility was ''[[docs:techref:swconfig|swconfig]]''. This is used in legacy patches and userspace, but is not recommended when implementing switch drivers for new devices. Please write new code using DSA and help out to convert old drivers to DSA if you can.
Line 41: Line 45:
   * [[http://realtek.info/pdf/rtl8366_8369_datasheet_1-1.pdf|RTL8366/RTL8369 datasheet]], notice that this is quite different from RTL8366RB or RTL8369S   * [[http://realtek.info/pdf/rtl8366_8369_datasheet_1-1.pdf|RTL8366/RTL8369 datasheet]], notice that this is quite different from RTL8366RB or RTL8369S
   * [[https://web.archive.org/web/20100729202805/http://www.realtek.com.tw/products/productsView.aspx?Langid=1&PNid=18&PFid=15&Level=5&Conn=4&ProdID=197|RealTek RTL8366RB]], a 5-port Gigabit switch e.g. in the [[toh/tp-link/tl-wr1043nd|WR1043ND v1]] or [[toh/d-link/DIR-685]]   * [[https://web.archive.org/web/20100729202805/http://www.realtek.com.tw/products/productsView.aspx?Langid=1&PNid=18&PFid=15&Level=5&Conn=4&ProdID=197|RealTek RTL8366RB]], a 5-port Gigabit switch e.g. in the [[toh/tp-link/tl-wr1043nd|WR1043ND v1]] or [[toh/d-link/DIR-685]]
-    * [[https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/tree/drivers/net/dsa/rtl8366rb.c|Upstream RTL8366RB DSA kernel driver]] this should become the default after incorporating kernel v4.19 or later+    * [[https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/tree/drivers/net/dsa/realtek/rtl8366rb.c|Upstream RTL8366RB DSA kernel driver]] this should become the default after incorporating kernel v4.19 or later
     * see [[https://dev.openwrt.org/search?q=+8366RB&noquickjump=1&ticket=on|all tickets concerning the Realtek RTL8366RB]]     * see [[https://dev.openwrt.org/search?q=+8366RB&noquickjump=1&ticket=on|all tickets concerning the Realtek RTL8366RB]]
       * e.g. [[https://dev.openwrt.org/ticket/7977|Ticket 7977:Enhance rtl8366rb driver]]       * e.g. [[https://dev.openwrt.org/ticket/7977|Ticket 7977:Enhance rtl8366rb driver]]
Line 53: Line 57:
 ==== Qualcomm / Atheros ==== ==== Qualcomm / Atheros ====
   * AR8216 FastEthernet, 6 ports; found in [[toh/astoria/arv752dpw22 |Arcadyan ARV752DPW22]], [[toh/netgear/wnr2000 |Netgear WNR2000v1]], others   * AR8216 FastEthernet, 6 ports; found in [[toh/astoria/arv752dpw22 |Arcadyan ARV752DPW22]], [[toh/netgear/wnr2000 |Netgear WNR2000v1]], others
-  * AR8316 GigabitEthernet, e.g. in the [[toh/ubiquiti/routerstation.pro|RouterStation Pro]], [[toh/buffalo/WBMR-HP-G300H]], ...+  * AR8316 GigabitEthernet, e.g. in the [[toh:ubiquiti:routerstation_pro|RouterStation Pro]], [[toh/buffalo/WBMR-HP-G300H]], ...
   * [[http://www.qca.qualcomm.com/technology/technology.php?nav1=48&product=99|AR8228 + AR8229]] FastEthernet: 7-Ports, 5x 100BASE-TX-PHYs   * [[http://www.qca.qualcomm.com/technology/technology.php?nav1=48&product=99|AR8228 + AR8229]] FastEthernet: 7-Ports, 5x 100BASE-TX-PHYs
   * [[http://www.qca.qualcomm.com/technology/technology.php?nav1=48&product=100|AR8236]] FastEthernet: 6-Ports,  5 x 100BASE-TX-PHYs   * [[http://www.qca.qualcomm.com/technology/technology.php?nav1=48&product=100|AR8236]] FastEthernet: 6-Ports,  5 x 100BASE-TX-PHYs
Line 72: Line 76:
     * [[https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/tree/drivers/net/phy/mscc.c|Upstream PHY driver for VSC8584 and VSC8574]]     * [[https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/tree/drivers/net/phy/mscc.c|Upstream PHY driver for VSC8584 and VSC8574]]
   * Vitesse have produced switch chips for 5+1 and 8+1 switches VSC7385, VSC7388, VSC7395 and VSC7398.   * Vitesse have produced switch chips for 5+1 and 8+1 switches VSC7385, VSC7388, VSC7395 and VSC7398.
-    * [[https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/tree/drivers/net/dsa/vitesse-vsc73xx.c|Upstream DSA kernel driver for VSC7385, VSC7388, VSC7395 and VSC7398]]+    * [[https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/tree/drivers/net/dsa/vitesse-vsc73xx-core.c|Upstream DSA kernel driver for VSC7385, VSC7388, VSC7395 and VSC7398]]
   * The Vitesse switch chips family were acquired by Micosemi who were then acquired by Microchip.   * The Vitesse switch chips family were acquired by Micosemi who were then acquired by Microchip.
   * Micochip will provide complete datasheets if you sign an NDA on their website   * Micochip will provide complete datasheets if you sign an NDA on their website
Line 84: Line 88:
  
 ==== Features ==== ==== Features ====
-  * some Switches contain a functionality called **//"Hardware NAT"//**; support for this features has not yet been included into OpenWrt. Since the [[docs:techref:hardware:cpu]]s used in CPE Routers are relatively slow, expect 2 to 4 times performance gain if you were to use Hardware NAT, e.g. without hardware NAT some router could achieve 400Mbit/s at full CPU load, with hardware NAT it could achieve 900Mbit/s at full CPU load. OpenWrt developer is supposed to have said, that implementing HW-NAT support would be unacceptably hacky to accomplish.+  * Some switches contain a functionality called **//"Hardware NAT"//**; support for this features has not yet been included into OpenWrt. Since the [[docs:techref:hardware:cpu]]s used in CPE Routers are relatively slow, expect 2 to 4 times performance gain if you were to use Hardware NAT, e.g. without hardware NAT some router could achieve 400Mbit/s at full CPU load, with hardware NAT it could achieve 900Mbit/s at full CPU load. OpenWrt developer is supposed to have said, that implementing HW-NAT support would be unacceptably hacky to accomplish.
  • Last modified: 2020/10/22 08:34
  • by lga1150