DCB-REWR(8)
๐
DCB-REWR โ the dcb-rewr(8) glow-up ๐
okay so bestie, this is the manual page for dcb-rewr(8) from the Linux section 8 of the manual, and it's literally all about showing and manipulating the rewrite table of the DCB (Data Center Bridging) subsystem. yes we're doing kernel networking today, drink some water, you've got this ๐ซถ
โจ NAME โจ
dcb-rewr โ show / manipulate the rewrite table of the DCB (Data Center Bridging) subsystem
๐ธ SYNOPSIS ๐ธ
dcb [ OPTIONS ] rewr { COMMAND | help }
dcb rewr { show | flush } dev DEV [ prio-dscp ] [ prio-pcp ]
dcb rewr { add | del | replace } dev DEV [ prio-dscp DSCP-MAP ]
[ prio-pcp PCP-MAP ]
DSCP-MAP := [ DSCP-MAP ] DSCP-MAPPING
DSCP-MAPPING := PRIO:{ DSCP | all }
PCP-MAP := [ PCP-MAP ] PCP-MAPPING
PCP-MAPPING := PRIO:PCP
DSCP := { 0 .. 63 }
PCP := { 0(nd/de) .. 7(nd/de) }
PRIO := { 0 .. 7 }
๐ DESCRIPTION ๐
dcb rewr is your girl for configuring the rewrite table, inside the DCB (Data Center Bridging) subsystem. and what does the rewrite table even do?? it rewrites certain values in the packet headers, based on packet priority. yes literally, it reaches into your packets and goes "this value? new value. periodt." ๐
DCB rewrite entries are, like DCB APP entries, 3-tuples of selector, protocol ID, and priority. the selector is an enumeration that picks one of the prioritization namespaces. currently, only the DSCP and PCP selector namespaces are supported by dcb rewr.
the rewrite table is a list of DCB rewrite rules that applies to packets with matching priority. and here's the juicy part: it is valid to have conflicting rewrite assignments for the same selector and priority. like, no cap. for example, the set of two rewrite entries (DSCP, 10, 1) and (DSCP, 11, 1), where packets with priority 1 should have their DSCP values rewritten to both 10 and 11, form a well-defined rewrite table. iconic, honestly. ๐ญ
the dcb rewr tool allows low-level management of the rewrite table by adding and deleting individual rewrite 3-tuples through add and del commands. on the other hand, the command replace does what one would typically want in this situation โ first adds the new configuration, and then removes the obsolete one, so that only one rewrite rule is in effect for a given selector and priority. she's organized, she's clean, she's the main character ๐
๐ฅ COMMANDS ๐ฅ
showโ displays all entries with a given selector. when no selector is given, it shows all rewrite table entries categorized per selector. the "show me everything" button โจflushโ removes all entries with a given selector. when no selector is given, it removes all rewrite table entries. gone. deleted. not me being dramatic, that's literally what it does ๐add,delโ add and, respectively, remove individual rewrite 3-tuples to and from the DCB rewrite table.replaceโ takes the list of entries mentioned as parameter, and adds those that are not present in the rewrite table yet. then removes those entries, whose selector and priority have been mentioned as parameter, but not with the exact same protocol ID. this has the effect of, for the given selector and priority, ensuring that the table only contains the protocol ID (or IDs) given as parameter. the "out with the old, in with the new" queen ๐
๐ฆ PARAMETERS ๐ฆ
the following table shows parameters in a way that they would be used with add, del and replace commands. for show and flush, the parameter name is to be used as a simple keyword without further arguments. iykyk ๐
prio-dscp DSCP-MAPโDSCP-MAPuses the array parameter syntax, seedcb(8)for details. keys are priorities, values are DSCP points for traffic with matching priority. DSCP points can be written either directly as numeric values, or using symbolic names specified in/etc/iproute2/rt_dsfield(however note that the file specifies full 8-bit dsfield values, whereasdcb rewrwill only use the higher six bits).dcb rewr showwill similarly format DSCP values as symbolic names if possible. the command line option-Nturns the show translation off. ๐prio-pcp PCP-MAPโPCP-MAPuses the array parameter syntax, seedcb(8)for details. keys are priorities. values are PCP/DEI for traffic with matching priority. PCP/DEI values are written as a combination of numeric and symbolic values, to accommodate both. PCP is always in numeric form, e.g.,0 .. 7and DEI in symbolic form, e.g.,'de'(drop-eligible), indicating that the DEI bit is1or'nd'(not-drop-eligible), indicating that the DEI bit is0. in combination1:2detranslates to a mapping of priority 1 to PCP=2 and DEI=1. the way thatde/ndthing just works ๐
๐ EXAMPLE & USAGE ๐
add a rule to rewrite DSCP to 0, 24 and 48 for traffic with priority 0, 3 and 6, respectively:
# dcb rewr add dev eth0 prio-dscp 0:0 3:24 6:48
add a rule to rewrite DSCP to 25 for traffic with priority 3:
# dcb rewr add dev eth0 prio-dscp 3:25
# dcb rewr show dev eth0 prio-dscp
prio-dscp 0:0 3:CS3 3:25 6:CS6
# dcb -N rewr show dev eth0 prio-dscp
prio-dscp 0:0 3:24 3:25 6:48
reconfigure the table so that only one rule exists for rewriting traffic with priority 3.
# dcb rewr replace dev eth0 prio-dscp 3:26
# dcb rewr -N show dev eth0 prio-dscp
prio-dscp 0:0 3:26 6:48
flush all DSCP rules:
# dcb rewr flush dev eth0 prio-dscp
# dcb rewr show dev eth0 prio-dscp
(nothing)
add a rule to rewrite PCP to 1 and DEI to 0 for traffic with priority 1 and a rule to rewrite PCP to 2 and DEI to 1 for traffic with priority 2:
# dcb rewr add dev eth0 prio-pcp 1:1nd 2:2de
# dcb rewr show dev eth0 prio-pcp
prio-pcp 1:1nd 2:2de
โญ EXIT STATUS โญ
exit status is 0 if command was successful or a positive integer upon failure. zero means slay, anything else means we're investigating ๐
๐ SEE ALSO ๐
dcb(8), dcb-app(8), dcb-apptrust(8) โ go read those next bestie, the lore is deep ๐
๐ญ REPORTING BUGS ๐ญ
report any bugs to the Network Developers mailing list <netdev@vger.kernel.org> where the development and maintenance is primarily done. you do not have to be subscribed to the list to send a message there. so like, don't be shy, they're nice ๐
๐ AUTHOR ๐
Daniel Machon <daniel.machon@microchip.com>
and that's the whole page, bestie!! this was iproute2, dated 15 May 2023, and it lives at DCB-REWR(8) in the manual. mwah, go rewrite some packet headers responsibly ๐
โจ
๐ฆ where this page comes from
- alpine 3.24: iproute2-doc 7.0.0-r0 ยท GPL-2.0-or-later
- arch rolling: iproute2 7.2.0-1
- arch rolling: iproute2 7.3.0-1 ยท GPL-2.0-or-later
- centos-stream 10: iproute 7.0.0-2.el10 ยท GPL-2.0-or-later AND NIST-PD
- nixos 26.05: iproute2 7.0.0
- nixpkgs unstable: iproute2 7.2.0
- ubuntu stonking: iproute2 7.2.0-1ubuntu1 ยท GPL-2.0-only
- ๐ girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms