immortalwrt/target/linux
Kevin Darbyshire-Bryant 445b8a7f52 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-06 12:18:14 +08:00
..
apm821xx treewide: adjust sysupgrade script 2020-05-05 22:18:12 +08:00
ar7
ar71xx ar71xx: correct button type for TL-MR3020 mode slider 2020-06-01 12:04:37 +08:00
arc770
archs38 apm821xx/archs38/armvirt/gemini/imx6/kirkwood/lantiq/malta: add kernel 5.4 support 2020-04-16 18:09:15 +08:00
armvirt apm821xx/archs38/armvirt/gemini/imx6/kirkwood/lantiq/malta: add kernel 5.4 support 2020-04-16 18:09:15 +08:00
at91
ath25
ath79 Merge Mainline 2020-06-04 18:38:04 +08:00
bcm27xx Merge Mainline 2020-06-04 18:38:04 +08:00
bcm47xx bcm47xx: fix brcm-wl module loading 2020-06-04 12:35:18 +08:00
bcm53xx Merge Mainline 2020-05-04 16:11:02 +08:00
bcm63xx bcm63xx: vg-8050: fix WFI partition size 2020-06-04 17:45:41 +08:00
cns3xxx kernel: bump 4.19 to 4.19.118 2020-04-25 11:08:19 +08:00
gemini apm821xx/archs38/armvirt/gemini/imx6/kirkwood/lantiq/malta: add kernel 5.4 support 2020-04-16 18:09:15 +08:00
generic kernel: sch_cake: use skb hash improve wireguard compatibility 2020-06-06 12:18:14 +08:00
imx6 imx6: image: increase max ubifs file-system size 2020-06-05 12:04:19 +08:00
ipq40xx Merge Mainline 2020-05-25 19:39:32 +08:00
ipq806x ipq806x: enable disk-activity LED trigger 2020-06-04 12:19:01 +08:00
ipq807x
ixp4xx kernel: bump 4.9 to 4.9.220 2020-04-25 08:06:59 +08:00
kirkwood treewide: adjust sysupgrade script 2020-05-01 16:29:04 +08:00
lantiq lantiq: drop outdated kernel version switches from patches-5.4 2020-05-24 11:37:54 +08:00
layerscape layerscape: remove support for kernel 4.14 2020-05-26 12:00:04 +08:00
malta malta: add missing symbols for kernel 5.4 2020-06-04 12:07:06 +08:00
mediatek kernel: bump 5.4 to 5.4.39 2020-05-08 08:18:53 +08:00
mpc85xx mpc85xx: restructure image receipts 2020-05-19 12:00:01 +08:00
mvebu mvebu: remove ClearFog Pro SUPPORTED_DEVICES 2020-06-06 12:17:13 +08:00
mxs Merge Mainline 2020-05-04 16:11:02 +08:00
octeon octeon: add support for kernel 5.4 2020-04-24 08:15:26 +08:00
octeontx octeontx: fix mcp251x can controller 2020-06-05 12:06:38 +08:00
omap omap: add support for kernel 5.4 2020-04-28 11:00:38 +08:00
orion
oxnas Merge Mainline 2020-05-04 16:11:02 +08:00
pistachio
ramips Merge Mainline 2020-06-04 18:38:04 +08:00
rb532
samsung
sunxi Merge Mainline 2020-05-24 22:41:44 +08:00
tegra mpc85xx/mvebu/mxs/octeontx/oxnas/sunxi/tegra/zynq: add kernel 5.4 support 2020-04-16 19:38:37 +08:00
uml
x86 Merge Mainline 2020-06-04 18:38:04 +08:00
zynq mpc85xx/mvebu/mxs/octeontx/oxnas/sunxi/tegra/zynq: add kernel 5.4 support 2020-04-16 19:38:37 +08:00
Makefile