From: Jakub Kicinski <kuba@kernel.org>
To: Paolo Abeni <pabeni@redhat.com>
Cc: netdev@vger.kernel.org, Jiri Pirko <jiri@resnulli.us>,
Madhu Chittim <madhu.chittim@intel.com>,
Sridhar Samudrala <sridhar.samudrala@intel.com>,
Simon Horman <horms@kernel.org>,
John Fastabend <john.fastabend@gmail.com>,
Sunil Kovvuri Goutham <sgoutham@marvell.com>,
Jamal Hadi Salim <jhs@mojatatu.com>,
Donald Hunter <donald.hunter@gmail.com>
Subject: Re: [PATCH v4 net-next 02/12] netlink: spec: add shaper YAML spec
Date: Thu, 22 Aug 2024 18:48:24 -0700 [thread overview]
Message-ID: <20240822184824.3f0c5a28@kernel.org> (raw)
In-Reply-To: <dac4964232855be1444971d260dab0c106c86c26.1724165948.git.pabeni@redhat.com>
On Tue, 20 Aug 2024 17:12:23 +0200 Paolo Abeni wrote:
> diff --git a/Documentation/netlink/specs/net_shaper.yaml b/Documentation/netlink/specs/net_shaper.yaml
> new file mode 100644
> index 000000000000..a2b7900646ae
> --- /dev/null
> +++ b/Documentation/netlink/specs/net_shaper.yaml
> @@ -0,0 +1,289 @@
> +# SPDX-License-Identifier: ((GPL-2.0 WITH Linux-syscall-note) OR BSD-3-Clause)
> +
> +name: net-shaper
> +
> +doc: |
> + Network device HW rate limiting configuration.
> +
> + This API allows configuring HR shapers available on the network
What's HR?
> + device at different levels (queues, network device) and allows
> + arbitrary manipulation of the scheduling tree of the involved
> + shapers.
> +
> + Each @shaper is identified within the given device, by an @handle,
> + comprising both a @scope and an @id, and can be created via two
> + different modifiers: the @set operation, to create and update single
s/different modifiers/operations/
> + shaper, and the @group operation, to create and update a scheduling
> + group.
> +
> + Existing shapers can be deleted via the @delete operation.
deleted -> deleted / reset
> + The user can query the running configuration via the @get operation.
The distinction between "scoped" nodes which can be "set"
and "detached" "node"s which can only be created via "group" (AFAIU)
needs clearer explanation.
> +definitions:
> + -
> + type: enum
> + name: scope
> + doc: The different scopes where a shaper can be attached.
Are they attached or are they the nodes themselves?
Maybe just say that scope defines the ID interpretation and that's it.
> + render-max: true
> + entries:
> + - name: unspec
> + doc: The scope is not specified.
> + -
> + name: netdev
> + doc: The main shaper for the given network device.
> + -
> + name: queue
> + doc: The shaper is attached to the given device queue.
> + -
> + name: node
> + doc: |
> + The shaper allows grouping of queues or others
> + node shapers, is not attached to any user-visible
Saying it's not attached is confusing. Makes it sound like it exists
outside of the scope of a struct net_device.
> + network device component, and can be nested to
> + either @netdev shapers or other @node shapers.
> +attribute-sets:
> + -
> + name: net-shaper
> + attributes:
> + -
> + name: handle
> + type: nest
> + nested-attributes: handle
> + doc: Unique identifier for the given shaper inside the owning device.
> + -
> + name: info
> + type: nest
> + nested-attributes: info
> + doc: Fully describes the shaper.
> + -
> + name: metric
> + type: u32
> + enum: metric
> + doc: Metric used by the given shaper for bw-min, bw-max and burst.
> + -
> + name: bw-min
> + type: uint
> + doc: Minimum guaranteed B/W for the given shaper.
s/Minimum g/G/
Please spell out "bandwidth" in user-facing docs.
> + -
> + name: bw-max
> + type: uint
> + doc: Shaping B/W for the given shaper or 0 when unlimited.
s/Shaping/Maximum/
> + -
> + name: burst
> + type: uint
> + doc: Maximum burst-size for bw-min and bw-max.
How about:
s/bw-min and bw-max/shaping. Should not be interpreted as a quantum./
?
> + -
> + name: priority
> + type: u32
> + doc: Scheduling priority for the given shaper.
Please clarify that that priority is only valid on children of
a scheduling node, and the priority values are only compared
between siblings.
> + -
> + name: weight
> + type: u32
> + doc: |
> + Weighted round robin weight for given shaper.
Relative weight of the input into a round robin node.
?
> + The scheduling is applied to all the sibling
> + shapers with the same priority.
> + -
> + name: scope
> + type: u32
> + enum: scope
> + doc: The given shaper scope.
:)
> + -
> + name: id
> + type: u32
> + doc: |
> + The given shaper id.
"Numeric identifier of a shaper."
Do we ever use ID and scope directly in a nest with other attrs?
Or are they always wrapped in handle/parent ?
If they are always wrapped they can be a standalone attr set / space.
> The id semantic depends on the actual
> + scope, e.g. for @queue scope it's the queue id, for
> + @node scope it's the node identifier.
> + -
> + name: ifindex
> + type: u32
> + doc: Interface index owning the specified shaper.
> + -
> + name: parent
> + type: nest
> + nested-attributes: handle
> + doc: |
> + Identifier for the parent of the affected shaper,
> + The parent is usually implied by the shaper handle itself,
> + with the only exception of the root shaper in the @group operation.
Maybe just say that specifying the parent is only needed for group
operations? I think that's what you mean.
> + -
> + name: leaves
> + type: nest
> + multi-attr: true
> + nested-attributes: info
> + doc: |
> + Describes a set of leaves shapers for a @group operation.
> + -
> + name: root
> + type: nest
> + nested-attributes: root-info
> + doc: |
> + Describes the root shaper for a @group operation
missing full stop
> + Differently from @leaves and @shaper allow specifying
> + the shaper parent handle, too.
Maybe this attr is better called "node", after all.
> + -
> + name: shaper
> + type: nest
> + nested-attributes: info
> + doc: |
> + Describes a single shaper for a @set operation.
Hm. How is this different than "info"?
$ git grep SHAPER_A_INFO
include/uapi/linux/net_shaper.h: NET_SHAPER_A_INFO,
$
is "info" supposed to be used?
> +operations:
> + list:
> + -
> + name: get
> + doc: |
> + Get / Dump information about a/all the shaper for a given device.
There's no need to "/ dump" and "/all".
> + attribute-set: net-shaper
> + -
> + name: set
> + doc: |
> + Create or updates the specified shaper.
create or update
> + On failure the extack is set accordingly.
it better be - no need to explain netlink basics
> + Can't create @node scope shaper, use
> + the @group operation instead.
"The set operation can't be used to create a @node scope shaper..."
> + attribute-set: net-shaper
> + flags: [ admin-perm ]
> +
> + do:
> + pre: net-shaper-nl-pre-doit
> + post: net-shaper-nl-post-doit
> + request:
> + attributes:
> + - ifindex
> + - shaper
> +
> + -
> + name: delete
> + doc: |
> + Clear (remove) the specified shaper. When deleting
> + a @node shaper, relink all the node's leaves to the
relink -> reattach ?
> + deleted node parent.
delete node's parent
> + If, after the removal, the parent shaper has no more
> + leaves and the parent shaper scope is @node, even
> + the parent node is deleted, recursively.
> + On failure the extack is set accordingly.
> + attribute-set: net-shaper
> + flags: [ admin-perm ]
> +
> + do:
> + pre: net-shaper-nl-pre-doit
> + post: net-shaper-nl-post-doit
> + request:
> + attributes: *ns-binding
> +
> + -
> + name: group
> + doc: |
> + Creates or updates a scheduling group, adding the specified
Please use imperative mood, like in a commit message.
adding -> attach(ing)
> +++ b/net/shaper/Makefile
> @@ -0,0 +1,9 @@
> +# SPDX-License-Identifier: GPL-2.0-only
> +#
> +# Makefile for the Generic HANDSHAKE service
> +#
> +# Copyright (c) 2024, Red Hat, Inc.
Ironic that you added the copyright given the copy/paste
fail in the contents... ;)
next prev parent reply other threads:[~2024-08-23 1:48 UTC|newest]
Thread overview: 34+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-08-20 15:12 [PATCH v4 net-next 00/12] net: introduce TX H/W shaping API Paolo Abeni
2024-08-20 15:12 ` [PATCH v4 net-next 01/12] tools: ynl: lift an assumption about spec file name Paolo Abeni
2024-08-20 15:12 ` [PATCH v4 net-next 02/12] netlink: spec: add shaper YAML spec Paolo Abeni
2024-08-23 1:48 ` Jakub Kicinski [this message]
2024-08-23 8:35 ` Paolo Abeni
2024-08-23 9:04 ` Paolo Abeni
2024-08-27 1:50 ` Jakub Kicinski
2024-08-27 7:41 ` Paolo Abeni
2024-08-23 1:56 ` Jakub Kicinski
2024-08-20 15:12 ` [PATCH v4 net-next 03/12] net-shapers: implement NL get operation Paolo Abeni
2024-08-23 2:10 ` Jakub Kicinski
2024-08-23 8:52 ` Paolo Abeni
2024-08-27 1:55 ` Jakub Kicinski
2024-08-27 7:36 ` Paolo Abeni
2024-08-20 15:12 ` [PATCH v4 net-next 04/12] net-shapers: implement NL set and delete operations Paolo Abeni
2024-08-20 15:12 ` [PATCH v4 net-next 05/12] net-shapers: implement NL group operation Paolo Abeni
2024-08-20 15:12 ` [PATCH v4 net-next 06/12] net-shapers: implement delete support for NODE scope shaper Paolo Abeni
2024-08-20 15:12 ` [PATCH v4 net-next 07/12] netlink: spec: add shaper introspection support Paolo Abeni
2024-08-20 15:12 ` [PATCH v4 net-next 08/12] net: shaper: implement " Paolo Abeni
2024-08-20 15:12 ` [PATCH v4 net-next 09/12] testing: net-drv: add basic shaper test Paolo Abeni
2024-08-21 16:52 ` kernel test robot
2024-08-22 7:53 ` Paolo Abeni
2024-08-27 14:14 ` Simon Horman
2024-08-20 15:12 ` [PATCH v4 net-next 10/12] virtchnl: support queue rate limit and quanta size configuration Paolo Abeni
2024-08-20 15:12 ` [PATCH v4 net-next 11/12] ice: Support VF " Paolo Abeni
2024-08-20 15:12 ` [PATCH v4 net-next 12/12] iavf: Add net_shaper_ops support Paolo Abeni
2024-08-20 23:03 ` kernel test robot
2024-08-22 0:58 ` [PATCH v4 net-next 00/12] net: introduce TX H/W shaping API Jakub Kicinski
2024-08-22 1:10 ` patchwork-bot+netdevbpf
2024-08-23 0:43 ` Jakub Kicinski
2024-08-23 7:51 ` Paolo Abeni
2024-08-27 2:14 ` Jakub Kicinski
2024-08-27 7:54 ` Paolo Abeni
2024-08-27 13:53 ` Jakub Kicinski
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=20240822184824.3f0c5a28@kernel.org \
--to=kuba@kernel.org \
--cc=donald.hunter@gmail.com \
--cc=horms@kernel.org \
--cc=jhs@mojatatu.com \
--cc=jiri@resnulli.us \
--cc=john.fastabend@gmail.com \
--cc=madhu.chittim@intel.com \
--cc=netdev@vger.kernel.org \
--cc=pabeni@redhat.com \
--cc=sgoutham@marvell.com \
--cc=sridhar.samudrala@intel.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.