Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit cbc24658 authored by David S. Miller's avatar David S. Miller
Browse files

Merge branch 'rocker-next'

Jiri Pirko says:

====================
introduce rocker switch driver with hardware accelerated datapath api - phase 1: bridge fdb offload

This patchset is just the first phase of switch and switch-ish device
support api in kernel. Note that the api will extend.

So what this patchset includes:
- introduce switchdev api skeleton for implementing switch drivers
- introduce rocker switch driver which implements switchdev api fdb and
  bridge set/get link ndos

As to the discussion if there is need to have specific class of device
representing the switch itself, so far we found no need to introduce that.
But we are generally ok with the idea and when the time comes and it will
be needed, it can be easily introduced without any disturbance.

This patchset introduces switch id export through rtnetlink and sysfs,
which is similar to what we have for port id in SR-IOV. I will send iproute2
patchset for showing the switch id for port netdevs once this is applied.
This applies also for the PF_BRIDGE and fdb iproute2 patches.

iproute2 patches are now available here:
https://github.com/jpirko/iproute2-rocker

For detailed description and version history, please see individual patches.

In v4 I reordered the patches leaving rocker patches on the end of the patchset.

In v5 I only fixed whitespace issues of patch #13

We have a TODO for related items we want to work on in near future:
https://etherpad.wikimedia.org/p/netdev-swdev-todo


====================

Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parents cd4c910e 51ace887
Loading
Loading
Loading
Loading
+8 −0
Original line number Original line Diff line number Diff line
@@ -216,3 +216,11 @@ Contact: netdev@vger.kernel.org
Description:
Description:
		Indicates the interface protocol type as a decimal value. See
		Indicates the interface protocol type as a decimal value. See
		include/uapi/linux/if_arp.h for all possible values.
		include/uapi/linux/if_arp.h for all possible values.

What:		/sys/class/net/<iface>/phys_switch_id
Date:		November 2014
KernelVersion:	3.19
Contact:	netdev@vger.kernel.org
Description:
		Indicates the unique physical switch identifier of a switch this
		port belongs to, as a string.
+59 −0
Original line number Original line Diff line number Diff line
Switch (and switch-ish) device drivers HOWTO
===========================

Please note that the word "switch" is here used in very generic meaning.
This include devices supporting L2/L3 but also various flow offloading chips,
including switches embedded into SR-IOV NICs.

Lets describe a topology a bit. Imagine the following example:

       +----------------------------+    +---------------+
       |     SOME switch chip       |    |      CPU      |
       +----------------------------+    +---------------+
       port1 port2 port3 port4 MNGMNT    |     PCI-E     |
         |     |     |     |     |       +---------------+
        PHY   PHY    |     |     |         |  NIC0 NIC1
                     |     |     |         |   |    |
                     |     |     +- PCI-E -+   |    |
                     |     +------- MII -------+    |
                     +------------- MII ------------+

In this example, there are two independent lines between the switch silicon
and CPU. NIC0 and NIC1 drivers are not aware of a switch presence. They are
separate from the switch driver. SOME switch chip is by managed by a driver
via PCI-E device MNGMNT. Note that MNGMNT device, NIC0 and NIC1 may be
connected to some other type of bus.

Now, for the previous example show the representation in kernel:

       +----------------------------+    +---------------+
       |     SOME switch chip       |    |      CPU      |
       +----------------------------+    +---------------+
       sw0p0 sw0p1 sw0p2 sw0p3 MNGMNT    |     PCI-E     |
         |     |     |     |     |       +---------------+
        PHY   PHY    |     |     |         |  eth0 eth1
                     |     |     |         |   |    |
                     |     |     +- PCI-E -+   |    |
                     |     +------- MII -------+    |
                     +------------- MII ------------+

Lets call the example switch driver for SOME switch chip "SOMEswitch". This
driver takes care of PCI-E device MNGMNT. There is a netdevice instance sw0pX
created for each port of a switch. These netdevices are instances
of "SOMEswitch" driver. sw0pX netdevices serve as a "representation"
of the switch chip. eth0 and eth1 are instances of some other existing driver.

The only difference of the switch-port netdevice from the ordinary netdevice
is that is implements couple more NDOs:

  ndo_switch_parent_id_get - This returns the same ID for two port netdevices
			     of the same physical switch chip. This is
			     mandatory to be implemented by all switch drivers
			     and serves the caller for recognition of a port
			     netdevice.
  ndo_switch_parent_* - Functions that serve for a manipulation of the switch
			chip itself (it can be though of as a "parent" of the
			port, therefore the name). They are not port-specific.
			Caller might use arbitrary port netdevice of the same
			switch and it will make no difference.
  ndo_switch_port_* - Functions that serve for a port-specific manipulation.
+14 −0
Original line number Original line Diff line number Diff line
@@ -7865,6 +7865,13 @@ F: drivers/hid/hid-roccat*
F:	include/linux/hid-roccat*
F:	include/linux/hid-roccat*
F:	Documentation/ABI/*/sysfs-driver-hid-roccat*
F:	Documentation/ABI/*/sysfs-driver-hid-roccat*


ROCKER DRIVER
M:	Jiri Pirko <jiri@resnulli.us>
M:	Scott Feldman <sfeldma@gmail.com>
L:	netdev@vger.kernel.org
S:	Supported
F:	drivers/net/ethernet/rocker/

ROCKETPORT DRIVER
ROCKETPORT DRIVER
P:	Comtrol Corp.
P:	Comtrol Corp.
W:	http://www.comtrol.com
W:	http://www.comtrol.com
@@ -9059,6 +9066,13 @@ F: lib/swiotlb.c
F:	arch/*/kernel/pci-swiotlb.c
F:	arch/*/kernel/pci-swiotlb.c
F:	include/linux/swiotlb.h
F:	include/linux/swiotlb.h


SWITCHDEV
M:	Jiri Pirko <jiri@resnulli.us>
L:	netdev@vger.kernel.org
S:	Supported
F:	net/switchdev/
F:	include/net/switchdev.h

SYNOPSYS ARC ARCHITECTURE
SYNOPSYS ARC ARCHITECTURE
M:	Vineet Gupta <vgupta@synopsys.com>
M:	Vineet Gupta <vgupta@synopsys.com>
S:	Supported
S:	Supported
+1 −0
Original line number Original line Diff line number Diff line
@@ -155,6 +155,7 @@ source "drivers/net/ethernet/qualcomm/Kconfig"
source "drivers/net/ethernet/realtek/Kconfig"
source "drivers/net/ethernet/realtek/Kconfig"
source "drivers/net/ethernet/renesas/Kconfig"
source "drivers/net/ethernet/renesas/Kconfig"
source "drivers/net/ethernet/rdc/Kconfig"
source "drivers/net/ethernet/rdc/Kconfig"
source "drivers/net/ethernet/rocker/Kconfig"


config S6GMAC
config S6GMAC
	tristate "S6105 GMAC ethernet support"
	tristate "S6105 GMAC ethernet support"
+1 −0
Original line number Original line Diff line number Diff line
@@ -65,6 +65,7 @@ obj-$(CONFIG_NET_VENDOR_QUALCOMM) += qualcomm/
obj-$(CONFIG_NET_VENDOR_REALTEK) += realtek/
obj-$(CONFIG_NET_VENDOR_REALTEK) += realtek/
obj-$(CONFIG_SH_ETH) += renesas/
obj-$(CONFIG_SH_ETH) += renesas/
obj-$(CONFIG_NET_VENDOR_RDC) += rdc/
obj-$(CONFIG_NET_VENDOR_RDC) += rdc/
obj-$(CONFIG_NET_VENDOR_ROCKER) += rocker/
obj-$(CONFIG_S6GMAC) += s6gmac.o
obj-$(CONFIG_S6GMAC) += s6gmac.o
obj-$(CONFIG_NET_VENDOR_SAMSUNG) += samsung/
obj-$(CONFIG_NET_VENDOR_SAMSUNG) += samsung/
obj-$(CONFIG_NET_VENDOR_SEEQ) += seeq/
obj-$(CONFIG_NET_VENDOR_SEEQ) += seeq/
Loading