Tune Linux DCB Port Buffers with dcb-buffer
You will inspect the Data Centre Bridging (DCB) buffer layout of a network port, then prepare a controlled priority-to-buffer and buffer-size change. The guide uses the dcb buffer subcommand from iproute2 6.1.0, installed on this system. Allow about 15 minutes for inspection and a further maintenance window for a live change.
The route
Jump straight to the step you need, or tick off Done means at the end.
- 1. Confirm the installed tool and target device
- 2. Read the complete current configuration
- 3. Inspect individual properties when troubleshooting
- 4. Plan a priority map without changing the port
- 5. Change the buffer sizes during a maintenance window
- 6. Apply a priority map only after checking the baseline
- 7. Separate tool errors from hardware limits
DCB buffer settings are driver and hardware dependent. You need a DCB-capable interface, the dcb utility, and enough privilege to alter its configuration. Reading may work as an ordinary user, but changing a port normally requires root or the equivalent network administration capability. Do not test the write examples on a production interface during active traffic: a wrong mapping or buffer budget can affect latency, loss and pause behaviour.
1. Confirm the installed tool and target device
Check the utility version and identify the interface you intend to inspect:
$ dcb -V
dcb utility, iproute2-6.1.0
$ ip -br link
PLACEHOLDER_IFACE UP ...
Replace PLACEHOLDER_IFACE below with the real interface name, such as eth0. Keep the placeholder in your notes until you have confirmed the device. The command is not a general Ethernet buffer viewer: a normal laptop adapter, the loopback device, or a driver without DCB support can reject the request.
Checkpoint: the name passed after dev must be the physical or virtual interface whose DCB configuration you mean to change. A bond, bridge and its member port can have different capabilities and settings.
2. Read the complete current configuration
Start with a read-only query:
$ dcb buffer show dev PLACEHOLDER_IFACE
prio-buffer 0:0 1:1 2:2 3:3 4:4 5:5 6:6 7:7
buffer-size 0:10Kb 1:10Kb 2:10Kb 3:10Kb 4:10Kb 5:10Kb 6:1Mb 7:10Kb
total-size 1222Kb
Your values will differ. With no property names, show reports the priority map, each buffer size and the total device memory used by port buffers. The displayed total can be larger than the sum of the visible buffers because the device may reserve internal buffers.
Save the output before changing anything:
$ dcb buffer show dev PLACEHOLDER_IFACE | tee dcb-buffer.before
If you see Attribute read: Operation not supported, stop here for this interface. That is a capability or driver boundary, not a reason to keep retrying with sudo. A successful read gives you a baseline, but it does not prove that every write requested by the driver will be accepted.
3. Inspect individual properties when troubleshooting
Use property names without values to narrow the query:
$ dcb buffer show dev PLACEHOLDER_IFACE prio-buffer
$ dcb buffer show dev PLACEHOLDER_IFACE buffer-size
$ dcb buffer show dev PLACEHOLDER_IFACE total-size
prio-buffer maps priorities 0 through 7 to buffer indices 0 through 7. buffer-size reports the sizes of those buffers. total-size is read-only. The command prints the current kernel and driver view, so use it after a change rather than relying only on the command's exit status.
4. Plan a priority map without changing the port
The array syntax is a sequence of KEY:VALUE pairs. For this object, the key is a traffic priority and the value is a buffer index:
# Review this complete mapping before applying it.
prio-buffer 0:0 1:1 2:2 3:3 4:4 5:5 6:6 7:7
The example is one-to-one. It is only a plan until it is included in a set command. You can set one priority, for example 3:2, or several. Unmentioned array elements retain their current values, so a partial command is not an implicit reset of the other priorities.
That retention rule is useful for a small adjustment but easy to miss during a hurried change. Write down the intended final map and compare it with the saved baseline before using a partial map. The special key all applies one buffer index to every priority, but it can make a mistake affect the whole port.
5. Change the buffer sizes during a maintenance window
Buffer sizes use buffer indices as keys and byte sizes as values. The tool accepts an integer or suffixes such as K and M:
# Root or equivalent network administration privilege is required.
$ sudo dcb buffer set dev PLACEHOLDER_IFACE buffer-size all:10K 6:1M
This requests 10K for every buffer, then overrides buffer 6 to 1M because later pairs take precedence. The driver may round or cap the request to hardware limits. It may also reject a combination that exceeds the device's available memory. Do not interpret the spelling of the request as proof that the device applied that exact size.
Before pressing Enter, check the interface name, the units and the exception. This is a live network configuration change. If the driver accepts it, verify immediately:
$ sudo dcb buffer show dev PLACEHOLDER_IFACE buffer-size total-size
buffer-size 0:10Kb 1:10Kb 2:10Kb 3:10Kb 4:10Kb 5:10Kb 6:1Mb 7:10Kb
total-size 1222Kb
The exact output depends on the driver. In particular, a reported 10Kb may reflect device rounding of a 10K request. Compare the actual result with the capacity and performance limits documented for the adapter.
6. Apply a priority map only after checking the baseline
When the planned mapping is approved, apply the complete map if you want an auditable final state:
$ sudo dcb buffer set dev PLACEHOLDER_IFACE prio-buffer 0:0 1:1 2:2 3:3 4:4 5:5 6:6 7:7
There is no separate transaction or rollback file in this command. Save the pre-change output, make one controlled change at a time, and verify after each one. If the command fails, capture its error and query the current state; do not assume that a failed request left every earlier setting untouched.
To undo the examples, restore the exact values recorded in dcb-buffer.before, translating its two property lines back into explicit set commands. For example, if the baseline contained the one-to-one map and the sizes shown earlier:
$ sudo dcb buffer set dev PLACEHOLDER_IFACE prio-buffer 0:0 1:1 2:2 3:3 4:4 5:5 6:6 7:7
$ sudo dcb buffer set dev PLACEHOLDER_IFACE buffer-size 0:10K 1:10K 2:10K 3:10K 4:10K 5:10K 6:1M 7:10K
$ sudo dcb buffer show dev PLACEHOLDER_IFACE
Do not use that restoration example unless those really are your saved baseline values. A reboot, link reset or driver reload may also restore a device-specific default, but that is not a reliable undo method and can disrupt service.
7. Separate tool errors from hardware limits
A zero exit status means the command succeeded; a positive status means failure. For a failed read, check the device name and DCB support. For a failed write, inspect the complete error, confirm the requested values are within the adapter's documented limits, and query the result with show. Increasing privilege will not solve a driver that does not expose the attribute.
Remember that a buffer configuration is only one part of DCB. Priority handling, Enhanced Transmission Selection and priority flow control can interact with it. Change related settings as a coordinated network design, not as isolated guesses based on a large number in total-size.
Done means
dcb -Videntified the installed iproute2 version and the target interface was confirmed.- The complete pre-change output is saved and the interface supports DCB buffer attributes.
- The priority map and buffer sizes were reviewed as
KEY:VALUEpairs before any write. - Every live change used the required privilege, was followed by
show, and was checked against the device's actual rounded or capped values. - The saved baseline provides an explicit recovery path, and no unsupported device was repeatedly modified.