diff options
author | Paolo Abeni <pabeni@redhat.com> | 2019-05-03 11:01:38 -0400 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2019-05-05 13:38:04 -0400 |
commit | 97ff7ffb11fe7a859a490771e7ce23f1f335176b (patch) | |
tree | 0b6bcf8f028ecbe20eafab86c08ef06150f02c15 /net/ipv6 | |
parent | 0e219ae48c3bbf382ef96adf3825457315728c03 (diff) |
net: use indirect calls helpers at early demux stage
So that we avoid another indirect call per RX packet, if
early demux is enabled.
Signed-off-by: Paolo Abeni <pabeni@redhat.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/ipv6')
-rw-r--r-- | net/ipv6/ip6_input.c | 5 | ||||
-rw-r--r-- | net/ipv6/tcp_ipv6.c | 2 | ||||
-rw-r--r-- | net/ipv6/udp.c | 2 |
3 files changed, 6 insertions, 3 deletions
diff --git a/net/ipv6/ip6_input.c b/net/ipv6/ip6_input.c index adf06159837f..b50b1af1f530 100644 --- a/net/ipv6/ip6_input.c +++ b/net/ipv6/ip6_input.c | |||
@@ -48,6 +48,8 @@ | |||
48 | #include <net/inet_ecn.h> | 48 | #include <net/inet_ecn.h> |
49 | #include <net/dst_metadata.h> | 49 | #include <net/dst_metadata.h> |
50 | 50 | ||
51 | INDIRECT_CALLABLE_DECLARE(void udp_v6_early_demux(struct sk_buff *)); | ||
52 | INDIRECT_CALLABLE_DECLARE(void tcp_v6_early_demux(struct sk_buff *)); | ||
51 | static void ip6_rcv_finish_core(struct net *net, struct sock *sk, | 53 | static void ip6_rcv_finish_core(struct net *net, struct sock *sk, |
52 | struct sk_buff *skb) | 54 | struct sk_buff *skb) |
53 | { | 55 | { |
@@ -58,7 +60,8 @@ static void ip6_rcv_finish_core(struct net *net, struct sock *sk, | |||
58 | 60 | ||
59 | ipprot = rcu_dereference(inet6_protos[ipv6_hdr(skb)->nexthdr]); | 61 | ipprot = rcu_dereference(inet6_protos[ipv6_hdr(skb)->nexthdr]); |
60 | if (ipprot && (edemux = READ_ONCE(ipprot->early_demux))) | 62 | if (ipprot && (edemux = READ_ONCE(ipprot->early_demux))) |
61 | edemux(skb); | 63 | INDIRECT_CALL_2(edemux, tcp_v6_early_demux, |
64 | udp_v6_early_demux, skb); | ||
62 | } | 65 | } |
63 | if (!skb_valid_dst(skb)) | 66 | if (!skb_valid_dst(skb)) |
64 | ip6_route_input(skb); | 67 | ip6_route_input(skb); |
diff --git a/net/ipv6/tcp_ipv6.c b/net/ipv6/tcp_ipv6.c index d58bf84e0f9a..beaf28456301 100644 --- a/net/ipv6/tcp_ipv6.c +++ b/net/ipv6/tcp_ipv6.c | |||
@@ -1655,7 +1655,7 @@ do_time_wait: | |||
1655 | goto discard_it; | 1655 | goto discard_it; |
1656 | } | 1656 | } |
1657 | 1657 | ||
1658 | static void tcp_v6_early_demux(struct sk_buff *skb) | 1658 | INDIRECT_CALLABLE_SCOPE void tcp_v6_early_demux(struct sk_buff *skb) |
1659 | { | 1659 | { |
1660 | const struct ipv6hdr *hdr; | 1660 | const struct ipv6hdr *hdr; |
1661 | const struct tcphdr *th; | 1661 | const struct tcphdr *th; |
diff --git a/net/ipv6/udp.c b/net/ipv6/udp.c index b3fcafaf5576..07fa579dfb96 100644 --- a/net/ipv6/udp.c +++ b/net/ipv6/udp.c | |||
@@ -981,7 +981,7 @@ static struct sock *__udp6_lib_demux_lookup(struct net *net, | |||
981 | return NULL; | 981 | return NULL; |
982 | } | 982 | } |
983 | 983 | ||
984 | static void udp_v6_early_demux(struct sk_buff *skb) | 984 | INDIRECT_CALLABLE_SCOPE void udp_v6_early_demux(struct sk_buff *skb) |
985 | { | 985 | { |
986 | struct net *net = dev_net(skb->dev); | 986 | struct net *net = dev_net(skb->dev); |
987 | const struct udphdr *uh; | 987 | const struct udphdr *uh; |