1 # SPDX-License-Identifier: ((GPL-2.0 WITH Linux-syscall-note) OR BSD-3-Clause)
5 Networking HW rate limiting configuration.
7 This API allows configuring HW shapers available on the network
8 devices at different levels (queues, network device) and allows
9 arbitrary manipulation of the scheduling tree of the involved
12 Each @shaper is identified within the given device, by a @handle,
13 comprising both a @scope and an @id.
15 Depending on the @scope value, the shapers are attached to specific
16 HW objects (queues, devices) or, for @node scope, represent a
17 scheduling group, that can be placed in an arbitrary location of
20 Shapers can be created with two different operations: the @set
21 operation, to create and update a single "attached" shaper, and
22 the @group operation, to create and update a scheduling
23 group. Only the @group operation can create @node scope shapers.
25 Existing shapers can be deleted/reset via the @delete operation.
27 The user can query the running configuration via the @get operation.
29 Different devices can provide different feature sets, e.g. with no
30 support for complex scheduling hierarchy, or for some shaping
31 parameters. The user can introspect the HW capabilities via the
38 doc: Defines the shaper @id interpretation.
42 doc: The scope is not specified.
45 doc: The main shaper for the given network device.
49 The shaper is attached to the given device queue,
50 the @id represents the queue number.
54 The shaper allows grouping of queues or other
55 node shapers; can be nested in either @netdev
56 shapers or other @node shapers, allowing placement
57 in any location of the scheduling tree, except
62 doc: Different metric supported by the shaper.
66 doc: Shaper operates on a bits per second basis.
69 doc: Shaper operates on a packets per second basis.
78 nested-attributes: handle
79 doc: Unique identifier for the given shaper inside the owning device.
84 doc: Metric used by the given shaper for bw-min, bw-max and burst.
88 doc: Guaranteed bandwidth for the given shaper.
92 doc: Maximum bandwidth for the given shaper or 0 when unlimited.
97 Maximum burst-size for shaping. Should not be interpreted
103 Scheduling priority for the given shaper. The priority
104 scheduling is applied to sibling shapers.
109 Relative weight for round robin scheduling of the
111 The scheduling is applied to all sibling shapers
112 with the same priority.
116 doc: Interface index owning the specified shaper.
120 nested-attributes: handle
122 Identifier for the parent of the affected shaper.
123 Only needed for @group operation.
128 nested-attributes: leaf-info
130 Describes a set of leaves shapers for a @group operation.
138 doc: Defines the shaper @id interpretation.
143 Numeric identifier of a shaper. The id semantic depends on
144 the scope. For @queue scope it's the queue id and for @node
145 scope it's the node identifier.
148 subset-of: net-shaper
162 doc: Interface index queried for shapers capabilities.
167 doc: The scope to which the queried capabilities apply.
169 name: support-metric-bps
171 doc: The device accepts 'bps' metric for bw-min, bw-max and burst.
173 name: support-metric-pps
175 doc: The device accepts 'pps' metric for bw-min, bw-max and burst.
177 name: support-nesting
180 The device supports nesting shaper belonging to this scope
181 below 'node' scoped shapers. Only 'queue' and 'node'
182 scope can have flag 'support-nesting'.
186 doc: The device supports a minimum guaranteed B/W.
190 doc: The device supports maximum B/W shaping.
194 doc: The device supports a maximum burst size.
196 name: support-priority
198 doc: The device supports priority scheduling.
202 doc: The device supports weighted round robin scheduling.
209 Get information about a shaper for a given device.
210 attribute-set: net-shaper
213 pre: net-shaper-nl-pre-doit
214 post: net-shaper-nl-post-doit
216 attributes: &ns-binding
220 attributes: &ns-attrs
232 pre: net-shaper-nl-pre-dumpit
233 post: net-shaper-nl-post-dumpit
238 attributes: *ns-attrs
242 Create or update the specified shaper.
243 The set operation can't be used to create a @node scope shaper,
244 use the @group operation instead.
245 attribute-set: net-shaper
246 flags: [ admin-perm ]
249 pre: net-shaper-nl-pre-doit
250 post: net-shaper-nl-post-doit
265 Clear (remove) the specified shaper. When deleting
266 a @node shaper, reattach all the node's leaves to the
267 deleted node's parent.
268 If, after the removal, the parent shaper has no more
269 leaves and the parent shaper scope is @node, the parent
270 node is deleted, recursively.
271 When deleting a @queue shaper or a @netdev shaper,
272 the shaper disappears from the hierarchy, but the
273 queue/device can still send traffic: it has an implicit
274 node with infinite bandwidth. The queue's implicit node
275 feeds an implicit RR node at the root of the hierarchy.
276 attribute-set: net-shaper
277 flags: [ admin-perm ]
280 pre: net-shaper-nl-pre-doit
281 post: net-shaper-nl-post-doit
283 attributes: *ns-binding
288 Create or update a scheduling group, attaching the specified
289 @leaves shapers under the specified node identified by @handle.
290 The @leaves shapers scope must be @queue and the node shaper
291 scope must be either @node or @netdev.
292 When the node shaper has @node scope, if the @handle @id is not
293 specified, a new shaper of such scope is created, otherwise the
294 specified node must already exist.
295 When updating an existing node shaper, the specified @leaves are
296 added to the existing node; such node will also retain any preexisting
298 The @parent handle for a new node shaper defaults to the parent
299 of all the leaves, provided all the leaves share the same parent.
300 Otherwise @parent handle must be specified.
301 The user can optionally provide shaping attributes for the node
303 The operation is atomic, on failure no change is applied to
304 the device shaping configuration, otherwise the @node shaper
305 full identifier, comprising @binding and @handle, is provided
307 attribute-set: net-shaper
308 flags: [ admin-perm ]
311 pre: net-shaper-nl-pre-doit
312 post: net-shaper-nl-post-doit
326 attributes: *ns-binding
331 Get the shaper capabilities supported by the given device
332 for the specified scope.
336 pre: net-shaper-nl-cap-pre-doit
337 post: net-shaper-nl-cap-post-doit
343 attributes: &cap-attrs
356 pre: net-shaper-nl-cap-pre-dumpit
357 post: net-shaper-nl-cap-post-dumpit
362 attributes: *cap-attrs