netdevsim port add, delete support
Get series with b4
b4 am [email protected]Versions newest first · linked by author and title
- v2 Latest7 patches 2 repliesIn review
- v17 patches 2 repliesSuperseded
Patches in v2 No applies recorded yet
| # | Subject and files | Size | Replies | Applied |
|---|---|---|---|---|
| 1/7 | netdevsim: Add support for add and delete of a PCI PF portdrivers/ drivers/ drivers/ +1 more | +371 | 0 replies | |
| 2/7 | netdevsim: Add support for add and delete PCI SF portdrivers/ drivers/ | +97 | 0 replies | |
| 3/7 | netdevsim: Simulate get hardware address of a PCI portdrivers/ drivers/ drivers/ | +35 | 0 replies | |
| 4/7 | netdevsim: Simulate set hardware address of a PCI portdrivers/ drivers/ drivers/ | +26 | 0 replies | |
| 5/7 | netdevsim: Simulate port function state for a PCI portdrivers/ drivers/ drivers/ | +28 | 0 replies | |
| 6/7 | netdevsim: Simulate port function set state for a PCI portdrivers/ drivers/ drivers/ | +20 | 0 replies | |
| 7/7 | netdevsim: Add netdevsim port add test casestools/ | +71 | 2 replies |
Reviews trailers per patch
1 of 7 patches has a Reviewed-by or Acked-by.
| Patch | Jiri Pirko |
|---|---|
| 1/7 | |
| 2/7 | R-b |
| 3/7 | |
| 4/7 | |
| 5/7 | |
| 6/7 | |
| 7/7 |
Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes.
Cover letter [PATCH net-next v2 0/7] netdevsim port add, delete support
This series simulates one or more PCI PF and SF port addition and function configuration functionality.
Example sequence:
Create a device with ID=10 and one physical port.
$ echo "10 1" > /sys/bus/netdevsim/new_device
Add PCI PF port:
$ devlink port add netdevsim/netdevsim10 flavour pcipf pfnum 2
netdevsim/netdevsim10/1: type eth netdev eth1 flavour pcipf controller 0 pfnum 2 external false splittable false
function:
hw_addr 00:00:00:00:00:00$ devlink port add netdevsim/netdevsim10 flavour pcisf pfnum 2
netdevsim/netdevsim10/2: type eth netdev eth2 flavour pcisf controller 0 pfnum 2 sfnum 0 splittable false
function:
hw_addr 00:00:00:00:00:00Show devlink port:
$ devlink port show netdevsim/netdevsim10/2
netdevsim/netdevsim10/2: type eth netdev eth2 flavour pcisf controller 0 pfnum 2 sfnum 0 splittable false
function:
hw_addr 00:00:00:00:00:00 state inactive opstate detachedSet the MAC address and activate the function:
$ devlink port function set netdevsim/netdevsim10/2 hw_addr 00:11:22:33:44:55 state active
Show the port and function attributes in JSON format:
$ devlink port show netdevsim/netdevsim10/2 -jp
{
"port": {
"netdevsim/netdevsim10/2": {
"type": "eth",
"netdev": "eth2",
"flavour": "pcisf",
"controller": 0,
"pfnum": 2,
"sfnum": 0,
"splittable": false,
"function": {
"hw_addr": "00:11:22:33:44:55",
"state": "active",
"opstate": "attached"
}
}
}
}Delete PCI SF and PF ports:
$ devlink port del netdevsim/netdevsim10/2
Patch summary:
patch-1 adds support for adding/remove PCI PF port patch-2 adds support for adding/remove PCI SF port patch-3 simulates MAC address query patch-4 simulates setting MAC address patch-5 simulates state query
patch-6 simulates setting state
patch-7 adds tests
Parav Pandit (7):
netdevsim: Add support for add and delete of a PCI PF port
netdevsim: Add support for add and delete PCI SF port
netdevsim: Simulate get hardware address of a PCI port
netdevsim: Simulate set hardware address of a PCI port
netdevsim: Simulate port function state for a PCI port
netdevsim: Simulate port function set state for a PCI port
netdevsim: Add netdevsim port add test cases
drivers/net/netdevsim/Makefile | 2 +- drivers/net/netdevsim/dev.c | 14 + drivers/net/netdevsim/netdevsim.h | 38 ++ drivers/net/netdevsim/port_function.c | 521 ++++++++++++++++++ .../drivers/net/netdevsim/devlink.sh | 72 ++- 5 files changed, 645 insertions(+), 2 deletions(-) create mode 100644 drivers/net/netdevsim/port_function.c
Signature · 1 line
2.26.2