Home Home > GIT Browse > SLE12-SP4-AZURE
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPetr Tesarik <ptesarik@suse.cz>2019-06-06 13:05:21 +0200
committerPetr Tesarik <ptesarik@suse.cz>2019-06-06 13:05:21 +0200
commit439a13f38c8c6776a3d0cfc38aeb36c484874cbd (patch)
treed0d1ea3c91f646359b1159e500c4c891d9e1b1d4
parentca5dd35cf7883661a81c6de904f5ddb5a81f0e44 (diff)
parentdbad7a1e07ff2ab66725296f42531c9cc8e1b525 (diff)
Merge branch 'users/mkubecek/SLE15/for-next' into SLE15
Pull networking fixes from Michal Kubecek
-rw-r--r--patches.fixes/indirect-call-wrappers-helpers-to-speed-up-indirect-.patch85
-rw-r--r--patches.fixes/net-unbreak-CONFIG_RETPOLINE-n-builds.patch37
-rw-r--r--patches.fixes/net-use-indirect-call-wrappers-at-GRO-network-layer.patch111
-rw-r--r--patches.fixes/net-use-indirect-call-wrappers-at-GRO-transport-laye.patch275
-rw-r--r--patches.fixes/udp-use-indirect-call-wrappers-for-GRO-socket-lookup.patch52
-rw-r--r--series.conf5
6 files changed, 565 insertions, 0 deletions
diff --git a/patches.fixes/indirect-call-wrappers-helpers-to-speed-up-indirect-.patch b/patches.fixes/indirect-call-wrappers-helpers-to-speed-up-indirect-.patch
new file mode 100644
index 0000000000..a152ebecc1
--- /dev/null
+++ b/patches.fixes/indirect-call-wrappers-helpers-to-speed-up-indirect-.patch
@@ -0,0 +1,85 @@
+From: Paolo Abeni <pabeni@redhat.com>
+Date: Fri, 14 Dec 2018 11:51:57 +0100
+Subject: indirect call wrappers: helpers to speed-up indirect calls of builtin
+Patch-mainline: v5.0-rc1
+Git-commit: 283c16a2dfd332bf5610c874f7b9f9c8b601ce53
+References: bsc#1124503
+
+This header define a bunch of helpers that allow avoiding the
+retpoline overhead when calling builtin functions via function pointers.
+It boils down to explicitly comparing the function pointers to
+known builtin functions and eventually invoke directly the latter.
+
+The macros defined here implement the boilerplate for the above schema
+and will be used by the next patches.
+
+rfc -> v1:
+ - use branch prediction hint, as suggested by Eric
+v1 -> v2:
+ - list explicitly the builtin function names in INDIRECT_CALL_*(),
+ as suggested by Ed Cree
+
+Suggested-by: Eric Dumazet <edumazet@google.com>
+Signed-off-by: Paolo Abeni <pabeni@redhat.com>
+Signed-off-by: David S. Miller <davem@davemloft.net>
+Acked-by: Michal Kubecek <mkubecek@suse.cz>
+
+---
+ include/linux/indirect_call_wrapper.h | 51 +++++++++++++++++++++++++++
+ 1 file changed, 51 insertions(+)
+ create mode 100644 include/linux/indirect_call_wrapper.h
+
+--- /dev/null
++++ b/include/linux/indirect_call_wrapper.h
+@@ -0,0 +1,51 @@
++/* SPDX-License-Identifier: GPL-2.0 */
++#ifndef _LINUX_INDIRECT_CALL_WRAPPER_H
++#define _LINUX_INDIRECT_CALL_WRAPPER_H
++
++#ifdef CONFIG_RETPOLINE
++
++/*
++ * INDIRECT_CALL_$NR - wrapper for indirect calls with $NR known builtin
++ * @f: function pointer
++ * @f$NR: builtin functions names, up to $NR of them
++ * @__VA_ARGS__: arguments for @f
++ *
++ * Avoid retpoline overhead for known builtin, checking @f vs each of them and
++ * eventually invoking directly the builtin function. The functions are check
++ * in the given order. Fallback to the indirect call.
++ */
++#define INDIRECT_CALL_1(f, f1, ...) \
++ ({ \
++ likely(f == f1) ? f1(__VA_ARGS__) : f(__VA_ARGS__); \
++ })
++#define INDIRECT_CALL_2(f, f2, f1, ...) \
++ ({ \
++ likely(f == f2) ? f2(__VA_ARGS__) : \
++ INDIRECT_CALL_1(f, f1, __VA_ARGS__); \
++ })
++
++#define INDIRECT_CALLABLE_DECLARE(f) f
++#define INDIRECT_CALLABLE_SCOPE
++
++#else
++#define INDIRECT_CALL_1(f, name, ...) f(__VA_ARGS__)
++#define INDIRECT_CALL_2(f, name, ...) f(__VA_ARGS__)
++#define INDIRECT_CALLABLE_DECLARE(f)
++#define INDIRECT_CALLABLE_SCOPE static
++#endif
++
++/*
++ * We can use INDIRECT_CALL_$NR for ipv6 related functions only if ipv6 is
++ * builtin, this macro simplify dealing with indirect calls with only ipv4/ipv6
++ * alternatives
++ */
++#if IS_BUILTIN(CONFIG_IPV6)
++#define INDIRECT_CALL_INET(f, f2, f1, ...) \
++ INDIRECT_CALL_2(f, f2, f1, __VA_ARGS__)
++#elif IS_ENABLED(CONFIG_INET)
++#define INDIRECT_CALL_INET(f, f2, f1, ...) INDIRECT_CALL_1(f, f1, __VA_ARGS__)
++#else
++#define INDIRECT_CALL_INET(f, f2, f1, ...) f(__VA_ARGS__)
++#endif
++
++#endif
diff --git a/patches.fixes/net-unbreak-CONFIG_RETPOLINE-n-builds.patch b/patches.fixes/net-unbreak-CONFIG_RETPOLINE-n-builds.patch
new file mode 100644
index 0000000000..7e1646f316
--- /dev/null
+++ b/patches.fixes/net-unbreak-CONFIG_RETPOLINE-n-builds.patch
@@ -0,0 +1,37 @@
+From: Paolo Abeni <pabeni@redhat.com>
+Date: Mon, 17 Dec 2018 12:39:02 +0100
+Subject: net: unbreak CONFIG_RETPOLINE=n builds
+Patch-mainline: v5.0-rc1
+Git-commit: c03b0358ab60504151b35587c88205c7b7fe22be
+References: bsc#1124503
+
+The kbuild bot reported a build breakage with CONFIG_RETPOLINE=n
+due to commit aaa5d90b395a ("net: use indirect call wrappers at
+GRO network layer").
+I screwed the wrapper implementation for such config.
+Fix the issue properly ignoring the builtin symbols arguments,
+when retpoline is not enabled.
+
+Reported-by: kbuild test robot <lkp@intel.com>
+Fixes: aaa5d90b395a ("net: use indirect call wrappers at GRO network layer")
+Signed-off-by: Paolo Abeni <pabeni@redhat.com>
+Signed-off-by: David S. Miller <davem@davemloft.net>
+Acked-by: Michal Kubecek <mkubecek@suse.cz>
+
+---
+ include/linux/indirect_call_wrapper.h | 4 ++--
+ 1 file changed, 2 insertions(+), 2 deletions(-)
+
+--- a/include/linux/indirect_call_wrapper.h
++++ b/include/linux/indirect_call_wrapper.h
+@@ -28,8 +28,8 @@
+ #define INDIRECT_CALLABLE_SCOPE
+
+ #else
+-#define INDIRECT_CALL_1(f, name, ...) f(__VA_ARGS__)
+-#define INDIRECT_CALL_2(f, name, ...) f(__VA_ARGS__)
++#define INDIRECT_CALL_1(f, f1, ...) f(__VA_ARGS__)
++#define INDIRECT_CALL_2(f, f2, f1, ...) f(__VA_ARGS__)
+ #define INDIRECT_CALLABLE_DECLARE(f)
+ #define INDIRECT_CALLABLE_SCOPE static
+ #endif
diff --git a/patches.fixes/net-use-indirect-call-wrappers-at-GRO-network-layer.patch b/patches.fixes/net-use-indirect-call-wrappers-at-GRO-network-layer.patch
new file mode 100644
index 0000000000..a6fefb0c16
--- /dev/null
+++ b/patches.fixes/net-use-indirect-call-wrappers-at-GRO-network-layer.patch
@@ -0,0 +1,111 @@
+From: Paolo Abeni <pabeni@redhat.com>
+Date: Fri, 14 Dec 2018 11:51:58 +0100
+Subject: net: use indirect call wrappers at GRO network layer
+Patch-mainline: v5.0-rc1
+Git-commit: aaa5d90b395a72faff797b00d815165ee0e664c0
+References: bsc#1124503
+
+This avoids an indirect calls for L3 GRO receive path, both
+for ipv4 and ipv6, if the latter is not compiled as a module.
+
+Note that when IPv6 is compiled as builtin, it will be checked first,
+so we have a single additional compare for the more common path.
+
+v1 -> v2:
+ - adapted to INDIRECT_CALL_ changes
+
+Signed-off-by: Paolo Abeni <pabeni@redhat.com>
+Signed-off-by: David S. Miller <davem@davemloft.net>
+Acked-by: Michal Kubecek <mkubecek@suse.cz>
+
+---
+ include/net/inet_common.h | 2 ++
+ net/core/dev.c | 15 +++++++++++++--
+ net/ipv6/ip6_offload.c | 6 +++---
+ 3 files changed, 18 insertions(+), 5 deletions(-)
+
+--- a/include/net/inet_common.h
++++ b/include/net/inet_common.h
+@@ -1,6 +1,8 @@
+ #ifndef _INET_COMMON_H
+ #define _INET_COMMON_H
+
++#include <linux/indirect_call_wrapper.h>
++
+ extern const struct proto_ops inet_stream_ops;
+ extern const struct proto_ops inet_dgram_ops;
+
+--- a/net/core/dev.c
++++ b/net/core/dev.c
+@@ -144,6 +144,7 @@
+ #include <linux/netfilter_ingress.h>
+ #include <linux/crash_dump.h>
+ #include <linux/sctp.h>
++#include <linux/indirect_call_wrapper.h>
+
+ #include "net-sysfs.h"
+
+@@ -4616,6 +4617,8 @@ static void flush_all_backlogs(void)
+ put_online_cpus();
+ }
+
++INDIRECT_CALLABLE_DECLARE(int inet_gro_complete(struct sk_buff *, int));
++INDIRECT_CALLABLE_DECLARE(int ipv6_gro_complete(struct sk_buff *, int));
+ static int napi_gro_complete(struct sk_buff *skb)
+ {
+ struct packet_offload *ptype;
+@@ -4635,7 +4638,9 @@ static int napi_gro_complete(struct sk_buff *skb)
+ if (ptype->type != type || !ptype->callbacks.gro_complete)
+ continue;
+
+- err = ptype->callbacks.gro_complete(skb, 0);
++ err = INDIRECT_CALL_INET(ptype->callbacks.gro_complete,
++ ipv6_gro_complete, inet_gro_complete,
++ skb, 0);
+ break;
+ }
+ rcu_read_unlock();
+@@ -4749,6 +4754,10 @@ static void gro_pull_from_frag0(struct sk_buff *skb, int grow)
+ }
+ }
+
++INDIRECT_CALLABLE_DECLARE(struct sk_buff **inet_gro_receive(struct sk_buff **,
++ struct sk_buff *));
++INDIRECT_CALLABLE_DECLARE(struct sk_buff **ipv6_gro_receive(struct sk_buff **,
++ struct sk_buff *));
+ static enum gro_result dev_gro_receive(struct napi_struct *napi, struct sk_buff *skb)
+ {
+ struct sk_buff **pp = NULL;
+@@ -4796,7 +4805,9 @@ static enum gro_result dev_gro_receive(struct napi_struct *napi, struct sk_buff
+ NAPI_GRO_CB(skb)->csum_valid = 0;
+ }
+
+- pp = ptype->callbacks.gro_receive(&napi->gro_list, skb);
++ pp = INDIRECT_CALL_INET(ptype->callbacks.gro_receive,
++ ipv6_gro_receive, inet_gro_receive,
++ &napi->gro_list, skb);
+ break;
+ }
+ rcu_read_unlock();
+--- a/net/ipv6/ip6_offload.c
++++ b/net/ipv6/ip6_offload.c
+@@ -162,8 +162,8 @@ static int ipv6_exthdrs_len(struct ipv6hdr *iph,
+ return len;
+ }
+
+-static struct sk_buff **ipv6_gro_receive(struct sk_buff **head,
+- struct sk_buff *skb)
++INDIRECT_CALLABLE_SCOPE
++struct sk_buff **ipv6_gro_receive(struct sk_buff **head, struct sk_buff *skb)
+ {
+ const struct net_offload *ops;
+ struct sk_buff **pp = NULL;
+@@ -292,7 +292,7 @@ static struct sk_buff **ip4ip6_gro_receive(struct sk_buff **head,
+ return inet_gro_receive(head, skb);
+ }
+
+-static int ipv6_gro_complete(struct sk_buff *skb, int nhoff)
++INDIRECT_CALLABLE_SCOPE int ipv6_gro_complete(struct sk_buff *skb, int nhoff)
+ {
+ const struct net_offload *ops;
+ struct ipv6hdr *iph = (struct ipv6hdr *)(skb->data + nhoff);
diff --git a/patches.fixes/net-use-indirect-call-wrappers-at-GRO-transport-laye.patch b/patches.fixes/net-use-indirect-call-wrappers-at-GRO-transport-laye.patch
new file mode 100644
index 0000000000..e3b3a0833e
--- /dev/null
+++ b/patches.fixes/net-use-indirect-call-wrappers-at-GRO-transport-laye.patch
@@ -0,0 +1,275 @@
+From: Paolo Abeni <pabeni@redhat.com>
+Date: Fri, 14 Dec 2018 11:51:59 +0100
+Subject: net: use indirect call wrappers at GRO transport layer
+Patch-mainline: v5.0-rc1
+Git-commit: 028e0a4766844e7eeb31b93479ea6dd40cfc2895
+References: bsc#1124503
+
+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>
+Acked-by: Michal Kubecek <mkubecek@suse.cz>
+
+---
+ include/net/inet_common.h | 7 +++++++
+ net/ipv4/af_inet.c | 13 +++++++++++--
+ net/ipv4/tcp_offload.c | 6 ++++--
+ net/ipv4/udp_offload.c | 7 ++++---
+ net/ipv6/ip6_offload.c | 29 +++++++++++++++++++++++++++--
+ net/ipv6/tcpv6_offload.c | 7 ++++---
+ net/ipv6/udp_offload.c | 7 ++++---
+ 7 files changed, 61 insertions(+), 15 deletions(-)
+
+--- a/include/net/inet_common.h
++++ b/include/net/inet_common.h
+@@ -53,4 +53,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
+--- a/net/ipv4/af_inet.c
++++ b/net/ipv4/af_inet.c
+@@ -1313,6 +1313,10 @@ struct sk_buff *inet_gso_segment(struct sk_buff *skb,
+ }
+ EXPORT_SYMBOL(inet_gso_segment);
+
++INDIRECT_CALLABLE_DECLARE(struct sk_buff **tcp4_gro_receive(struct sk_buff **,
++ struct sk_buff *));
++INDIRECT_CALLABLE_DECLARE(struct sk_buff **udp4_gro_receive(struct sk_buff **,
++ struct sk_buff *));
+ struct sk_buff **inet_gro_receive(struct sk_buff **head, struct sk_buff *skb)
+ {
+ const struct net_offload *ops;
+@@ -1422,7 +1426,8 @@ struct sk_buff **inet_gro_receive(struct sk_buff **head, struct sk_buff *skb)
+ skb_gro_pull(skb, sizeof(*iph));
+ skb_set_transport_header(skb, skb_gro_offset(skb));
+
+- pp = call_gro_receive(ops->callbacks.gro_receive, head, skb);
++ pp = indirect_call_gro_receive(tcp4_gro_receive, udp4_gro_receive,
++ ops->callbacks.gro_receive, head, skb);
+
+ out_unlock:
+ rcu_read_unlock();
+@@ -1484,6 +1489,8 @@ int inet_recv_error(struct sock *sk, struct msghdr *msg, int len, int *addr_len)
+ return -EINVAL;
+ }
+
++INDIRECT_CALLABLE_DECLARE(int tcp4_gro_complete(struct sk_buff *, int));
++INDIRECT_CALLABLE_DECLARE(int udp4_gro_complete(struct sk_buff *, int));
+ int inet_gro_complete(struct sk_buff *skb, int nhoff)
+ {
+ __be16 newlen = htons(skb->len - nhoff);
+@@ -1509,7 +1516,9 @@ int inet_gro_complete(struct sk_buff *skb, int nhoff)
+ * because any hdr with option will have been flushed in
+ * inet_gro_receive().
+ */
+- err = ops->callbacks.gro_complete(skb, nhoff + sizeof(*iph));
++ err = INDIRECT_CALL_2(ops->callbacks.gro_complete,
++ tcp4_gro_complete, udp4_gro_complete,
++ skb, nhoff + sizeof(*iph));
+
+ out_unlock:
+ rcu_read_unlock();
+--- a/net/ipv4/tcp_offload.c
++++ b/net/ipv4/tcp_offload.c
+@@ -10,6 +10,7 @@
+ * TCPv4 GSO/GRO support
+ */
+
++#include <linux/indirect_call_wrapper.h>
+ #include <linux/skbuff.h>
+ #include <net/tcp.h>
+ #include <net/protocol.h>
+@@ -296,7 +297,8 @@ int tcp_gro_complete(struct sk_buff *skb)
+ }
+ EXPORT_SYMBOL(tcp_gro_complete);
+
+-static struct sk_buff **tcp4_gro_receive(struct sk_buff **head, struct sk_buff *skb)
++INDIRECT_CALLABLE_SCOPE
++struct sk_buff **tcp4_gro_receive(struct sk_buff **head, struct sk_buff *skb)
+ {
+ /* Don't bother verifying checksum if we're going to flush anyway. */
+ if (!NAPI_GRO_CB(skb)->flush &&
+@@ -309,7 +311,7 @@ static struct sk_buff **tcp4_gro_receive(struct sk_buff **head, struct sk_buff *
+ return tcp_gro_receive(head, skb);
+ }
+
+-static int tcp4_gro_complete(struct sk_buff *skb, int thoff)
++INDIRECT_CALLABLE_SCOPE int tcp4_gro_complete(struct sk_buff *skb, int thoff)
+ {
+ const struct iphdr *iph = ip_hdr(skb);
+ struct tcphdr *th = tcp_hdr(skb);
+--- a/net/ipv4/udp_offload.c
++++ b/net/ipv4/udp_offload.c
+@@ -13,6 +13,7 @@
+ #include <linux/skbuff.h>
+ #include <net/udp.h>
+ #include <net/protocol.h>
++#include <net/inet_common.h>
+
+ static struct sk_buff *__skb_udp_tunnel_segment(struct sk_buff *skb,
+ netdev_features_t features,
+@@ -300,8 +301,8 @@ struct sk_buff **udp_gro_receive(struct sk_buff **head, struct sk_buff *skb,
+ }
+ EXPORT_SYMBOL(udp_gro_receive);
+
+-static struct sk_buff **udp4_gro_receive(struct sk_buff **head,
+- struct sk_buff *skb)
++INDIRECT_CALLABLE_SCOPE
++struct sk_buff **udp4_gro_receive(struct sk_buff **head, struct sk_buff *skb)
+ {
+ struct udphdr *uh = udp_gro_udphdr(skb);
+
+@@ -356,7 +357,7 @@ int udp_gro_complete(struct sk_buff *skb, int nhoff,
+ }
+ EXPORT_SYMBOL(udp_gro_complete);
+
+-static int udp4_gro_complete(struct sk_buff *skb, int nhoff)
++INDIRECT_CALLABLE_SCOPE int udp4_gro_complete(struct sk_buff *skb, int nhoff)
+ {
+ const struct iphdr *iph = ip_hdr(skb);
+ struct udphdr *uh = (struct udphdr *)(skb->data + nhoff);
+--- a/net/ipv6/ip6_offload.c
++++ b/net/ipv6/ip6_offload.c
+@@ -20,6 +20,23 @@
+
+ #include "ip6_offload.h"
+
++/* All GRO functions are always builtin, except UDP over ipv6, which lays in
++ * ipv6 module, as it depends on UDPv6 lookup function, so we need special care
++ * when ipv6 is built as a module
++ */
++#if IS_BUILTIN(CONFIG_IPV6)
++#define INDIRECT_CALL_L4(f, f2, f1, ...) INDIRECT_CALL_2(f, f2, f1, __VA_ARGS__)
++#else
++#define INDIRECT_CALL_L4(f, f2, f1, ...) INDIRECT_CALL_1(f, f2, __VA_ARGS__)
++#endif
++
++#define indirect_call_gro_receive_l4(f2, f1, cb, head, skb) \
++({ \
++ unlikely(gro_recursion_inc_test(skb)) ? \
++ NAPI_GRO_CB(skb)->flush |= 1, NULL : \
++ INDIRECT_CALL_L4(cb, f2, f1, head, skb); \
++})
++
+ static int ipv6_gso_pull_exthdrs(struct sk_buff *skb, int proto)
+ {
+ const struct net_offload *ops = NULL;
+@@ -162,6 +179,10 @@ static int ipv6_exthdrs_len(struct ipv6hdr *iph,
+ return len;
+ }
+
++INDIRECT_CALLABLE_DECLARE(struct sk_buff **tcp6_gro_receive(struct sk_buff **,
++ struct sk_buff *));
++INDIRECT_CALLABLE_DECLARE(struct sk_buff **udp6_gro_receive(struct sk_buff **,
++ struct sk_buff *));
+ INDIRECT_CALLABLE_SCOPE
+ struct sk_buff **ipv6_gro_receive(struct sk_buff **head, struct sk_buff *skb)
+ {
+@@ -251,7 +272,8 @@ struct sk_buff **ipv6_gro_receive(struct sk_buff **head, struct sk_buff *skb)
+
+ skb_gro_postpull_rcsum(skb, iph, nlen);
+
+- pp = call_gro_receive(ops->callbacks.gro_receive, head, skb);
++ pp = indirect_call_gro_receive_l4(tcp6_gro_receive, udp6_gro_receive,
++ ops->callbacks.gro_receive, head, skb);
+
+ out_unlock:
+ rcu_read_unlock();
+@@ -292,6 +314,8 @@ static struct sk_buff **ip4ip6_gro_receive(struct sk_buff **head,
+ return inet_gro_receive(head, skb);
+ }
+
++INDIRECT_CALLABLE_DECLARE(int tcp6_gro_complete(struct sk_buff *, int));
++INDIRECT_CALLABLE_DECLARE(int udp6_gro_complete(struct sk_buff *, int));
+ INDIRECT_CALLABLE_SCOPE int ipv6_gro_complete(struct sk_buff *skb, int nhoff)
+ {
+ const struct net_offload *ops;
+@@ -311,7 +335,8 @@ INDIRECT_CALLABLE_SCOPE int ipv6_gro_complete(struct sk_buff *skb, int nhoff)
+ if (WARN_ON(!ops || !ops->callbacks.gro_complete))
+ goto out_unlock;
+
+- err = ops->callbacks.gro_complete(skb, nhoff);
++ err = INDIRECT_CALL_L4(ops->callbacks.gro_complete, tcp6_gro_complete,
++ udp6_gro_complete, skb, nhoff);
+
+ out_unlock:
+ rcu_read_unlock();
+--- a/net/ipv6/tcpv6_offload.c
++++ b/net/ipv6/tcpv6_offload.c
+@@ -9,14 +9,15 @@
+ *
+ * TCPv6 GSO/GRO support
+ */
++#include <linux/indirect_call_wrapper.h>
+ #include <linux/skbuff.h>
+ #include <net/protocol.h>
+ #include <net/tcp.h>
+ #include <net/ip6_checksum.h>
+ #include "ip6_offload.h"
+
+-static struct sk_buff **tcp6_gro_receive(struct sk_buff **head,
+- struct sk_buff *skb)
++INDIRECT_CALLABLE_SCOPE
++struct sk_buff **tcp6_gro_receive(struct sk_buff **head, struct sk_buff *skb)
+ {
+ /* Don't bother verifying checksum if we're going to flush anyway. */
+ if (!NAPI_GRO_CB(skb)->flush &&
+@@ -29,7 +30,7 @@ static struct sk_buff **tcp6_gro_receive(struct sk_buff **head,
+ return tcp_gro_receive(head, skb);
+ }
+
+-static int tcp6_gro_complete(struct sk_buff *skb, int thoff)
++INDIRECT_CALLABLE_SCOPE int tcp6_gro_complete(struct sk_buff *skb, int thoff)
+ {
+ const struct ipv6hdr *iph = ipv6_hdr(skb);
+ struct tcphdr *th = tcp_hdr(skb);
+--- a/net/ipv6/udp_offload.c
++++ b/net/ipv6/udp_offload.c
+@@ -11,6 +11,7 @@
+ */
+ #include <linux/skbuff.h>
+ #include <linux/netdevice.h>
++#include <linux/indirect_call_wrapper.h>
+ #include <net/protocol.h>
+ #include <net/ipv6.h>
+ #include <net/udp.h>
+@@ -111,8 +112,8 @@ static struct sk_buff *udp6_ufo_fragment(struct sk_buff *skb,
+ return segs;
+ }
+
+-static struct sk_buff **udp6_gro_receive(struct sk_buff **head,
+- struct sk_buff *skb)
++INDIRECT_CALLABLE_SCOPE
++struct sk_buff **udp6_gro_receive(struct sk_buff **head, struct sk_buff *skb)
+ {
+ struct udphdr *uh = udp_gro_udphdr(skb);
+
+@@ -139,7 +140,7 @@ static struct sk_buff **udp6_gro_receive(struct sk_buff **head,
+ return NULL;
+ }
+
+-static int udp6_gro_complete(struct sk_buff *skb, int nhoff)
++INDIRECT_CALLABLE_SCOPE int udp6_gro_complete(struct sk_buff *skb, int nhoff)
+ {
+ const struct ipv6hdr *ipv6h = ipv6_hdr(skb);
+ struct udphdr *uh = (struct udphdr *)(skb->data + nhoff);
diff --git a/patches.fixes/udp-use-indirect-call-wrappers-for-GRO-socket-lookup.patch b/patches.fixes/udp-use-indirect-call-wrappers-for-GRO-socket-lookup.patch
new file mode 100644
index 0000000000..9d0dd3e1f2
--- /dev/null
+++ b/patches.fixes/udp-use-indirect-call-wrappers-for-GRO-socket-lookup.patch
@@ -0,0 +1,52 @@
+From: Paolo Abeni <pabeni@redhat.com>
+Date: Fri, 14 Dec 2018 11:52:00 +0100
+Subject: udp: use indirect call wrappers for GRO socket lookup
+Patch-mainline: v5.0-rc1
+Git-commit: 4f24ed77dec9b067d08f7958a287cbf48665f35e
+References: bsc#1124503
+
+This avoids another indirect call for UDP GRO. Again, the test
+for the IPv6 variant is performed first.
+
+v1 -> v2:
+ - adapted to INDIRECT_CALL_ changes
+
+Signed-off-by: Paolo Abeni <pabeni@redhat.com>
+Signed-off-by: David S. Miller <davem@davemloft.net>
+Acked-by: Michal Kubecek <mkubecek@suse.cz>
+
+---
+ net/ipv4/udp_offload.c | 8 ++++++--
+ 1 file changed, 6 insertions(+), 2 deletions(-)
+
+--- a/net/ipv4/udp_offload.c
++++ b/net/ipv4/udp_offload.c
+@@ -245,6 +245,8 @@ static struct sk_buff *udp4_ufo_fragment(struct sk_buff *skb,
+ return segs;
+ }
+
++INDIRECT_CALLABLE_DECLARE(struct sock *udp6_lib_lookup_skb(struct sk_buff *skb,
++ __be16 sport, __be16 dport));
+ struct sk_buff **udp_gro_receive(struct sk_buff **head, struct sk_buff *skb,
+ struct udphdr *uh, udp_lookup_t lookup)
+ {
+@@ -264,7 +266,8 @@ struct sk_buff **udp_gro_receive(struct sk_buff **head, struct sk_buff *skb,
+ NAPI_GRO_CB(skb)->encap_mark = 1;
+
+ rcu_read_lock();
+- sk = (*lookup)(skb, uh->source, uh->dest);
++ sk = INDIRECT_CALL_INET(lookup, udp6_lib_lookup_skb,
++ udp4_lib_lookup_skb, skb, uh->source, uh->dest);
+
+ if (sk && udp_sk(sk)->gro_receive)
+ goto unflush;
+@@ -344,7 +347,8 @@ int udp_gro_complete(struct sk_buff *skb, int nhoff,
+ skb->encapsulation = 1;
+
+ rcu_read_lock();
+- sk = (*lookup)(skb, uh->source, uh->dest);
++ sk = INDIRECT_CALL_INET(lookup, udp6_lib_lookup_skb,
++ udp4_lib_lookup_skb, skb, uh->source, uh->dest);
+ if (sk && udp_sk(sk)->gro_complete)
+ err = udp_sk(sk)->gro_complete(sk, skb,
+ nhoff + sizeof(struct udphdr));
diff --git a/series.conf b/series.conf
index cb2c9d229d..fc6c285455 100644
--- a/series.conf
+++ b/series.conf
@@ -20630,6 +20630,11 @@
patches.fixes/0001-net-mlx5-Release-resource-on-error-flow.patch
patches.fixes/0001-net-mlx5-Return-success-for-PAGE_FAULT_RESUME-in-int.patch
patches.fixes/0001-net-mlx5-Use-multi-threaded-workqueue-for-page-fault.patch
+ patches.fixes/indirect-call-wrappers-helpers-to-speed-up-indirect-.patch
+ patches.fixes/net-use-indirect-call-wrappers-at-GRO-network-layer.patch
+ patches.fixes/net-use-indirect-call-wrappers-at-GRO-transport-laye.patch
+ patches.fixes/udp-use-indirect-call-wrappers-for-GRO-socket-lookup.patch
+ patches.fixes/net-unbreak-CONFIG_RETPOLINE-n-builds.patch
patches.fixes/mac80211-fix-radiotap-vendor-presence-bitmap-handlin.patch
patches.drivers/Bluetooth-Fix-unnecessary-error-message-for-HCI-requ.patch
patches.fixes/igb-Fix-an-issue-that-PME-is-not-enabled-during-runt.patch