netshaper - Man Page
show / manipulate network device hardware shaping configuration
Synopsis
netshaper [ Options ] { COMMAND | help }
Options := { -V[ersion] | -c[olor] | -help }
netshaper set dev DEV handle scope HANDLE_SCOPE [ id HANDLE_ID ] bw-max BW_MAX
netshaper { show | delete } dev DEV handle scope HANDLE_SCOPE [ id HANDLE_ID ]
Description
netshaper allows configuration and management of hardware rate limiting (shaping) capabilities available on network devices. The API provides control over shapers at different levels including network devices, queues, and scheduling nodes, enabling manipulation of the device's scheduling tree.
Each shaper is uniquely identified within a device by a handle, which consists of a scope and an optional id. Depending on the scope value, shapers are attached to specific hardware objects:
- netdev
Shapers attached to the entire network device. The id parameter is optional for this scope (defaults to 0 if not specified).
- queue
Shapers attached to specific device queues. The id parameter is required and specifies the queue number.
- node
Shapers representing scheduling groups that can be placed at arbitrary locations in the scheduling tree. The id parameter is required.
Commands
netshaper set
- Create or update a shaper configuration
Creates or updates a shaper with the specified parameters. The id parameter is optional for netdev scope but required for all other scopes.
netshaper show
- Display shaper information
Shows the current configuration of the specified shaper, including bandwidth limits and device information.
netshaper delete
- Remove a shaper configuration
Removes the specified shaper configuration from the device.
Parameters
- dev DEV
Specifies the network device name on which to operate.
- handle
Defines the shaper handle consisting of:
- scope HANDLE_SCOPE
The shaper scope, which can be: netdev (device-level shaper), queue (queue-level shaper), or node (scheduling node shaper).
- id HANDLE_ID
Numeric identifier for the shaper. Optional for netdev scope (defaults to 0), required for queue and node scopes.
- bw-max BW_MAX
Maximum bandwidth limit for the shaper. Accepts values with suffixes: kbit, mbit, gbit for kilobits, megabits, and gigabits per second respectively.
Options
- -V, -Version
Print the version of the netshaper utility and exit.
- -c[color] = {always | auto | never}
Configure color output. If the parameter is omitted or always, color output is enabled regardless of stdout state. If the parameter is auto, stdout is checked to be a terminal before enabling color output. If the parameter is never, color output is disabled. If specified multiple times, the last one takes precedence.
- -help
Display usage information and exit.
Examples
- Example 1: Create a device-level shaper (ID optional)
# netshaper set dev foo handle scope netdev bw-max 10gbit
Creates a netdev-scoped shaper with default id 0 and sets the maximum bandwidth to 10 gigabits per second.
- Example 2: Show shaper configuration
# netshaper show dev foo handle scope netdev
Displays the current shaper configuration for the specified device and handle.
- Example 3: Delete shaper configuration
# netshaper delete dev eth0 handle scope netdev
Removes the specified shaper configuration.
Notes
- For netdev scope, the id parameter is optional and defaults to 0 if not specified.
- For queue and node scopes, the id parameter is required.
- Bandwidth values support standard suffixes: kbit (kilobits per second), mbit (megabits per second), gbit (gigabits per second).
- This command currently supports basic shaper operations. Additional functionality will be added as requirements are identified.
See Also
Author
Erni Sri Satya Vennela <ernis@linux.microsoft.com>