Debian Codegraph @

upstream/debian-unstable/man8/dcb-rewr.8

raw
1 .TH DCB-REWR 8 "15 May 2023" "iproute2" "Linux"
2 .SH NAME
3 dcb-rewr \- show / manipulate the rewrite table of
4 the DCB (Data Center Bridging) subsystem
5 .SH SYNOPSIS
6 .sp
7 .ad l
8 .in +8
9
10 .ti -8
11 .B dcb
12 .RI "[ " OPTIONS " ] "
13 .B rewr
14 .RI "{ " COMMAND " | " help " }"
15 .sp
16
17 .ti -8
18 .B dcb rewr " { " show " | " flush " } " dev
19 .RI DEV
20 .RB "[ " prio-dscp " ]"
21 .RB "[ " prio-pcp " ]"
22
23 .ti -8
24 .B dcb rewr " { " add " | " del " | " replace " } " dev
25 .RI DEV
26 .RB "[ " prio-dscp " " \fIDSCP-MAP\fB " ]"
27 .RB "[ " prio-pcp " " \fIPCP-MAP\fB " ]"
28
29 .ti -8
30 .IR DSCP-MAP " := [ " DSCP-MAP " ] " DSCP-MAPPING
31
32 .ti -8
33 .IR DSCP-MAPPING " := " \fIPRIO \fB:\fR "{ " DSCP " | " \fBall\fR " }"
34
35 .ti -8
36 .IR PCP-MAP " := [ " PCP-MAP " ] " PCP-MAPPING
37
38 .ti -8
39 .IR PCP-MAPPING " := " \fIPRIO \fB:\fR PCP\fR
40
41 .ti -8
42 .IR DSCP " := { " \fB0\fR " .. " \fB63\fR " }"
43
44 .ti -8
45 .IR PCP " := { " \fB0(nd/de)\fR " .. " \fB7(nd/de)\fR " }"
46
47 .ti -8
48 .IR PRIO " := { " \fB0\fR " .. " \fB7\fR " }"
49
50 .SH DESCRIPTION
51
52 .B dcb rewr
53 is used to configure the rewrite table, in the DCB (Data Center Bridging)
54 subsystem. The rewrite table is used to rewrite certain values in the packet
55 headers, based on packet priority.
56
57 DCB rewrite entries are, like DCB APP entries, 3-tuples of selector, protocol
58 ID, and priority. Selector is an enumeration that picks one of the
59 prioritization namespaces. Currently, only the DSCP and PCP selector namespaces
60 are supported by dcb rewr.
61
62 The rewrite table is a list of DCB rewrite rules that applies to packets
63 with matching priority. Notably, it is valid to have conflicting rewrite
64 assignments for the same selector and priority. For example, the set of two
65 rewrite entries (DSCP, 10, 1) and (DSCP, 11, 1), where packets with priority 1
66 should have their DSCP values rewritten to both 10 and 11, form a well-defined
67 rewrite table.
68 .B dcb rewr
69 tool allows low-level management of the rewrite table by adding and deleting
70 individual rewrite 3-tuples through
71 .B add
72 and
73 .B del
74 commands. On the other hand, the command
75 .B replace
76 does what one would typically want in this situation--first adds the new
77 configuration, and then removes the obsolete one, so that only one
78 rewrite rule is in effect for a given selector and priority.
79
80 .SH COMMANDS
81
82 .TP
83 .B show
84 Displays all entries with a given selector. When no selector is given, shows all
85 rewrite table entries categorized per selector.
86
87 .TP
88 .B flush
89 Removes all entries with a given selector. When no selector is given, removes all
90 rewrite table entries.
91
92 .TP
93 .B add
94 .TQ
95 .B del
96 Add and, respectively, remove individual rewrite 3-tuples to and from the DCB
97 rewrite table.
98
99 .TP
100 .B replace
101 Takes the list of entries mentioned as parameter, and adds those that are not
102 present in the rewrite table yet. Then removes those entries, whose selector and
103 priority have been mentioned as parameter, but not with the exact same
104 protocol ID. This has the effect of, for the given selector and priority,
105 ensuring that the table only contains the protocol ID (or IDs) given as
106 parameter.
107
108 .SH PARAMETERS
109
110 The following table shows parameters in a way that they would be used with
111 \fBadd\fR, \fBdel\fR and \fBreplace\fR commands. For \fBshow\fR and
112 \fBflush\fR, the parameter name is to be used as a simple keyword without
113 further arguments.
114
115 .TP
116 .B prio-dscp \fIDSCP-MAP
117 \fIDSCP-MAP\fR uses the array parameter syntax, see
118 .BR dcb (8)
119 for details. Keys are priorities, values are DSCP points for traffic
120 with matching priority. DSCP points can be written either directly as numeric
121 values, or using symbolic names specified in
122 .B /etc/iproute2/rt_dsfield
123 (however note that the file specifies full 8-bit dsfield values, whereas
124 .B dcb rewr
125 will only use the higher six bits).
126 .B dcb rewr show
127 will similarly format DSCP values as symbolic names if possible. The
128 command line option
129 .B -N
130 turns the show translation off.
131
132 .TP
133 .B prio-pcp \fIPCP-MAP
134 \fIPCP-MAP\fR uses the array parameter syntax, see
135 .BR dcb (8)
136 for details. Keys are priorities. Values are PCP/DEI for traffic with
137 matching priority. PCP/DEI values are written as a combination of numeric and
138 symbolic values, to accommodate both. PCP is always in numeric form, e.g., 0 ..
139 7 and DEI in symbolic form, e.g., 'de' (drop-eligible), indicating that the DEI
140 bit is 1 or 'nd' (not-drop-eligible), indicating that the DEI bit is 0. In
141 combination 1:2de translates to a mapping of priority 1 to PCP=2 and DEI=1.
142
143 .SH EXAMPLE & USAGE
144
145 Add a rule to rewrite DSCP to 0, 24 and 48 for traffic with priority 0, 3 and
146 6, respectively:
147 .P
148 # dcb rewr add dev eth0 prio-dscp 0:0 3:24 6:48
149
150 Add a rule to rewrite DSCP to 25 for traffic with priority 3:
151 .P
152 # dcb rewr add dev eth0 prio-dscp 3:25
153 .br
154 # dcb rewr show dev eth0 prio-dscp
155 .br
156 prio-dscp 0:0 3:CS3 3:25 6:CS6
157 .br
158 # dcb -N rewr show dev eth0 prio-dscp
159 .br
160 prio-dscp 0:0 3:24 3:25 6:48
161
162 Reconfigure the table so that only one rule exists for rewriting traffic with
163 priority 3.
164
165 .P
166 # dcb rewr replace dev eth0 prio-dscp 3:26
167 .br
168 # dcb rewr -N show dev eth0 prio-dscp
169 .br
170 prio-dscp 0:0 3:26 6:48
171
172 Flush all DSCP rules:
173
174 .P
175 # dcb rewr flush dev eth0 prio-dscp
176 .br
177 # dcb rewr show dev eth0 prio-dscp
178 .br
179 (nothing)
180
181 Add a rule to rewrite PCP to 1 and DEI to 0 for traffic with priority 1 and a
182 rule to rewrite PCP to 2 and DEI to 1 for traffic with priority 2:
183
184 .P
185 # dcb rewr add dev eth0 prio-pcp 1:1nd 2:2de
186 .br
187 # dcb rewr show dev eth0 prio-pcp
188 .br
189 prio-pcp 1:1nd 2:2de
190
191 .SH EXIT STATUS
192 Exit status is 0 if command was successful or a positive integer upon failure.
193
194 .SH SEE ALSO
195 .BR dcb (8),
196 .BR dcb-app (8),
197 .BR dcb-apptrust (8)
198
199 .SH REPORTING BUGS
200 Report any bugs to the Network Developers mailing list
201 .B <[email protected]>
202 where the development and maintenance is primarily done. You do not have to be
203 subscribed to the list to send a message there.
204
205 .SH AUTHOR
206 Daniel Machon <[email protected]>