Merge remote-tracking branch 'main/main' into next

Signed-off-by: David Ahern <dsahern@kernel.org>
This commit is contained in:
David Ahern 2024-08-19 01:07:16 +00:00
commit 968570dfce
5 changed files with 270 additions and 199 deletions

6
configure vendored
View File

@ -315,6 +315,12 @@ check_libbpf()
echo "HAVE_LIBBPF:=y" >> $CONFIG echo "HAVE_LIBBPF:=y" >> $CONFIG
echo 'CFLAGS += -DHAVE_LIBBPF ' $LIBBPF_CFLAGS >> $CONFIG echo 'CFLAGS += -DHAVE_LIBBPF ' $LIBBPF_CFLAGS >> $CONFIG
echo "CFLAGS += -DLIBBPF_VERSION=\\\"$LIBBPF_VERSION\\\"" >> $CONFIG echo "CFLAGS += -DLIBBPF_VERSION=\\\"$LIBBPF_VERSION\\\"" >> $CONFIG
LIBBPF_MAJOR=$(IFS="."; set $LIBBPF_VERSION; echo $1)
LIBBPF_MINOR=$(IFS="."; set $LIBBPF_VERSION; echo $2)
if [ "$LIBBPF_MAJOR" -eq 0 -a "$LIBBPF_MINOR" -lt 7 ]; then
# Newer libbpf versions provide these defines in the bpf/libbpf_version.h header.
echo "CFLAGS += -DLIBBPF_MAJOR_VERSION=$LIBBPF_MAJOR -DLIBBPF_MINOR_VERSION=$LIBBPF_MINOR" >> $CONFIG
fi
echo 'LDLIBS += ' $LIBBPF_LDLIBS >> $CONFIG echo 'LDLIBS += ' $LIBBPF_LDLIBS >> $CONFIG
if [ -z "$LIBBPF_DIR" ]; then if [ -z "$LIBBPF_DIR" ]; then

View File

@ -71,7 +71,7 @@ ip-xfrm \- transform configuration
.RB "[ " offload .RB "[ " offload
.RB "[ " crypto | packet " ]" .RB "[ " crypto | packet " ]"
.RB dev .RB dev
.IR DEV " .I DEV
.RB dir .RB dir
.IR DIR " ]" .IR DIR " ]"
.RB "[ " tfcpad .RB "[ " tfcpad

View File

