-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
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: David S. Miller <davem@davemloft.net>
- Loading branch information
Showing
35 changed files
with
5,366 additions
and
105 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,59 @@ | ||
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. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
# | ||
# Rocker device configuration | ||
# | ||
|
||
config NET_VENDOR_ROCKER | ||
bool "Rocker devices" | ||
default y | ||
---help--- | ||
If you have a network device belonging to this class, say Y. | ||
|
||
Note that the answer to this question doesn't directly affect the | ||
kernel: saying N will just cause the configurator to skip all | ||
the questions about Rocker devices. If you say Y, you will be asked for | ||
your specific card in the following questions. | ||
|
||
if NET_VENDOR_ROCKER | ||
|
||
config ROCKER | ||
tristate "Rocker switch driver (EXPERIMENTAL)" | ||
depends on PCI && NET_SWITCHDEV | ||
---help--- | ||
This driver supports Rocker switch device. | ||
|
||
To compile this driver as a module, choose M here: the | ||
module will be called rocker. | ||
|
||
endif # NET_VENDOR_ROCKER |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
# | ||
# Makefile for the Rocker network device drivers. | ||
# | ||
|
||
obj-$(CONFIG_ROCKER) += rocker.o |
Oops, something went wrong.