]> git.baikalelectronics.ru Git - kernel.git/commit
net: use jump label patching for ingress qdisc in __netif_receive_skb_core
authorDaniel Borkmann <daniel@iogearbox.net>
Fri, 10 Apr 2015 21:07:54 +0000 (23:07 +0200)
committerDavid S. Miller <davem@davemloft.net>
Mon, 13 Apr 2015 17:34:40 +0000 (13:34 -0400)
commit681eda8187212c235f062efdc45693bbcd9bd759
treee3ddced4285dbca3263f5e9e65c69550f8184e88
parenta082a11eb6cb194ffd0f5dccbbe807645717fbd5
net: use jump label patching for ingress qdisc in __netif_receive_skb_core

Even if we make use of classifier and actions from the egress
path, we're going into handle_ing() executing additional code
on a per-packet cost for ingress qdisc, just to realize that
nothing is attached on ingress.

Instead, this can just be blinded out as a no-op entirely with
the use of a static key. On input fast-path, we already make
use of static keys in various places, e.g. skb time stamping,
in RPS, etc. It makes sense to not waste time when we're assured
that no ingress qdisc is attached anywhere.

Enabling/disabling of that code path is being done via two
helpers, namely net_{inc,dec}_ingress_queue(), that are being
invoked under RTNL mutex when a ingress qdisc is being either
initialized or destructed.

Signed-off-by: Daniel Borkmann <daniel@iogearbox.net>
Acked-by: Alexei Starovoitov <ast@plumgrid.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
include/linux/rtnetlink.h
net/core/dev.c
net/sched/sch_ingress.c