@ -146,22 +146,23 @@ CAKE uses a deficit-mode shaper, which does not exhibit the initial burst
typical of token-bucket shapers. It will automatically burst precisely as much typical of token-bucket shapers. It will automatically burst precisely as much
as required to maintain the configured throughput. As such, it is very as required to maintain the configured throughput. As such, it is very
straightforward to configure. straightforward to configure.
.PP
.B unlimited .TP
(default) \fBunlimited\fR (default)
.br .br
No limit on the bandwidth. No limit on the bandwidth.
.PP
.B bandwidth .TP
RATE \fBbandwidth\fR RATE
.br .br
Set the shaper bandwidth. See Set the shaper bandwidth. See
.BR tc(8) .BR tc(8)
or examples below for details of the RATE value. or examples below for details of the RATE value.
.PP
.TP
.B autorate-ingress .B autorate-ingress
.br .br
Automatic capacity estimation based on traffic arriving at this qdisc. Automatic capacity estimation based on traffic arriving at this qdisc.
This is most likely to be useful with cellular links, which tend to change This is most likely to be useful with cellular links, which tend to change
quality randomly. A quality randomly. A
.B bandwidth .B bandwidth
@ -177,58 +178,61 @@ are not expert network engineers, keywords have been provided to represent a
number of common link technologies. number of common link technologies.
.SS Manual Overhead Specification .SS Manual Overhead Specification
.B overhead .TP
BYTES \fBoverhead\fR BYTES
.br .br
Adds BYTES to the size of each packet. BYTES may be negative; values Adds BYTES to the size of each packet. BYTES may be negative; values
between -64 and 256 (inclusive) are accepted. between -64 and 256 (inclusive) are accepted.
.PP
.B mpu .TP
BYTES \fBmpu\fR BYTES
.br .br
Rounds each packet (including overhead) up to a minimum length Rounds each packet (including overhead) up to a minimum length
BYTES. BYTES may not be negative; values between 0 and 256 (inclusive) BYTES. BYTES may not be negative; values between 0 and 256 (inclusive)
are accepted. are accepted.
.PP
.TP
.B atm .B atm
.br .br
Compensates for ATM cell framing, which is normally found on ADSL links. Compensates for ATM cell framing, which is normally found on ADSL links.
This is performed after the This is performed after the
.B overhead .B overhead
parameter above. ATM uses fixed 53-byte cells, each of which can carry 48 bytes parameter above. ATM uses fixed 53-byte cells, each of which can carry 48 bytes
payload. payload.
.PP
.TP
.B ptm .B ptm
.br .br
Compensates for PTM encoding, which is normally found on VDSL2 links and Compensates for PTM encoding, which is normally found on VDSL2 links and
uses a 64b/65b encoding scheme. It is even more efficient to simply uses a 64b/65b encoding scheme. It is even more efficient to simply
derate the specified shaper bandwidth by a factor of 64/65 or 0.984. See derate the specified shaper bandwidth by a factor of 64/65 or 0.984. See
ITU G.992.3 Annex N and IEEE 802.3 Section 61.3 for details. ITU G.992.3 Annex N and IEEE 802.3 Section 61.3 for details.
.PP
.TP
.B noatm .B noatm
.br .br
Disables ATM and PTM compensation. Disables ATM and PTM compensation.
.SS Failsafe Overhead Keywords .SS Failsafe Overhead Keywords
These two keywords are provided for quick-and-dirty setup. Use them if you These two keywords are provided for quick-and-dirty setup. Use them if you
can't be bothered to read the rest of this section. can't be bothered to read the rest of this section.
.PP
.B raw .TP
(default) \fBraw\fR (default)
.br .br
Turns off all overhead compensation in CAKE. The packet size reported Turns off all overhead compensation in CAKE. The packet size reported
by Linux will be used directly. by Linux will be used directly.
.PP
Other overhead keywords may be added after "raw". The effect of this is Other overhead keywords may be added after "raw". The effect of this is
to make the overhead compensation operate relative to the reported packet size, to make the overhead compensation operate relative to the reported packet size,
not the underlying IP packet size. not the underlying IP packet size.
.PP
.TP
.B conservative .B conservative
.br .br
Compensates for more overhead than is likely to occur on any Compensates for more overhead than is likely to occur on any
widely-deployed link technology. widely-deployed link technology.
.br Equivalent to
Equivalent to
.B overhead 48 atm. .B overhead 48 atm.
.SS ADSL Overhead Keywords .SS ADSL Overhead Keywords
@ -238,77 +242,86 @@ this section are intended to correspond with these sources of information. All
of them implicitly set the of them implicitly set the
.B atm .B atm
flag. flag.
.PP
.TP
.B pppoa-vcmux .B pppoa-vcmux
.br .br
Equivalent to Equivalent to
.B overhead 10 atm .B overhead 10 atm
.PP
.TP
.B pppoa-llc .B pppoa-llc
.br .br
Equivalent to Equivalent to
.B overhead 14 atm .B overhead 14 atm
.PP
.TP
.B pppoe-vcmux .B pppoe-vcmux
.br .br
Equivalent to Equivalent to
.B overhead 32 atm .B overhead 32 atm
.PP
.TP
.B pppoe-llcsnap .B pppoe-llcsnap
.br .br
Equivalent to Equivalent to
.B overhead 40 atm .B overhead 40 atm
.PP
.TP
.B bridged-vcmux .B bridged-vcmux
.br .br
Equivalent to Equivalent to
.B overhead 24 atm .B overhead 24 atm
.PP
.TP
.B bridged-llcsnap .B bridged-llcsnap
.br .br
Equivalent to Equivalent to
.B overhead 32 atm .B overhead 32 atm
.PP
.TP
.B ipoa-vcmux .B ipoa-vcmux
.br .br
Equivalent to Equivalent to
.B overhead 8 atm .B overhead 8 atm
.PP
.TP
.B ipoa-llcsnap .B ipoa-llcsnap
.br .br
Equivalent to Equivalent to
.B overhead 16 atm .B overhead 16 atm
.PP
.P
See also the Ethernet Correction Factors section below. See also the Ethernet Correction Factors section below.
.SS VDSL2 Overhead Keywords .SS VDSL2 Overhead Keywords
ATM was dropped from VDSL2 in favour of PTM, which is a much more ATM was dropped from VDSL2 in favour of PTM, which is a much more
straightforward framing scheme. Some ISPs retained PPPoE for compatibility with straightforward framing scheme. Some ISPs retained PPPoE for compatibility with
their existing back-end systems. their existing back-end systems.
.PP
.TP
.B pppoe-ptm .B pppoe-ptm
.br .br
Equivalent to Equivalent to
.B overhead 30 ptm .B overhead 30 ptm
PPPoE: 2B PPP + 6B PPPoE +
.br .br
PPPoE: 2B PPP + 6B PPPoE + ETHERNET: 6B dest MAC + 6B src MAC + 2B ethertype + 4B Frame Check Sequence +
.br .br
ETHERNET: 6B dest MAC + 6B src MAC + 2B ethertype + 4B Frame Check Sequence + PTM: 1B Start of Frame (S) + 1B End of Frame (Ck) + 2B TC-CRC (PTM-FCS)
.br
PTM: 1B Start of Frame (S) + 1B End of Frame (Ck) + 2B TC-CRC (PTM-FCS) .TP
.br
.PP
.B bridged-ptm .B bridged-ptm
.br .br
Equivalent to Equivalent to
.B overhead 22 ptm .B overhead 22 ptm
ETHERNET: 6B dest MAC + 6B src MAC + 2B ethertype + 4B Frame Check Sequence +
.br .br
ETHERNET: 6B dest MAC + 6B src MAC + 2B ethertype + 4B Frame Check Sequence + PTM: 1B Start of Frame (S) + 1B End of Frame (Ck) + 2B TC-CRC (PTM-FCS)
.br
PTM: 1B Start of Frame (S) + 1B End of Frame (Ck) + 2B TC-CRC (PTM-FCS) .P
.br
.PP
See also the Ethernet Correction Factors section below. See also the Ethernet Correction Factors section below.
.SS DOCSIS Cable Overhead Keyword .SS DOCSIS Cable Overhead Keyword
@ -318,26 +331,28 @@ infrastructure.
In this case, the actual on-wire overhead is less important than the packet size In this case, the actual on-wire overhead is less important than the packet size
the head-end equipment uses for shaping and metering. This is specified to be the head-end equipment uses for shaping and metering. This is specified to be
an Ethernet frame including the CRC (aka FCS). an Ethernet frame including the CRC (aka FCS).
.PP
.TP
.B docsis .B docsis
.br .br
Equivalent to Equivalent to
.B overhead 18 mpu 64 noatm .B overhead 18 mpu 64 noatm
.SS Ethernet Overhead Keywords .SS Ethernet Overhead Keywords
.PP
.TP
.B ethernet .B ethernet
.br .br
Accounts for Ethernet's preamble, inter-frame gap, and Frame Check Accounts for Ethernet's preamble, inter-frame gap, and Frame Check
Sequence. Use this keyword when the bottleneck being shaped for is an Sequence. Use this keyword when the bottleneck being shaped for is an
actual Ethernet cable. actual Ethernet cable.
.br Equivalent to
Equivalent to
.B overhead 38 mpu 84 noatm .B overhead 38 mpu 84 noatm
.PP
.TP
.B ether-vlan .B ether-vlan
.br .br
Adds 4 bytes to the overhead compensation, accounting for an IEEE 802.1Q Adds 4 bytes to the overhead compensation, accounting for an IEEE 802.1Q
VLAN header appended to the Ethernet frame header. NB: Some ISPs use one or VLAN header appended to the Ethernet frame header. NB: Some ISPs use one or
even two of these within PPPoE; this keyword may be repeated as necessary to even two of these within PPPoE; this keyword may be repeated as necessary to
express this. express this.
@ -360,54 +375,77 @@ the jitter in the Linux kernel itself, so congestion might be signalled
prematurely. The flows will then become sparse and total throughput reduced, prematurely. The flows will then become sparse and total throughput reduced,
leaving little or no back-pressure for the fairness logic to work against. Use leaving little or no back-pressure for the fairness logic to work against. Use
the "metro" setting for local lans unless you have a custom kernel. the "metro" setting for local lans unless you have a custom kernel.
.PP
.B rtt .TP
TIME \fBrtt\fR TIME
.br .br
Manually specify an RTT. Manually specify an RTT.
.PP
.TP
.B datacentre .B datacentre
.br .br
For extremely high-performance 10GigE+ networks only. Equivalent to For extremely high-performance 10GigE+ networks only.
.br
Equivalent to
.B rtt 100us. .B rtt 100us.
.PP
.TP
.B lan .B lan
.br .br
For pure Ethernet (not Wi-Fi) networks, at home or in the office. Don't For pure Ethernet (not Wi-Fi) networks, at home or in the office. Don't
use this when shaping for an Internet access link. Equivalent to use this when shaping for an Internet access link.
.br
Equivalent to
.B rtt 1ms. .B rtt 1ms.
.PP
.TP
.B metro .B metro
.br .br
For traffic mostly within a single city. Equivalent to For traffic mostly within a single city.
.br
Equivalent to
.B rtt 10ms. .B rtt 10ms.
.PP
.TP
.B regional .B regional
.br .br
For traffic mostly within a European-sized country. Equivalent to For traffic mostly within a European-sized country.
.B rtt 30ms.
.PP
.B internet
(default)
.br .br
This is suitable for most Internet traffic. Equivalent to Equivalent to
.B rtt 30ms.
.TP
\fBinternet\fR (default)
.br
This is suitable for most Internet traffic.
.br
Equivalent to
.B rtt 100ms. .B rtt 100ms.
.PP
.TP
.B oceanic .B oceanic
.br .br
For Internet traffic with generally above-average latency, such as that For Internet traffic with generally above-average latency, such as that
suffered by Australasian residents. Equivalent to suffered by Australasian residents.
.br
Equivalent to
.B rtt 300ms. .B rtt 300ms.
.PP
.TP
.B satellite .B satellite
.br .br
For traffic via geostationary satellites. Equivalent to For traffic via geostationary satellites.
.br
Equivalent to
.B rtt 1000ms. .B rtt 1000ms.
.PP
.TP
.B interplanetary .B interplanetary
.br .br
So named because Jupiter is about 1 light-hour from Earth. Use this to So named because Jupiter is about 1 light-hour from Earth. Use this to
(almost) completely disable AQM actions. Equivalent to (almost) completely disable AQM actions.
.br
Equivalent to
.B rtt 3600s. .B rtt 3600s.
.SH FLOW ISOLATION PARAMETERS .SH FLOW ISOLATION PARAMETERS
@ -419,68 +457,76 @@ minimize flow collisions.
These keywords specify whether fairness based on source address, destination These keywords specify whether fairness based on source address, destination
address, individual flows, or any combination of those is desired. address, individual flows, or any combination of those is desired.
.PP
.TP
.B flowblind .B flowblind
.br .br
Disables flow isolation; all traffic passes through a single queue for Disables flow isolation; all traffic passes through a single queue for
each tin. each tin.
.PP
.TP
.B srchost .B srchost
.br .br
Flows are defined only by source address. Could be useful on the egress Flows are defined only by source address. Could be useful on the egress
path of an ISP backhaul. path of an ISP backhaul.
.PP
.TP
.B dsthost .B dsthost
.br .br
Flows are defined only by destination address. Could be useful on the Flows are defined only by destination address. Could be useful on the
ingress path of an ISP backhaul. ingress path of an ISP backhaul.
.PP
.TP
.B hosts .B hosts
.br .br
Flows are defined by source-destination host pairs. This is host Flows are defined by source-destination host pairs. This is host
isolation, rather than flow isolation. isolation, rather than flow isolation.
.PP
.TP
.B flows .B flows
.br .br
Flows are defined by the entire 5-tuple of source address, destination Flows are defined by the entire 5-tuple of source address, destination
address, transport protocol, source port and destination port. This is the type address, transport protocol, source port and destination port. This is the type
of flow isolation performed by SFQ and fq_codel. of flow isolation performed by SFQ and fq_codel.
.PP
.TP
.B dual-srchost .B dual-srchost
.br .br
Flows are defined by the 5-tuple, and fairness is applied first over Flows are defined by the 5-tuple, and fairness is applied first over
source addresses, then over individual flows. Good for use on egress traffic source addresses, then over individual flows. Good for use on egress traffic
from a LAN to the internet, where it'll prevent any one LAN host from from a LAN to the internet, where it'll prevent any one LAN host from
monopolising the uplink, regardless of the number of flows they use. monopolising the uplink, regardless of the number of flows they use.
.PP
.TP
.B dual-dsthost .B dual-dsthost
.br .br
Flows are defined by the 5-tuple, and fairness is applied first over Flows are defined by the 5-tuple, and fairness is applied first over
destination addresses, then over individual flows. Good for use on ingress destination addresses, then over individual flows. Good for use on ingress
traffic to a LAN from the internet, where it'll prevent any one LAN host from traffic to a LAN from the internet, where it'll prevent any one LAN host from
monopolising the downlink, regardless of the number of flows they use. monopolising the downlink, regardless of the number of flows they use.
.PP
.B triple-isolate .TP
(default) \fBtriple-isolate\fR (default)
.br .br
Flows are defined by the 5-tuple, and fairness is applied over source Flows are defined by the 5-tuple, and fairness is applied over source
*and* destination addresses intelligently (ie. not merely by host-pairs), and *and* destination addresses intelligently (ie. not merely by host-pairs), and
also over individual flows. Use this if you're not certain whether to use also over individual flows. Use this if you're not certain whether to use
dual-srchost or dual-dsthost; it'll do both jobs at once, preventing any one dual-srchost or dual-dsthost; it'll do both jobs at once, preventing any one
host on *either* side of the link from monopolising it with a large number of host on *either* side of the link from monopolising it with a large number of
flows. flows.
.PP
.TP
.B nat .B nat
.br .br
Instructs Cake to perform a NAT lookup before applying flow-isolation Instructs Cake to perform a NAT lookup before applying flow-isolation
rules, to determine the true addresses and port numbers of the packet, to rules, to determine the true addresses and port numbers of the packet, to
improve fairness between hosts "inside" the NAT. This has no practical effect improve fairness between hosts "inside" the NAT. This has no practical effect
in "flowblind" or "flows" modes, or if NAT is performed on a different host. in "flowblind" or "flows" modes, or if NAT is performed on a different host.
.PP
.B nonat .TP
(default) \fBnonat\fR (default)
.br .br
Cake will not perform a NAT lookup. Flow isolation will be performed Cake will not perform a NAT lookup. Flow isolation will be performed
using the addresses and port numbers directly visible to the interface Cake is using the addresses and port numbers directly visible to the interface Cake is
attached to. attached to.
@ -495,44 +541,46 @@ the threshold using the same algorithm as the deficit-mode shaper.
Detailed customisation of tin parameters is not provided. The following presets Detailed customisation of tin parameters is not provided. The following presets
perform all necessary tuning, relative to the current shaper bandwidth and RTT perform all necessary tuning, relative to the current shaper bandwidth and RTT
settings. settings.
.PP
.TP
.B besteffort .B besteffort
.br .br
Disables priority queuing by placing all traffic in one tin. Disables priority queuing by placing all traffic in one tin.
.PP
.TP
.B precedence .B precedence
.br .br
Enables legacy interpretation of TOS "Precedence" field. Use of this Enables legacy interpretation of TOS "Precedence" field. Use of this
preset on the modern Internet is firmly discouraged. preset on the modern Internet is firmly discouraged.
.PP
.TP
.B diffserv4 .B diffserv4
.br .br
Provides a general-purpose Diffserv implementation with four tins: Provides a general-purpose Diffserv implementation with four tins:
.br
Bulk (CS1, LE in kernel v5.9+), 6.25% threshold, generally low priority.
.br
Best Effort (general), 100% threshold.
.br
Video (AF4x, AF3x, CS3, AF2x, CS2, TOS4, TOS1), 50% threshold.
.br
Voice (CS7, CS6, EF, VA, CS5, CS4), 25% threshold.
.PP
.B diffserv3
(default)
.br
Provides a simple, general-purpose Diffserv implementation with three tins:
.br
Bulk (CS1, LE in kernel v5.9+), 6.25% threshold, generally low priority.
.br
Best Effort (general), 100% threshold.
.br
Voice (CS7, CS6, EF, VA, TOS4), 25% threshold, reduced Codel interval.
.PP \(bu Bulk (CS1, LE in kernel v5.9+), 6.25% threshold, generally low priority.
.B fwmark
MASK
.br .br
This options turns on fwmark-based overriding of CAKE's tin selection. \(bu Best Effort (general), 100% threshold.
.br
\(bu Video (AF4x, AF3x, CS3, AF2x, CS2, TOS4, TOS1), 50% threshold.
.br
\(bu Voice (CS7, CS6, EF, VA, CS5, CS4), 25% threshold.
.TP
\fBdiffserv3\fR (default)
.br
Provides a simple, general-purpose Diffserv implementation with three tins:
\(bu Bulk (CS1, LE in kernel v5.9+), 6.25% threshold, generally low priority.
.br
\(bu Best Effort (general), 100% threshold.
.br
\(bu Voice (CS7, CS6, EF, VA, TOS4), 25% threshold, reduced Codel interval.
.TP
\fBfwmark\fR MASK
.br
This options turns on fwmark-based overriding of CAKE's tin selection.
If set, the option specifies a bitmask that will be applied to the fwmark If set, the option specifies a bitmask that will be applied to the fwmark
associated with each packet. If the result of this masking is non-zero, the associated with each packet. If the result of this masking is non-zero, the
result will be right-shifted by the number of least-significant unset bits in result will be right-shifted by the number of least-significant unset bits in
@ -541,23 +589,38 @@ This can be used to set policies in a firewall script that will override CAKE's
built-in tin selection. built-in tin selection.
.SH OTHER PARAMETERS .SH OTHER PARAMETERS
.B memlimit
LIMIT .TP
.B ingress
.br .br
Limit the memory consumed by Cake to LIMIT bytes. Note that this does Indicates that CAKE is running in ingress mode (i.e. running on the downlink of
a connection). This changes the shaper to also count dropped packets as data
transferred, as these will have already traversed the link before CAKE can
choose what to do with them.
In addition, the AQM will be tuned to always keep at least two packets
queued per flow. The reason for this is that retransmits are more expensive in
ingress mode, since dropped packets have to traverse the link again; thus,
keeping a minimum number of packets queued will improve throughput in cases
where the number of active flows are so large that they saturate the link even
at their minimum window size.
.TP
\fBmemlimit\fR LIMIT
.br
Limit the memory consumed by Cake to LIMIT bytes. Note that this does
not translate directly to queue size (so do not size this based on bandwidth not translate directly to queue size (so do not size this based on bandwidth
delay product considerations, but rather on worst case acceptable memory delay product considerations, but rather on worst case acceptable memory
consumption), as there is some overhead in the data structures containing the consumption), as there is some overhead in the data structures containing the
packets, especially for small packets. packets, especially for small packets.
By default, the limit is calculated based on the bandwidth and RTT By default, the limit is calculated based on the bandwidth and RTT
settings. settings.
.PP .TP
.B wash .B wash
.br .br
Traffic entering your diffserv domain is frequently mis-marked in Traffic entering your diffserv domain is frequently mis-marked in
transit from the perspective of your network, and traffic exiting yours may be transit from the perspective of your network, and traffic exiting yours may be
mis-marked from the perspective of the transiting provider. mis-marked from the perspective of the transiting provider.
@ -568,15 +631,13 @@ If you are shaping inbound, and cannot trust the diffserv markings (as is the
case for Comcast Cable, among others), it is best to use a single queue case for Comcast Cable, among others), it is best to use a single queue
"besteffort" mode with wash. "besteffort" mode with wash.
.PP .TP
.B split-gso .B split-gso
.br .br
This option controls whether CAKE will split General Segmentation This option controls whether CAKE will split General Segmentation
Offload (GSO) super-packets into their on-the-wire components and Offload (GSO) super-packets into their on-the-wire components and
dequeue them individually. dequeue them individually.
.br
Super-packets are created by the networking stack to improve efficiency. Super-packets are created by the networking stack to improve efficiency.
However, because they are larger they take longer to dequeue, which However, because they are larger they take longer to dequeue, which
translates to higher latency for competing flows, especially at lower translates to higher latency for competing flows, especially at lower
@ -595,25 +656,22 @@ field on the skb, and the flow hashing can be overridden by setting the
.B classid .B classid
parameter. parameter.
.PP .SS Tin override
.B Tin override To assign a priority tin, the major number of the priority field needs
.br
To assign a priority tin, the major number of the priority field needs
to match the qdisc handle of the cake instance; if it does, the minor number to match the qdisc handle of the cake instance; if it does, the minor number
will be interpreted as the tin index. For example, to classify all ICMP packets will be interpreted as the tin index. For example, to classify all ICMP packets
as 'bulk', the following filter can be used: as 'bulk', the following filter can be used:
.br .RS
# tc qdisc replace dev eth0 handle 1: root cake diffserv3 .EX
# tc filter add dev eth0 parent 1: protocol ip prio 1 \\ # tc qdisc replace dev eth0 handle 1: root cake diffserv3
u32 match icmp type 0 0 action skbedit priority 1:1 # tc filter add dev eth0 parent 1: protocol ip prio 1 \\
u32 match icmp type 0 0 action skbedit priority 1:1
.EE
.RE
.PP .SS Flow hash override
.B Flow hash override To override flow hashing, the classid can be set. CAKE will interpret
.br
To override flow hashing, the classid can be set. CAKE will interpret
the major number of the classid as the host hash used in host isolation mode, the major number of the classid as the host hash used in host isolation mode,
and the minor number as the flow hash used for flow-based queueing. One or both and the minor number as the flow hash used for flow-based queueing. One or both
of those can be set, and will be used if the relevant flow isolation parameter of those can be set, and will be used if the relevant flow isolation parameter
@ -621,15 +679,16 @@ is set (i.e., the major number will be ignored if CAKE is not configured in
hosts mode, and the minor number will be ignored if CAKE is not configured in hosts mode, and the minor number will be ignored if CAKE is not configured in
flows mode). flows mode).
.br
This example will assign all ICMP packets to the first queue: This example will assign all ICMP packets to the first queue:
.br .RS
# tc qdisc replace dev eth0 handle 1: root cake .EX
# tc filter add dev eth0 parent 1: protocol ip prio 1 \\ # tc qdisc replace dev eth0 handle 1: root cake
u32 match icmp type 0 0 classid 0:1 # tc filter add dev eth0 parent 1: protocol ip prio 1 \\
u32 match icmp type 0 0 classid 0:1
.EE
.RE
.br
If only one of the host and flow overrides is set, CAKE will compute the other If only one of the host and flow overrides is set, CAKE will compute the other
hash from the packet as normal. Note, however, that the host isolation mode hash from the packet as normal. Note, however, that the host isolation mode
works by assigning a host ID to the flow queue; so if overriding both host and works by assigning a host ID to the flow queue; so if overriding both host and
@ -641,12 +700,11 @@ destination host.
.SH EXAMPLES .SH EXAMPLES
.EX
# tc qdisc delete root dev eth0 # tc qdisc delete root dev eth0
.br
# tc qdisc add root dev eth0 cake bandwidth 100Mbit ethernet # tc qdisc add root dev eth0 cake bandwidth 100Mbit ethernet
.br
# tc -s qdisc show dev eth0 # tc -s qdisc show dev eth0
.br
qdisc cake 1: root refcnt 2 bandwidth 100Mbit diffserv3 triple-isolate rtt 100.0ms noatm overhead 38 mpu 84 qdisc cake 1: root refcnt 2 bandwidth 100Mbit diffserv3 triple-isolate rtt 100.0ms noatm overhead 38 mpu 84
Sent 0 bytes 0 pkt (dropped 0, overlimits 0 requeues 0) Sent 0 bytes 0 pkt (dropped 0, overlimits 0 requeues 0)
backlog 0b 0p requeues 0 backlog 0b 0p requeues 0
@ -676,9 +734,10 @@ qdisc cake 1: root refcnt 2 bandwidth 100Mbit diffserv3 triple-isolate rtt 100.0
un_flows 0 0 0 un_flows 0 0 0
max_len 0 0 0 max_len 0 0 0
quantum 300 1514 762 quantum 300 1514 762
.EE
After some use: .SS After some use:
.br .EX
# tc -s qdisc show dev eth0 # tc -s qdisc show dev eth0
qdisc cake 1: root refcnt 2 bandwidth 100Mbit diffserv3 triple-isolate rtt 100.0ms noatm overhead 38 mpu 84 qdisc cake 1: root refcnt 2 bandwidth 100Mbit diffserv3 triple-isolate rtt 100.0ms noatm overhead 38 mpu 84
@ -710,6 +769,7 @@ qdisc cake 1: root refcnt 2 bandwidth 100Mbit diffserv3 triple-isolate rtt 100.0
un_flows 0 0 0 un_flows 0 0 0
max_len 1514 1514 1514 max_len 1514 1514 1514
quantum 300 1514 762 quantum 300 1514 762
.EE
.SH SEE ALSO .SH SEE ALSO
.BR tc (8), .BR tc (8),

View File

@ -22,12 +22,17 @@ CoDel (pronounced "coddle") is an adaptive "no-knobs" active queue management
algorithm (AQM) scheme that was developed to address the shortcomings of algorithm (AQM) scheme that was developed to address the shortcomings of
RED and its variants. It was developed with the following goals RED and its variants. It was developed with the following goals
in mind: in mind:
o It should be parameterless. .IP * 4
o It should keep delays low while permitting bursts of traffic. It should be parameterless.
o It should control delay. .IP *
o It should adapt dynamically to changing link rates with no impact on It should keep delays low while permitting bursts of traffic.
.IP *
It should control delay.
.IP *
It should adapt dynamically to changing link rates with no impact on
utilization. utilization.
o It should be simple and efficient and should scale from simple to .IP *
It should be simple and efficient and should scale from simple to
complex routers. complex routers.
.SH ALGORITHM .SH ALGORITHM
@ -57,7 +62,7 @@ Additional details can be found in the paper cited below.
.SH PARAMETERS .SH PARAMETERS
.SS limit .SS limit
hard limit on the real queue size. When this limit is reached, incoming packets is the hard limit on the real queue size. When this limit is reached, incoming packets
are dropped. If the value is lowered, packets are dropped so that the new limit is are dropped. If the value is lowered, packets are dropped so that the new limit is
met. Default is 1000 packets. met. Default is 1000 packets.
@ -113,7 +118,7 @@ interval 30.0ms ecn
.BR tc-red (8) .BR tc-red (8)
.SH SOURCES .SH SOURCES
o Kathleen Nichols and Van Jacobson, "Controlling Queue Delay", ACM Queue, Kathleen Nichols and Van Jacobson, "Controlling Queue Delay", ACM Queue,
http://queue.acm.org/detail.cfm?id=2209336 http://queue.acm.org/detail.cfm?id=2209336
.SH AUTHORS .SH AUTHORS

View File

@ -53,7 +53,7 @@
#include <linux/mptcp.h> #include <linux/mptcp.h>
#ifdef HAVE_LIBBPF #ifdef HAVE_LIBBPF
/* If libbpf is new enough (0.5+), support for pretty-printing BPF socket-local /* If libbpf is new enough (0.6+), support for pretty-printing BPF socket-local
* storage is enabled, otherwise we emit a warning and disable it. * storage is enabled, otherwise we emit a warning and disable it.
* ENABLE_BPF_SKSTORAGE_SUPPORT is only used to gate the socket-local storage * ENABLE_BPF_SKSTORAGE_SUPPORT is only used to gate the socket-local storage
* feature, so this wouldn't prevent any feature relying on HAVE_LIBBPF to be * feature, so this wouldn't prevent any feature relying on HAVE_LIBBPF to be
@ -66,8 +66,8 @@
#include <bpf/libbpf.h> #include <bpf/libbpf.h>
#include <linux/btf.h> #include <linux/btf.h>
#if (LIBBPF_MAJOR_VERSION == 0) && (LIBBPF_MINOR_VERSION < 5) #if ((LIBBPF_MAJOR_VERSION == 0) && (LIBBPF_MINOR_VERSION < 6))
#warning "libbpf version 0.5 or later is required, disabling BPF socket-local storage support" #warning "libbpf version 0.6 or later is required, disabling BPF socket-local storage support"
#undef ENABLE_BPF_SKSTORAGE_SUPPORT #undef ENABLE_BPF_SKSTORAGE_SUPPORT
#endif #endif
#endif #endif