devlink: rate objects API
Get series with b4
b4 am [email protected]Versions newest first · linked by author and title
- v3 Latest posting 2/218 patches 3 repliesIn review
- v3 RFC posting 1/218 patches 0 repliesSuperseded
- v2 RFC18 patches 0 repliesSuperseded
Earlier versions · 1
| Version | Posted | Patches | Replies | Status |
|---|---|---|---|---|
| v1 RFC | 18 patches | 2 replies | Superseded |
Changes in v3 from the cover letter
- devlink:
- added devlink_rate_nodes_destroy() function
- netdevsim:
- added call of devlink_rate_nodes_destroy() function
Patches in v3 posting 2/2 No applies recorded yet
| # | Subject and files | Size | Replies | Applied |
|---|---|---|---|---|
| 1/18 | netdevsim: Add max_vfs to bus_devdrivers/ drivers/ drivers/ | +113 | 0 replies | |
| 2/18 | netdevsim: Disable VFs on nsim_dev_reload_destroy() calldrivers/ drivers/ drivers/ | +8 | 0 replies | |
| 3/18 | netdevsim: Implement port types and indexingdrivers/ drivers/ drivers/ | +60 | 0 replies | |
| 4/18 | netdevsim: Implement VFsdrivers/ drivers/ | +77 | 0 replies | |
| 5/18 | netdevsim: Implement legacy/switchdev mode for VFsdrivers/ drivers/ drivers/ +1 more | +104 | 0 replies | |
| 6/18 | devlink: Introduce rate objectinclude/ include/ net/ | +253 | 0 replies | |
| 7/18 | netdevsim: Register devlink rate leaf objects per VFdrivers/ | +11 | 0 replies | |
| 8/18 | selftest: netdevsim: Add devlink rate testtools/ | +24 | 0 replies | |
| 9/18 | devlink: Allow setting tx rate for devlink rate leaf objectsinclude/ include/ net/ | +98 | 0 replies | |
| 10/18 | netdevsim: Implement devlink rate leafs tx rate supportdrivers/ | +75 | 0 replies | |
| 11/18 | selftest: netdevsim: Add devlink port shared/max tx rate testtools/ | +55 | 0 replies | |
| 12/18 | devlink: Introduce rate nodesinclude/ include/ net/ | +247 | 0 replies | |
| 13/18 | netdevsim: Implement support for devlink rate nodesdrivers/ drivers/ | +81 | 0 replies | |
| 14/18 | selftest: netdevsim: Add devlink rate nodes testtools/ | +45 | 0 replies | |
| 15/18 | devlink: Allow setting parent node of rate objectsinclude/ include/ net/ | +137 | 0 replies | |
| 16/18 | netdevsim: Allow setting parent node of rate objectsdrivers/ drivers/ | +89 | 0 replies | |
| 17/18 | selftest: netdevsim: Add devlink rate grouping testtools/ | +42 | 0 replies | |
| 18/18 | Documentation: devlink rate objectsDocumentation/ Documentation/ | +61 | 0 replies |
Reviews trailers per patch
All 18 patches have a Reviewed-by or Acked-by of their own; the series has one for all of them.
| Patch | Jiri Pirko |
|---|---|
| Series | R-b R-b R-b |
| 1/18 | R-b |
| 2/18 | R-b |
| 3/18 | R-b |
| 4/18 | R-b |
| 5/18 | R-b |
| 6/18 | R-b |
| 7/18 | R-b |
| 8/18 | R-b |
| 9/18 | R-b |
| 10/18 | R-b |
| 11/18 | R-b |
| 12/18 | R-b |
| 13/18 | R-b |
| 14/18 | R-b |
| 15/18 | R-b |
| 16/18 | R-b |
| 17/18 | R-b |
| 18/18 | R-b |
Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes.
Cover letter [PATCH RESEND net-next v3 00/18] devlink: rate objects API
From: Dmytro Linkin <[email protected]>
Resending without RFC.
Currently kernel provides a way to change tx rate of single VF in switchdev mode via tc-police action. When lots of VFs are configured management of theirs rates becomes non-trivial task and some grouping mechanism is required. Implementing such grouping in tc-police will bring flow related limitations and unwanted complications, like:
- tc-police is a policer and there is a user request for a traffic shaper, so shared tc-police action is not suitable;
- flows requires net device to be placed on, means "groups" wouldn't have net device instance itself. Taking into the account previous point was reviewed a sollution, when representor have a policer and the driver use a shaper if qdisc contains group of VFs - such approach ugly, compilated and misleading;
- TC is ingress only, while configuring "other" side of the wire looks more like a "real" picture where shaping is outside of the steering world, similar to "ip link" command;
According to that devlink is the most appropriate place.
This series introduces devlink API for managing tx rate of single devlink port or of a group by invoking callbacks (see below) of corresponding driver. Also devlink port or a group can be added to the parent group, where driver responsible to handle rates of a group elements. To achieve all of that new rate object is added. It can be one of the two types:
- leaf - represents a single devlink port; created/destroyed by the driver and bound to the devlink port. As example, some driver may create leaf rate object for every devlink port associated with VF. Since leaf have 1to1 mapping to it's devlink port, in user space it is referred as pci/<bus_addr>/<port_index>;
- node - represents a group of rate objects; created/deleted by request from the userspace; initially empty (no rate objects added). In userspace it is referred as pci/<bus_addr>/<node_name>, where node name can be any, except decimal number, to avoid collisions with leafs.
devlink_ops extended with following callbacks:
- rate_{leaf|node}_tx_{share|max}_set
- rate_node_{new|del}
- rate_{leaf|node}_parent_set
KAPI provides:
- creation/destruction of the leaf rate object associated with devlink port
- destruction of rate nodes to allow a vendor driver to free allocated resources on driver removal or due to the other reasons when nodes destruction required
UAPI provides:
- dumping all or single rate objects
- setting tx_{share|max} of rate object of any type
- creating/deleting node rate object
- setting/unsetting parent of any rate object
Added devlink rate object support for netdevsim driver
Issues/open questions:
- Does user need DEVLINK_CMD_RATE_DEL_ALL_CHILD command to clean all children of particular parent node? For example:
$ devlink port function rate flush netdevsim/netdevsim10/group - priv pointer passed to the callbacks is a source of bugs; in leaf case driver can embed rate object into internal structure and use container_of() on it; in node case it cannot be done since nodes are created from userspace
v1->v2:
- fixed kernel-doc for devlink_rate_leaf_{create|destroy}()
- s/func/function/ for all devlink port command occurences
v2->v3:
- devlink:
- added devlink_rate_nodes_destroy() function
- netdevsim:
- added call of devlink_rate_nodes_destroy() function
Dmytro Linkin (18):
netdevsim: Add max_vfs to bus_dev
netdevsim: Disable VFs on nsim_dev_reload_destroy() call
netdevsim: Implement port types and indexing
netdevsim: Implement VFs
netdevsim: Implement legacy/switchdev mode for VFs
devlink: Introduce rate object
netdevsim: Register devlink rate leaf objects per VF
selftest: netdevsim: Add devlink rate test
devlink: Allow setting tx rate for devlink rate leaf objects
netdevsim: Implement devlink rate leafs tx rate support
selftest: netdevsim: Add devlink port shared/max tx rate test
devlink: Introduce rate nodes
netdevsim: Implement support for devlink rate nodes
selftest: netdevsim: Add devlink rate nodes test
devlink: Allow setting parent node of rate objects
netdevsim: Allow setting parent node of rate objects
selftest: netdevsim: Add devlink rate grouping test
Documentation: devlink rate objects
Documentation/networking/devlink/devlink-port.rst | 35 ++ Documentation/networking/devlink/netdevsim.rst | 26 + drivers/net/netdevsim/bus.c | 131 +++- drivers/net/netdevsim/dev.c | 396 ++++++++++++- drivers/net/netdevsim/netdev.c | 95 ++- drivers/net/netdevsim/netdevsim.h | 48 ++ include/net/devlink.h | 48 ++ include/uapi/linux/devlink.h | 17 + net/core/devlink.c | 660 ++++++++++++++++++++- .../selftests/drivers/net/netdevsim/devlink.sh | 167 +++++- 10 files changed, 1565 insertions(+), 58 deletions(-)
Signature · 1 line
1.8.3.1