diff options
author | Paolo Abeni <pabeni@redhat.com> | 2018-12-14 11:51:59 +0100 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2018-12-15 13:23:02 -0800 |
commit | 028e0a4766844e7eeb31b93479ea6dd40cfc2895 (patch) | |
tree | 4a2e159b4ddfe4548de2b003bae3ca7d15f6a11b /include/net | |
parent | aaa5d90b395a72faff797b00d815165ee0e664c0 (diff) | |
download | linux-028e0a4766844e7eeb31b93479ea6dd40cfc2895.tar.bz2 |
net: use indirect call wrappers at GRO transport layer
This avoids an indirect call in the receive path for TCP and UDP
packets. TCP takes precedence on UDP, so that we have a single
additional conditional in the common case.
When IPV6 is build as module, all gro symbols except UDPv6 are
builtin, while the latter belong to the ipv6 module, so we
need some special care.
v1 -> v2:
- adapted to INDIRECT_CALL_ changes
v2 -> v3:
- fix build issue with CONFIG_IPV6=m
Signed-off-by: Paolo Abeni <pabeni@redhat.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'include/net')
-rw-r--r-- | include/net/inet_common.h | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/include/net/inet_common.h b/include/net/inet_common.h index 56e7592811ea..975901a95c0f 100644 --- a/include/net/inet_common.h +++ b/include/net/inet_common.h @@ -56,4 +56,11 @@ static inline void inet_ctl_sock_destroy(struct sock *sk) sock_release(sk->sk_socket); } +#define indirect_call_gro_receive(f2, f1, cb, head, skb) \ +({ \ + unlikely(gro_recursion_inc_test(skb)) ? \ + NAPI_GRO_CB(skb)->flush |= 1, NULL : \ + INDIRECT_CALL_2(cb, f2, f1, head, skb); \ +}) + #endif |