DEVLINK-SB(8) Linux DEVLINK-SB(8)

# [NAME](#NAME)

devlink-sb - devlink shared buffer configuration

# [SYNOPSIS](#SYNOPSIS)

**devlink** \[ *OPTIONS* ] **sb** { *COMMAND* | **help** }

*OPTIONS* := { **-V**\[*ersion*] | **-n**\[*no-nice-names*] }

**devlink sb show** \[ *DEV* \[ **sb** *SB\_INDEX* ] ]

**devlink sb pool show** \[ *DEV* \[ **sb** *SB\_INDEX* ]  
**pool** *POOL\_INDEX* ]

**devlink sb pool set DEV** \[ **sb** *SB\_INDEX* ]  
**pool POOL\_INDEX**  
**size POOL\_SIZE**  
**thtype** { **static** | **dynamic** }

**devlink sb port pool show** \[ *DEV/PORT\_INDEX* \[ **sb** *SB\_INDEX* ]  
**pool** *POOL\_INDEX* ]

**devlink sb port pool set DEV/PORT\_INDEX** \[ **sb** *SB\_INDEX* ]  
**pool POOL\_INDEX**  
**th THRESHOLD**

**devlink sb tc bind show** \[ *DEV/PORT\_INDEX* \[ **sb** *SB\_INDEX* ]  
**tc TC\_INDEX**  
**type** { **ingress** | **egress** } ]

**devlink sb tc bind set DEV/PORT\_INDEX** \[ **sb** *SB\_INDEX* ]  
**tc TC\_INDEX**  
**type** { **ingress** | **egress** }  
**pool POOL\_INDEX**  
**th THRESHOLD**

**devlink sb occupancy show** { *DEV* | *DEV/PORT\_INDEX* } \[ **sb** *SB\_INDEX* ]

**devlink sb occupancy snapshot** *DEV* \[ **sb** *SB\_INDEX* ]

**devlink sb occupancy clearmax** *DEV* \[ **sb** *SB\_INDEX* ]

**devlink sb help**

# [DESCRIPTION](#DESCRIPTION)

## [devlink sb show - display available shared buffers and their attributes](#devlink_sb_show_-_display_available_shared_buffers_and_their_attributes)

*DEV* - specifies the devlink device to show shared buffers. If this argument is omitted all shared buffers of all devices are listed.

*SB\_INDEX* - specifies the shared buffer. If this argument is omitted shared buffer with index 0 is selected. Behaviour of this argument it the same for every command.

## [devlink sb pool show - display available pools and their attributes](#devlink_sb_pool_show_-_display_available_pools_and_their_attributes)

*DEV* - specifies the devlink device to show pools. If this argument is omitted all pools of all devices are listed.

Display available pools listing their **type, size, thtype** and **cell\_size. cell\_size** is the allocation granularity of memory within the shared buffer. Drivers may round up, round down or reject **size** passed to the set command if it is not multiple of **cell\_size.**

## [devlink sb pool set - set attributes of pool](#devlink_sb_pool_set_-_set_attributes_of_pool)

*DEV* - specifies the devlink device to set pool.

