summaryrefslogtreecommitdiff
path: root/net/sched/act_meta_skbprio.c
diff options
context:
space:
mode:
authorIlya Ponetayev <i.ponetaev@ndmsystems.com>2020-06-25 23:12:07 +0300
committerDavid S. Miller <davem@davemloft.net>2020-06-26 02:24:05 +0300
commit9208d2863ac689a563b92f2161d8d1e7127d0add (patch)
tree34ae27978c1e350b801b99aa7b81bf8238a62d06 /net/sched/act_meta_skbprio.c
parent1ae71d997a672739b22572cbe72d61a0eed8c42c (diff)
downloadlinux-9208d2863ac689a563b92f2161d8d1e7127d0add.tar.xz
sch_cake: don't try to reallocate or unshare skb unconditionally
cake_handle_diffserv() tries to linearize mac and network header parts of skb and to make it writable unconditionally. In some cases it leads to full skb reallocation, which reduces throughput and increases CPU load. Some measurements of IPv4 forward + NAPT on MIPS router with 580 MHz single-core CPU was conducted. It appears that on kernel 4.9 skb_try_make_writable() reallocates skb, if skb was allocated in ethernet driver via so-called 'build skb' method from page cache (it was discovered by strange increase of kmalloc-2048 slab at first). Obtain DSCP value via read-only skb_header_pointer() call, and leave linearization only for DSCP bleaching or ECN CE setting. And, as an additional optimisation, skip diffserv parsing entirely if it is not needed by the current configuration. Fixes: c87b4ecdbe8d ("sch_cake: Make sure we can write the IP header before changing DSCP bits") Signed-off-by: Ilya Ponetayev <i.ponetaev@ndmsystems.com> [ fix a few style issues, reflow commit message ] Signed-off-by: Toke Høiland-Jørgensen <toke@redhat.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/sched/act_meta_skbprio.c')
0 files changed, 0 insertions, 0 deletions