Dmytro Linkin 1897db2ec3 devlink: Allow setting tx rate for devlink rate leaf objects
Implement support for DEVLINK_CMD_RATE_SET command with new attributes
DEVLINK_ATTR_RATE_TX_{SHARE|MAX} that are used to set devlink rate
shared/max tx rate values. Extend devlink ops with new callbacks
rate_leaf_tx_{share|max}_set() to allow supporting drivers to implement
rate control through devlink.

New attributes are optional. Driver implementations are allowed to
support either or both of them.

Shared rate example:

$ devlink port function rate set netdevsim/netdevsim10/0 tx_share 10mbit

$ devlink port function rate show netdevsim/netdevsim10/0
netdevsim/netdevsim10/0: type leaf tx_share 10mbit

Max rate example:

$ devlink port function rate set netdevsim/netdevsim10/0 tx_max 100mbit

$ devlink port function rate show netdevsim/netdevsim10/0
netdevsim/netdevsim10/0: type leaf tx_max 100mbit

Co-developed-by: Vlad Buslov <vladbu@nvidia.com>
Signed-off-by: Vlad Buslov <vladbu@nvidia.com>
Signed-off-by: Dmytro Linkin <dlinkin@nvidia.com>
Reviewed-by: Jiri Pirko <jiri@nvidia.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2021-06-02 14:08:37 -07:00
..
2021-06-02 14:01:55 -07:00
2021-05-20 15:50:54 -07:00
2021-03-30 16:54:50 -07:00
2021-05-27 14:39:11 -07:00
2021-05-17 15:29:35 -07:00
2021-06-02 14:01:55 -07:00
2021-06-02 14:01:55 -07:00
2021-05-24 14:10:28 -07:00
2021-03-28 17:31:13 -07:00
2021-05-17 15:29:35 -07:00
2021-05-31 22:45:05 -07:00
2021-06-02 14:01:55 -07:00
2021-05-07 11:23:41 -07:00
2021-01-24 14:27:18 +01:00
2021-03-28 17:31:13 -07:00
2021-03-25 16:56:27 -07:00