[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <ZquJWp8GxSCmuipW@nanopsycho.orion>
Date: Thu, 1 Aug 2024 15:10:50 +0200
From: Jiri Pirko <jiri@...nulli.us>
To: Paolo Abeni <pabeni@...hat.com>
Cc: netdev@...r.kernel.org, Jakub Kicinski <kuba@...nel.org>,
Madhu Chittim <madhu.chittim@...el.com>,
Sridhar Samudrala <sridhar.samudrala@...el.com>,
Simon Horman <horms@...nel.org>,
John Fastabend <john.fastabend@...il.com>,
Sunil Kovvuri Goutham <sgoutham@...vell.com>,
Jamal Hadi Salim <jhs@...atatu.com>
Subject: Re: [PATCH v3 02/12] netlink: spec: add shaper YAML spec
Tue, Jul 30, 2024 at 10:39:45PM CEST, pabeni@...hat.com wrote:
>Define the user-space visible interface to query, configure and delete
>network shapers via yaml definition.
>
>Add dummy implementations for the relevant NL callbacks.
>
>set() and delete() operations touch a single shaper creating/updating or
>deleting it.
>The group() operation creates a shaper's group, nesting multiple input
>shapers under the specified output shaper.
>
>Signed-off-by: Paolo Abeni <pabeni@...hat.com>
>---
>RFC v1 -> RFC v2:
> - u64 -> uint
> - net_shapers -> net-shapers
> - documented all the attributes
> - dropped [ admin-perm ] for get() op
> - group op
> - set/delete touch a single shaper
>---
> Documentation/netlink/specs/shaper.yaml | 262 ++++++++++++++++++++++++
> MAINTAINERS | 1 +
> include/uapi/linux/net_shaper.h | 74 +++++++
> net/Kconfig | 3 +
> net/Makefile | 1 +
> net/shaper/Makefile | 9 +
> net/shaper/shaper.c | 34 +++
> net/shaper/shaper_nl_gen.c | 117 +++++++++++
> net/shaper/shaper_nl_gen.h | 27 +++
> 9 files changed, 528 insertions(+)
> create mode 100644 Documentation/netlink/specs/shaper.yaml
> create mode 100644 include/uapi/linux/net_shaper.h
> create mode 100644 net/shaper/Makefile
> create mode 100644 net/shaper/shaper.c
> create mode 100644 net/shaper/shaper_nl_gen.c
> create mode 100644 net/shaper/shaper_nl_gen.h
>
>diff --git a/Documentation/netlink/specs/shaper.yaml b/Documentation/netlink/specs/shaper.yaml
>new file mode 100644
>index 000000000000..7327f5596fdb
>--- /dev/null
>+++ b/Documentation/netlink/specs/shaper.yaml
>@@ -0,0 +1,262 @@
>+# SPDX-License-Identifier: ((GPL-2.0 WITH Linux-syscall-note) OR BSD-3-Clause)
>+
>+name: net-shaper
>+
>+doc: Network device HW Rate Limiting offload
>+
>+definitions:
>+ -
>+ type: enum
>+ name: scope
>+ doc: the different scopes where a shaper can be attached
>+ render-max: true
>+ entries:
>+ - name: unspec
>+ doc: The scope is not specified
>+ -
>+ name: port
>+ doc: The root for the whole H/W
What is this "port"?
>+ -
>+ name: netdev
>+ doc: The main shaper for the given network device.
>+ -
>+ name: queue
>+ doc: The shaper is attached to the given device queue.
>+ -
>+ name: detached
>+ doc: |
>+ The shaper is not attached to any user-visible network
>+ device component and allows nesting and grouping of
>+ queues or others detached shapers.
What is the purpose of the "detached" thing?
>+ -
>+ type: enum
>+ name: metric
>+ doc: different metric each shaper can support
>+ entries:
>+ -
>+ name: bps
>+ doc: Shaper operates on a bits per second basis
>+ -
>+ name: pps
>+ doc: Shaper operates on a packets per second basis
>+
[..]
>+
>+operations:
>+ list:
>+ -
>+ name: get
>+ doc: |
>+ Get / Dump information about a/all the shaper for a given device
>+ attribute-set: net-shaper
>+
>+ do:
>+ request:
>+ attributes:
>+ - ifindex
>+ - handle
>+ reply:
>+ attributes: &ns-attrs
>+ - parent
>+ - handle
>+ - metric
>+ - bw-min
>+ - bw-max
>+ - burst
>+ - priority
>+ - weight
>+
>+ dump:
>+ request:
>+ attributes:
>+ - ifindex
>+ reply:
>+ attributes: *ns-attrs
>+ -
>+ name: set
>+ doc: |
>+ Create or configures the specified shaper.
>+ On failures the extack is set accordingly.
>+ Can't create @detached scope shaper, use
>+ the @group operation instead.
>+ attribute-set: net-shaper
>+ flags: [ admin-perm ]
>+
>+ do:
>+ request:
>+ attributes:
>+ - ifindex
>+ - shaper
>+
>+ -
>+ name: delete
>+ doc: |
>+ Clear (remove) the specified shaper. If after the removal
>+ the parent shaper has no more children and the parent
>+ shaper scope is @detached, even the parent is deleted,
>+ recursively.
>+ On failures the extack is set accordingly.
>+ attribute-set: net-shaper
>+ flags: [ admin-perm ]
>+
>+ do:
>+ request:
>+ attributes:
>+ - ifindex
>+ - handle
>+
>+ -
>+ name: group
>+ doc: |
>+ Group the specified input shapers under the specified
>+ output shaper, eventually creating the latter, if needed.
>+ Input shapers scope must be either @queue or @detached.
>+ Output shaper scope must be either @detached or @netdev.
>+ When using an output @detached scope shaper, if the
>+ @handle @id is not specified, a new shaper of such scope
>+ is created and, otherwise the specified output shaper
>+ must be already existing.
I'm lost. Could this designt be described in details in the doc I asked
in the cover letter? :/ Please.
>+ The operation is atomic, on failures the extack is set
>+ accordingly and no change is applied to the device
>+ shaping configuration, otherwise the output shaper
>+ handle is provided as reply.
>+ attribute-set: net-shaper
[..]
Powered by blists - more mailing lists