openwrt/target/linux
Kevin Darbyshire-Bryant 7b4877c204 kernel: sch_cake: use skb hash improve wireguard compatibility
While the other fq-based qdiscs take advantage of skb->hash and doesn't
recompute it if it is already set, sch_cake does not.

This was a deliberate choice because sch_cake hashes various parts of the
packet header to support its advanced flow isolation modes. However,
foregoing the use of skb->hash entirely loses a few important benefits:

- When skb->hash is set by hardware, a few CPU cycles can be saved by not
  hashing again in software.

- Tunnel encapsulations will generally preserve the value of skb->hash from
  before the encapsulation, which allows flow-based qdiscs to distinguish
  between flows even though the outer packet header no longer has flow
  information.

It turns out that we can preserve these desirable properties in many cases,
while still supporting the advanced flow isolation properties of sch_cake.
This patch does so by reusing the skb->hash value as the flow_hash part of
the hashing procedure in cake_hash() only in the following conditions:

- If the skb->hash is marked as covering the flow headers (skb->l4_hash is
  set)

AND

- NAT header rewriting is either disabled, or did not change any values
  used for hashing. The latter is important to match local-origin packets
  such as those of a tunnel endpoint.

The immediate motivation for fixing this was the recent patch to WireGuard
to preserve the skb->hash on encapsulation. As such, this is also what I
tested against; with this patch, added latency under load for competing
flows drops from ~8 ms to sub-1ms on an RRUL test over a WireGuard tunnel
going through a virtual link shaped to 1Gbps using sch_cake. This matches
the results we saw with a similar setup using sch_fq_codel when testing the
WireGuard patch.

Fixes: 046f6fd5daef ("sched: Add Common Applications Kept Enhanced (cake) qdisc")
Signed-off-by: Toke Høiland-Jørgensen <toke@redhat.com>
Signed-off-by: David S. Miller <davem@davemloft.net>

Signed-off-by: Kevin Darbyshire-Bryant <ldir@darbyshire-bryant.me.uk>
2020-06-05 21:03:26 +01:00
..
apm821xx apm821xx: set DEVICE_TYPE to "nas" for sata subtarget 2020-06-03 15:41:09 +02:00
ar71xx ar71xx: correct button type for TL-MR3020 mode slider 2020-05-31 15:53:01 +02:00
arc770 treewide: provide consistent basic DEVICE_TYPE 2020-06-03 15:41:09 +02:00
archs38 treewide: provide consistent basic DEVICE_TYPE 2020-06-03 15:41:09 +02:00
armvirt kernel: remove non-existant symbols 2020-04-13 22:40:19 +02:00
at91 treewide: remove maintainer variable from targets 2020-03-16 22:21:45 +01:00
ath25 treewide: remove maintainer variable from targets 2020-03-16 22:21:45 +01:00
ath79 ath79: phy-ar7200-usb: do not print error on defered init 2020-06-03 16:49:28 +02:00
bcm27xx kernel: bump 5.4 to 5.4.43 2020-06-02 17:46:51 +02:00
bcm47xx bcm47xx: fix brcm-wl module loading 2020-06-03 16:49:28 +02:00
bcm53xx bcm53xx: remove support for kernel 4.14 2020-05-30 11:30:06 +02:00
bcm63xx bcm63xx: vg-8050: fix WFI partition size 2020-06-03 19:06:22 +02:00
cns3xxx cns3xx: remove support for kernel 4.14 2020-04-12 13:43:52 +02:00
gemini treewide: drop DEVICE_TYPE when used as device variable 2020-06-03 15:41:09 +02:00
generic kernel: sch_cake: use skb hash improve wireguard compatibility 2020-06-05 21:03:26 +01:00
imx6 imx6: image: increase max ubifs file-system size 2020-06-03 16:49:28 +02:00
ipq40xx ipq40xx: replace "ok" with "okay" for status in DTS files 2020-05-12 19:16:41 +02:00
ipq806x ipq806x: enable disk-activity LED trigger 2020-06-03 16:49:28 +02:00
ipq807x treewide: remove maintainer variable from targets 2020-03-16 22:21:45 +01:00
kirkwood treewide: drop DEVICE_TYPE when used as device variable 2020-06-03 15:41:09 +02:00
lantiq lantiq: fritz 7360 v2: remove additional supported devices 2020-05-18 11:59:22 +02:00
layerscape layerscape: remove support for kernel 4.14 2020-05-25 11:48:54 +02:00
malta malta: add missing symbols for kernel 5.4 2020-06-03 10:50:01 +01:00
mediatek ramips/mediatek: select kmod-mt7615-firmware where kmod-mt7615e is selected 2020-06-04 21:52:57 +02:00
mpc85xx mpc85xx: restructure image receipts 2020-05-18 21:11:39 +02:00
mvebu mvebu: remove ClearFog Pro SUPPORTED_DEVICES 2020-06-05 21:54:53 +02:00
mxs kernel: bump 5.4 to 5.4.28 2020-03-28 13:03:02 +01:00
octeon octeon: set 5.4 as default kernel 2020-05-25 12:04:55 +02:00
octeontx octeontx: fix mcp251x can controller 2020-06-03 16:49:28 +02:00
omap omap: remove support for kernel 4.14 2020-04-28 01:10:48 +02:00
oxnas oxnas: move service file to correct place 2020-04-26 21:05:15 +02:00
pistachio treewide: remove maintainer variable from targets 2020-03-16 22:21:45 +01:00
ramips ramips/mediatek: select kmod-mt7615-firmware where kmod-mt7615e is selected 2020-06-04 21:52:57 +02:00
rb532 treewide: remove maintainer variable from targets 2020-03-16 22:21:45 +01:00
rockchip rockchip: add support for Pine64 RockPro64 2020-04-20 16:37:56 +02:00
samsung treewide: remove maintainer variable from targets 2020-03-16 22:21:45 +01:00
sunxi sunxi: remove unneeded shebang for preinit files 2020-05-05 13:09:19 +02:00
tegra tegra: correct cpu subtype 2020-03-28 22:58:36 +01:00
uml treewide: Remove self from MAINTAINER entries 2019-12-23 13:18:04 -08:00
x86 kernel: add gpio-it87 2020-06-03 16:49:28 +02:00
zynq zynq: switch to kernel 5.4 2020-03-17 00:51:48 +01:00
Makefile