Class: Nl::Linux::NetShaper
- Inherits:
-
Genl::Family
- Object
- Family
- Genl::Family
- Nl::Linux::NetShaper
- Defined in:
- nl-linux/generated/nl/linux/net_shaper.rb
Overview
Networking HW rate limiting configuration.
This API allows configuring HW shapers available on the network devices 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 a handle,
comprising both a scope and an id.
Depending on the scope value, the shapers are attached to specific
HW objects (queues, devices) or, for node scope, represent a
scheduling group, that can be placed in an arbitrary location of
the scheduling tree.
Shapers can be created with two different operations: the set
operation, to create and update a single "attached" shaper, and
the group operation, to create and update a scheduling
group. Only the group operation can create node scope shapers.
Existing shapers can be deleted/reset via the delete operation.
The user can query the running configuration via the get operation.
Different devices can provide different feature sets, e.g. with no
support for complex scheduling hierarchy, or for some shaping
parameters. The user can introspect the HW capabilities via the
cap-get operation.
Defined Under Namespace
Modules: AttributeSets, Constants, Enums, Messages, Notifications, Structs Classes: AsyncOperations
Constant Summary collapse
- NAME =
"net-shaper"- VERSION =
1
Class Method Summary collapse
Instance Method Summary collapse
-
#async(stream_capacity: nil) ⇒ AsyncOperations
Returns the asynchronous operation facade for this family.
-
#do_cap_get(**args) ⇒ Messages::DoCapGetReply
Get the shaper capabilities supported by the given device for the specified scope.
-
#do_delete(**args) ⇒ void
Clear (remove) the specified shaper.
-
#do_get(**args) ⇒ Messages::DoGetReply
Get information about a shaper for a given device.
-
#do_group(**args) ⇒ Messages::DoGroupReply
Create or update a scheduling group, attaching the specified
leavesshapers under the specified node identified byhandle.Theleavesshapers scope must bequeueand the node shaper scope must be eithernodeornetdev.When the node shaper hasnodescope, if thehandleidis not specified, a new shaper of such scope is created, otherwise the specified node must already exist. -
#do_set(**args) ⇒ void
Create or update the specified shaper.
-
#dump_cap_get(**args, &block) ⇒ Object
Get the shaper capabilities supported by the given device for the specified scope.
-
#dump_get(**args, &block) ⇒ Object
Get information about a shaper for a given device.
Methods inherited from Genl::Family
Class Method Details
.open(resolver: ::Nl::Linux::DEFAULT_RESOLVER, executor: nil, notification_capacity: DEFAULT_NOTIFICATION_CAPACITY) ⇒ NetShaper .open(resolver: ::Nl::Linux::DEFAULT_RESOLVER, executor: nil, notification_capacity: DEFAULT_NOTIFICATION_CAPACITY) {|family| ... } ⇒ Object
53 54 55 |
# File 'nl-linux/generated/nl/linux/net_shaper.rb', line 53 def self.open(resolver: ::Nl::Linux::DEFAULT_RESOLVER, executor: nil, notification_capacity: DEFAULT_NOTIFICATION_CAPACITY) super end |
Instance Method Details
#async(stream_capacity: nil) ⇒ AsyncOperations
Returns the asynchronous operation facade for this family.
1407 1408 1409 1410 |
# File 'nl-linux/generated/nl/linux/net_shaper.rb', line 1407 def async(stream_capacity: nil) return @async_operations ||= build_async_facade(AsyncOperations) if stream_capacity.nil? build_async_facade(AsyncOperations, stream_capacity:) end |
#do_cap_get(**args) ⇒ Messages::DoCapGetReply
Get the shaper capabilities supported by the given device for the specified scope.
1235 1236 1237 |
# File 'nl-linux/generated/nl/linux/net_shaper.rb', line 1235 def do_cap_get(**args) (:"do", Messages::DoCapGetRequest, Messages::DoCapGetReply, args) end |
#do_delete(**args) ⇒ void
This method returns an undefined value.
Clear (remove) the specified shaper. When deleting
a node shaper, reattach all the node's leaves to the
deleted node's parent.
If, after the removal, the parent shaper has no more
leaves and the parent shaper scope is node, the parent
node is deleted, recursively.
When deleting a queue shaper or a netdev shaper,
the shaper disappears from the hierarchy, but the
queue/device can still send traffic: it has an implicit
node with infinite bandwidth. The queue's implicit node
feeds an implicit RR node at the root of the hierarchy.
Requires CAP_NET_ADMIN in the initial user namespace.
1175 1176 1177 |
# File 'nl-linux/generated/nl/linux/net_shaper.rb', line 1175 def do_delete(**args) (:"do", Messages::DoDeleteRequest, nil, args) end |
#do_get(**args) ⇒ Messages::DoGetReply
Get information about a shaper for a given device.
1106 1107 1108 |
# File 'nl-linux/generated/nl/linux/net_shaper.rb', line 1106 def do_get(**args) (:"do", Messages::DoGetRequest, Messages::DoGetReply, args) end |
#do_group(**args) ⇒ Messages::DoGroupReply
Create or update a scheduling group, attaching the specified
leaves shapers under the specified node identified by handle.
The leaves shapers scope must be queue and the node shaper
scope must be either node or netdev.
When the node shaper has node scope, if the handle id is not
specified, a new shaper of such scope is created, otherwise the
specified node must already exist.
When updating an existing node shaper, the specified leaves are
added to the existing node; such node will also retain any preexisting
leave.
The parent handle for a new node shaper defaults to the parent
of all the leaves, provided all the leaves share the same parent.
Otherwise parent handle must be specified.
The user can optionally provide shaping attributes for the node
shaper.
The operation is atomic, on failure no change is applied to
the device shaping configuration, otherwise the node shaper
full identifier, comprising binding and handle, is provided
as the reply.
Requires CAP_NET_ADMIN in the initial user namespace.
1222 1223 1224 |
# File 'nl-linux/generated/nl/linux/net_shaper.rb', line 1222 def do_group(**args) (:"do", Messages::DoGroupRequest, Messages::DoGroupReply, args) end |
#do_set(**args) ⇒ void
This method returns an undefined value.
Create or update the specified shaper.
The set operation can't be used to create a node scope shaper,
use the group operation instead.
Requires CAP_NET_ADMIN in the initial user namespace.
1152 1153 1154 |
# File 'nl-linux/generated/nl/linux/net_shaper.rb', line 1152 def do_set(**args) (:"do", Messages::DoSetRequest, nil, args) end |
#dump_cap_get(**args) ⇒ Array<Messages::DumpCapGetReply> #dump_cap_get(**args) {|reply| ... } ⇒ void
Get the shaper capabilities supported by the given device for the specified scope.
1254 1255 1256 |
# File 'nl-linux/generated/nl/linux/net_shaper.rb', line 1254 def dump_cap_get(**args, &block) (:"dump", Messages::DumpCapGetRequest, Messages::DumpCapGetReply, args, &block) end |
#dump_get(**args) ⇒ Array<Messages::DumpGetReply> #dump_get(**args) {|reply| ... } ⇒ void
Get information about a shaper for a given device.
1124 1125 1126 |
# File 'nl-linux/generated/nl/linux/net_shaper.rb', line 1124 def dump_get(**args, &block) (:"dump", Messages::DumpGetRequest, Messages::DumpGetReply, args, &block) end |