linux-stable/include
Kevin Bracey af7c14aa08 net_sched: restore "mpu xxx" handling
commit fb80445c43 upstream.

commit 56b765b79e ("htb: improved accuracy at high rates") broke
"overhead X", "linklayer atm" and "mpu X" attributes.

"overhead X" and "linklayer atm" have already been fixed. This restores
the "mpu X" handling, as might be used by DOCSIS or Ethernet shaping:

    tc class add ... htb rate X overhead 4 mpu 64

The code being fixed is used by htb, tbf and act_police. Cake has its
own mpu handling. qdisc_calculate_pkt_len still uses the size table
containing values adjusted for mpu by user space.

iproute2 tc has always passed mpu into the kernel via a tc_ratespec
structure, but the kernel never directly acted on it, merely stored it
so that it could be read back by `tc class show`.

Rather, tc would generate length-to-time tables that included the mpu
(and linklayer) in their construction, and the kernel used those tables.

Since v3.7, the tables were no longer used. Along with "mpu", this also
broke "overhead" and "linklayer" which were fixed in 01cb71d2d4
("net_sched: restore "overhead xxx" handling", v3.10) and 8a8e3d84b1
("net_sched: restore "linklayer atm" handling", v3.11).

"overhead" was fixed by simply restoring use of tc_ratespec::overhead -
this had originally been used by the kernel but was initially omitted
from the new non-table-based calculations.

"linklayer" had been handled in the table like "mpu", but the mode was
not originally passed in tc_ratespec. The new implementation was made to
handle it by getting new versions of tc to pass the mode in an extended
tc_ratespec, and for older versions of tc the table contents were analysed
at load time to deduce linklayer.

As "mpu" has always been given to the kernel in tc_ratespec,
accompanying the mpu-based table, we can restore system functionality
with no userspace change by making the kernel act on the tc_ratespec
value.

Fixes: 56b765b79e ("htb: improved accuracy at high rates")
Signed-off-by: Kevin Bracey <kevin@bracey.fi>
Cc: Eric Dumazet <edumazet@google.com>
Cc: Jiri Pirko <jiri@resnulli.us>
Cc: Vimalkumar <j.vimal@gmail.com>
Link: https://lore.kernel.org/r/20220112170210.1014351-1-kevin@bracey.fi
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2022-01-27 09:01:01 +01:00
..
acpi ACPICA: actypes.h: Expand the ACPI_ACCESS_ definitions 2022-01-27 09:00:56 +01:00
asm-generic hugetlbfs: flush TLBs correctly after huge_pmd_unshare 2021-12-08 08:46:52 +01:00
clocksource
crypto crypto: public_key: fix overflow during implicit conversion 2021-09-22 11:45:24 +02:00
drm drm: Return -ENOTTY for non-drm ioctls 2021-07-28 11:12:20 +02:00
dt-bindings
keys KEYS: Don't write out to userspace while holding key semaphore 2020-04-24 08:01:25 +02:00
kvm
linux net: skip virtio_net_hdr_set_proto if protocol already set 2021-12-29 12:17:33 +01:00
math-emu
media media: v4l2-device.h: Explicitly compare grp{id,mask} to zero in v4l2_device macros 2020-02-28 16:36:00 +01:00
memory
misc
net net_sched: restore "mpu xxx" handling 2022-01-27 09:01:01 +01:00
pcmcia
ras
rdma RDMA/netlink: Add __maybe_unused to static inline in C file 2021-11-26 11:40:41 +01:00
scsi scsi: iscsi: Add iscsi_cls_conn refcount helpers 2021-07-20 16:17:49 +02:00
soc irqchip/eznps: Fix build error for !ARC700 builds 2020-09-23 10:46:27 +02:00
sound ALSA: compress: fix partial_drain completion state 2020-07-22 09:22:17 +02:00
target scsi: target: Fix ordered tag handling 2021-11-26 11:40:38 +01:00
trace memcg: fix a crash in wb_workfn when a device disappears 2021-02-23 14:00:30 +01:00
uapi uapi: fix linux/nfc.h userspace compilation errors 2022-01-05 12:33:48 +01:00
video
xen xen: sync include/xen/interface/io/ring.h with Xen's newest version 2021-12-08 08:46:52 +01:00