1
0
mirror of https://git.openwrt.org/openwrt/openwrt.git synced 2024-10-20 06:28:12 +02:00
openwrt/target/linux/generic/backport-5.4
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
..
010-Kbuild-don-t-hardcode-path-to-awk-in-scripts-ld-vers.patch
011-kbuild-export-SUBARCH.patch
020-backport_netfilter_rtcache.patch
030-modpost-add-a-helper-to-get-data-pointed-by-a-symbol.patch
031-modpost-refactor-namespace_from_kstrtabns-to-not-har.patch
040-ARM-8918-2-only-build-return_address-if-needed.patch
300-MIPS-Exclude-more-dsemul-code-when-CONFIG_MIPS_FP_SU.patch
343-netfilter-nft_flow_offload-handle-netdevice-events-f.patch
370-netfilter-nf_flow_table-fix-offloaded-connection-tim.patch
371-netfilter-nf_flow_table-fix-up-ct-state-of-flows-aft.patch
398-v5.9-net-sch_cake-Take-advantage-of-skb-hash-where-appropriate.patch kernel: sch_cake: use skb hash improve wireguard compatibility 2020-06-05 21:03:26 +01:00
410-mtd-fix-calculating-partition-end-address.patch
716-v5.4-net-sfp-move-fwnode-parsing-into-sfp-bus-layer.patch
717-v5.5-net-sfp-rework-upstream-interface.patch
718-v5.5-net-sfp-fix-sfp_bus_put-kernel-documentation.patch
719-v5.5-net-sfp-fix-sfp_bus_add_upstream-warning.patch
720-v5.5-net-sfp-move-sfp-sub-state-machines-into-separate-fu.patch
721-v5.5-net-sfp-move-tx-disable-on-device-down-to-main-state.patch
722-v5.5-net-sfp-rename-sfp_sm_ins_next-as-sfp_sm_mod_next.patch
723-v5.5-net-sfp-handle-module-remove-outside-state-machine.patch
724-v5.5-net-sfp-rename-T_PROBE_WAIT-to-T_SERIAL.patch
725-v5.5-net-sfp-parse-SFP-power-requirement-earlier.patch
726-v5.5-net-sfp-avoid-power-switch-on-address-change-modules.patch
727-v5.5-net-sfp-control-TX_DISABLE-and-phy-only-from-main-st.patch
728-v5.5-net-sfp-split-the-PHY-probe-from-sfp_sm_mod_init.patch
729-v5.5-net-sfp-eliminate-mdelay-from-PHY-probe.patch
730-v5.5-net-sfp-allow-fault-processing-to-transition-to-othe.patch
731-v5.5-net-sfp-ensure-TX_FAULT-has-deasserted-before-probin.patch
732-v5.5-net-sfp-track-upstream-s-attachment-state-in-state-m.patch
733-v5.5-net-sfp-split-power-mode-switching-from-probe.patch
734-v5.5-net-sfp-move-module-insert-reporting-out-of-probe.patch
735-v5.5-net-sfp-allow-sfp-to-probe-slow-to-initialise-GPON-m.patch
736-v5.5-net-sfp-allow-modules-with-slow-diagnostics-to-probe.patch
737-v5.5-net-phy-add-core-phylib-sfp-support.patch
738-v5.5-net-phy-marvell10g-add-SFP-support.patch
739-v5.5-net-phylink-update-to-use-phy_support_asym_pause.patch
742-v5.5-net-sfp-add-support-for-module-quirks.patch
743-v5.5-net-sfp-add-some-quirks-for-GPON-modules.patch
744-v5.5-net-sfp-soft-status-and-control-support.patch
745-v5.7-net-dsa-mt7530-add-support-for-port-mirroring.patch
746-v5.5-net-dsa-mv88e6xxx-Split-monitor-port-configuration.patch generic: backport mv88e6xxx port mirroring support 2020-06-03 20:34:15 +02:00
747-v5.5-net-dsa-mv88e6xxx-Add-support-for-port-mirroring.patch generic: backport mv88e6xxx port mirroring support 2020-06-03 20:34:15 +02:00
748-v5.5-net-dsa-mv88e6xxx-fix-broken-if-statement-because-of.patch generic: backport mv88e6xxx port mirroring support 2020-06-03 20:34:15 +02:00
749-v5.5-net-dsa-mv88e6xxx-Fix-masking-of-egress-port.patch generic: backport mv88e6xxx port mirroring support 2020-06-03 20:34:15 +02:00
750-v5.5-net-phy-add-support-for-clause-37-auto-negotiation.patch
751-v5.8-net-dsa-mt7530-set-CPU-port-to-fallback-mode.patch generic: mt7530: set CPU port to fallback mode 2020-06-04 22:21:42 +02:00
752-v5.8-net-dsa-provide-an-option-for-drivers-to-always-rece.patch generic: fix DSA VLAN filtering 2020-06-04 22:21:42 +02:00
753-v5.8-net-dsa-mt7530-fix-VLAN-setup.patch generic: fix DSA VLAN filtering 2020-06-04 22:21:42 +02:00
754-v5.7-net-dsa-mt7530-fix-roaming-from-DSA-user-ports.patch generic: mt7530: fix roaming from DSA user ports 2020-06-04 22:21:42 +02:00
800-v5.5-iio-imu-Add-support-for-the-FXOS8700-IMU.patch
800-v5.5-scsi-core-Add-sysfs-attributes-for-VPD-pages-0h-and-.patch
801-v5.5-hwmon-Driver-for-disk-and-solid-state-drives-with-te.patch
801-v5.6-leds-populate-the-device-s-of_node.patch
803-v5.8-i2c-pxa-use-official-address-byte-helper.patch kernel: drop backported gpio emulated open drain output fix 2020-05-25 21:10:44 +02:00
804-v5.8-i2c-pxa-remove-unneeded-includes.patch kernel: drop backported gpio emulated open drain output fix 2020-05-25 21:10:44 +02:00
805-v5.8-i2c-pxa-re-arrange-includes-to-be-in-alphabetical-or.patch kernel: drop backported gpio emulated open drain output fix 2020-05-25 21:10:44 +02:00
806-v5.8-i2c-pxa-re-arrange-functions-to-flow-better.patch kernel: drop backported gpio emulated open drain output fix 2020-05-25 21:10:44 +02:00
807-v5.8-i2c-pxa-re-arrange-register-field-definitions.patch kernel: drop backported gpio emulated open drain output fix 2020-05-25 21:10:44 +02:00
808-v5.8-i2c-pxa-add-and-use-definitions-for-IBMR-register.patch kernel: drop backported gpio emulated open drain output fix 2020-05-25 21:10:44 +02:00
809-v5.8-i2c-pxa-always-set-fm-and-hs-members-for-each-type.patch kernel: drop backported gpio emulated open drain output fix 2020-05-25 21:10:44 +02:00
810-v5.8-i2c-pxa-move-private-definitions-to-i2c-pxa.c.patch kernel: drop backported gpio emulated open drain output fix 2020-05-25 21:10:44 +02:00
811-v5.8-i2c-pxa-move-DT-IDs-along-side-platform-IDs.patch kernel: drop backported gpio emulated open drain output fix 2020-05-25 21:10:44 +02:00
812-v5.8-i2c-pxa-fix-i2c_pxa_scream_blue_murder-debug-output.patch kernel: drop backported gpio emulated open drain output fix 2020-05-25 21:10:44 +02:00
813-v5.8-i2c-pxa-clean-up-decode_bits.patch kernel: drop backported gpio emulated open drain output fix 2020-05-25 21:10:44 +02:00
814-v5.8-i2c-pxa-fix-i2c_pxa_wait_bus_not_busy-boundary-condi.patch kernel: drop backported gpio emulated open drain output fix 2020-05-25 21:10:44 +02:00
815-v5.8-i2c-pxa-consolidate-i2c_pxa_-xfer-implementations.patch kernel: drop backported gpio emulated open drain output fix 2020-05-25 21:10:44 +02:00
816-v5.8-i2c-pxa-avoid-complaints-with-non-responsive-slaves.patch kernel: drop backported gpio emulated open drain output fix 2020-05-25 21:10:44 +02:00
817-v5.8-i2c-pxa-ensure-timeout-messages-are-unique.patch kernel: drop backported gpio emulated open drain output fix 2020-05-25 21:10:44 +02:00
818-v5.8-i2c-pxa-remove-some-unnecessary-debug.patch kernel: drop backported gpio emulated open drain output fix 2020-05-25 21:10:44 +02:00
819-v5.8-i2c-pxa-clear-all-master-action-bits-in-i2c_pxa_stop.patch kernel: drop backported gpio emulated open drain output fix 2020-05-25 21:10:44 +02:00
820-v5.8-i2c-pxa-use-master-abort-for-device-probes.patch kernel: drop backported gpio emulated open drain output fix 2020-05-25 21:10:44 +02:00
821-v5.8-i2c-pxa-implement-generic-i2c-bus-recovery.patch kernel: drop backported gpio emulated open drain output fix 2020-05-25 21:10:44 +02:00