From: <dlinkin@nvidia.com>
To: <netdev@vger.kernel.org>
Cc: <davem@davemloft.net>, <kuba@kernel.org>, <jiri@nvidia.com>,
<stephen@networkplumber.org>, <dsahern@gmail.com>,
<vladbu@nvidia.com>, Dmytro Linkin <dlinkin@nvidia.com>
Subject: [PATCH RESEND-2 RFC net-next 00/18] devlink: rate objects API
Date: Wed, 21 Apr 2021 18:52:47 +0300 [thread overview]
Message-ID: <1619020385-20220-1-git-send-email-dlinkin@nvidia.com> (raw)
From: Dmytro Linkin <dlinkin@nvidia.com>
Sorry for annoying. Please, ignore previous RESEND.
Resending, due to the issue with smtp server.
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:
- flows requires net device to be placed on, which wouldn't exist for
"groups" instances
- effect of limiting depends on the position of tc-police action in the
pipeline, while the goal is to have steady behaviour similar to legacy
ip-link transmit bandwidth control
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
- storing/retrieving driver specific data in rate object
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
Add devlink rate object support for netdevsim driver.
To support devlink rate objects implement VF ports and eswitch mode
selector 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 func rate flush netdevsim/netdevsim10/group
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 | 393 ++++++++++++-
drivers/net/netdevsim/netdev.c | 95 +++-
drivers/net/netdevsim/netdevsim.h | 48 ++
include/net/devlink.h | 47 ++
include/uapi/linux/devlink.h | 17 +
net/core/devlink.c | 613 ++++++++++++++++++++-
.../selftests/drivers/net/netdevsim/devlink.sh | 167 +++++-
10 files changed, 1514 insertions(+), 58 deletions(-)
--
1.8.3.1
next reply other threads:[~2021-04-21 15:53 UTC|newest]
Thread overview: 26+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-04-21 15:52 dlinkin [this message]
2021-04-21 15:52 ` [PATCH RESEND-2 RFC net-next 01/18] netdevsim: Add max_vfs to bus_dev dlinkin
2021-04-21 15:52 ` [PATCH RESEND-2 RFC net-next 02/18] netdevsim: Disable VFs on nsim_dev_reload_destroy() call dlinkin
2021-04-21 15:52 ` [PATCH RESEND-2 RFC net-next 03/18] netdevsim: Implement port types and indexing dlinkin
2021-04-21 15:52 ` [PATCH RESEND-2 RFC net-next 04/18] netdevsim: Implement VFs dlinkin
2021-04-21 15:52 ` [PATCH RESEND-2 RFC net-next 05/18] netdevsim: Implement legacy/switchdev mode for VFs dlinkin
2021-04-21 15:52 ` [PATCH RESEND-2 RFC net-next 06/18] devlink: Introduce rate object dlinkin
2021-04-21 15:52 ` [PATCH RESEND-2 RFC net-next 07/18] netdevsim: Register devlink rate leaf objects per VF dlinkin
2021-04-21 15:52 ` [PATCH RESEND-2 RFC net-next 08/18] selftest: netdevsim: Add devlink rate test dlinkin
2021-04-21 15:52 ` [PATCH RESEND-2 RFC net-next 09/18] devlink: Allow setting tx rate for devlink rate leaf objects dlinkin
2021-04-21 15:52 ` [PATCH RESEND-2 RFC net-next 10/18] netdevsim: Implement devlink rate leafs tx rate support dlinkin
2021-04-22 12:30 ` kernel test robot
2021-04-22 15:18 ` kernel test robot
2021-04-21 15:52 ` [PATCH RESEND-2 RFC net-next 11/18] selftest: netdevsim: Add devlink port shared/max tx rate test dlinkin
2021-04-21 15:52 ` [PATCH RESEND-2 RFC net-next 12/18] devlink: Introduce rate nodes dlinkin
2021-04-21 21:31 ` kernel test robot
2021-04-21 21:32 ` kernel test robot
2021-04-23 9:37 ` Dan Carpenter
2021-04-23 9:37 ` Dan Carpenter
2021-04-23 10:26 ` Dmytro Linkin
2021-04-21 15:53 ` [PATCH RESEND-2 RFC net-next 13/18] netdevsim: Implement support for devlink " dlinkin
2021-04-21 15:53 ` [PATCH RESEND-2 RFC net-next 14/18] selftest: netdevsim: Add devlink rate nodes test dlinkin
2021-04-21 15:53 ` [PATCH RESEND-2 RFC net-next 15/18] devlink: Allow setting parent node of rate objects dlinkin
2021-04-21 15:53 ` [PATCH RESEND-2 RFC net-next 16/18] netdevsim: " dlinkin
2021-04-21 15:53 ` [PATCH RESEND-2 RFC net-next 17/18] selftest: netdevsim: Add devlink rate grouping test dlinkin
2021-04-21 15:53 ` [PATCH RESEND-2 RFC net-next 18/18] Documentation: devlink rate objects dlinkin
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1619020385-20220-1-git-send-email-dlinkin@nvidia.com \
--to=dlinkin@nvidia.com \
--cc=davem@davemloft.net \
--cc=dsahern@gmail.com \
--cc=jiri@nvidia.com \
--cc=kuba@kernel.org \
--cc=netdev@vger.kernel.org \
--cc=stephen@networkplumber.org \
--cc=vladbu@nvidia.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.