[**size POOL\_SIZE**](#size)

size of the pool in Bytes.

[**thtype** { **static** | **dynamic** }](#thtype)

pool threshold type.

*static* - Threshold values for the pool will be passed in Bytes.

*dynamic* - Threshold values ("to\_alpha") for the pool will be used to compute alpha parameter according to formula:

alpha = 2 ^ (to\_alpha - 10)

The range of the passed value is between 0 to 20. The computed alpha is used to determine the maximum usage of the flow:

max\_usage = alpha / (1 + alpha) * Free\_Buffer

## [devlink sb port pool show - display port-pool combinations and threshold for each](#devlink_sb_port_pool_show_-_display_port-pool_combinations_and_threshold_for_each)

*DEV/PORT\_INDEX* - specifies the devlink port.

[**pool POOL\_INDEX**](#pool)

pool index.

## [devlink sb port pool set - set port-pool threshold](#devlink_sb_port_pool_set_-_set_port-pool_threshold)

*DEV/PORT\_INDEX* - specifies the devlink port.

[**pool POOL\_INDEX**](#pool~2)

pool index.

[**th THRESHOLD**](#th)

threshold value. Type of the value is either Bytes or "to\_alpha", depends on **thtype** set for the pool.

## [devlink sb tc bind show - display port-TC to pool bindings and threshold for each](#devlink_sb_tc_bind_show_-_display_port-TC_to_pool_bindings_and_threshold_for_each)

*DEV/PORT\_INDEX* - specifies the devlink port.

[**tc TC\_INDEX**](#tc)

index of either ingress or egress TC, usually in range 0 to 8 (depends on device).

[**type** { **ingress** | **egress** }](#type)

TC type.

## [devlink sb tc bind set - set port-TC to pool binding with specified threshold](#devlink_sb_tc_bind_set_-_set_port-TC_to_pool_binding_with_specified_threshold)

*DEV/PORT\_INDEX* - specifies the devlink port.

[**tc TC\_INDEX**](#tc~2)

index of either ingress or egress TC, usually in range 0 to 8 (depends on device).

[**type** { **ingress** | **egress** }](#type~2)

TC type.

[**pool POOL\_INDEX**](#pool~3)

index of pool to bind this to.

[**th THRESHOLD**](#th~2)

threshold value. Type of the value is either Bytes or "to\_alpha", depends on **thtype** set for the pool.

## [devlink sb occupancy show - display shared buffer occupancy values for device or port](#devlink_sb_occupancy_show_-_display_shared_buffer_occupancy_values_for_device_or_port)

This command is used to browse shared buffer occupancy values. Values are showed for every port-pool combination as well as for all port-TC combinations (with pool this port-TC is bound to). Format of value is:

current\_value/max\_value  
Note that before showing values, one has to issue **occupancy snapshot** command first.

*DEV* - specifies the devlink device to show occupancy values for.

*DEV/PORT\_INDEX* - specifies the devlink port to show occupancy values for.

## [devlink sb occupancy snapshot - take occupancy snapshot of shared buffer for device](#devlink_sb_occupancy_snapshot_-_take_occupancy_snapshot_of_shared_buffer_for_device)

This command is used to take a snapshot of shared buffer occupancy values. After that, the values can be showed using **occupancy show** command.

*DEV* - specifies the devlink device to take occupancy snapshot on.

## [devlink sb occupancy clearmax - clear occupancy watermarks of shared buffer for device](#devlink_sb_occupancy_clearmax_-_clear_occupancy_watermarks_of_shared_buffer_for_device)

This command is used to reset maximal occupancy values reached for whole device. Note that before browsing reset values, one has to issue **occupancy snapshot** command.

*DEV* - specifies the devlink device to clear occupancy watermarks on.

# [EXAMPLES](#EXAMPLES)

devlink sb show

List available share buffers.

devlink sb pool show

List available pools and their config.

devlink sb port pool show pci/0000:03:00.0/1 pool 0

Show port-pool setup for specified port and pool.

sudo devlink sb port pool set pci/0000:03:00.0/1 pool 0 th 15

Change threshold for port specified port and pool.

devlink sb tc bind show pci/0000:03:00.0/1 tc 0 type ingress

Show pool binding and threshold for specified port and TC.

sudo devlink sb tc bind set pci/0000:03:00.0/1 tc 0 type ingress pool 0 th 9

Set pool binding and threshold for specified port and TC.

sudo devlink sb occupancy snapshot pci/0000:03:00.0

Make a snapshot of occupancy of shared buffer for specified devlink device.

devlink sb occupancy show pci/0000:03:00.0/1

Show occupancy for specified port from the snapshot.

sudo devlink sb occupancy clearmax pci/0000:03:00.0

Clear watermarks for shared buffer of specified devlink device.

# [SEE ALSO](#SEE_ALSO)

[**devlink**(8)](/man/os/iproute2/devlink.8), [**devlink-dev**(8)](/man/os/iproute2/devlink-dev.8), [**devlink-port**(8)](/man/os/iproute2/devlink-port.8), [**devlink-monitor**(8)](/man/os/iproute2/devlink-monitor.8),

# [AUTHOR](#AUTHOR)

Jiri Pirko &lt;jiri@mellanox.com&gt;

14 Apr 2016 iproute2

---

Document: devlink-sb(8) from iproute2 7.3.0-r0 (Chainguard OS)
Source: https://kernel.googlesource.com/pub/scm/network/iproute2/iproute2
