summaryrefslogtreecommitdiffstats
path: root/net
diff options
context:
space:
mode:
authorBjörn Töpel <bjorn.topel@intel.com>2020-01-20 10:29:17 +0100
committerDaniel Borkmann <daniel@iogearbox.net>2020-01-22 00:08:52 +0100
commit43a825afc91e2b06af1e8e7422198e759c2c5e20 (patch)
tree2d3ea0e73f127ff6e3eb06dc5beb8fad7e44e798 /net
parentb87121dd3fa0a4d2636c0ad02a3b3fc5161fa26b (diff)
downloadlinux-43a825afc91e2b06af1e8e7422198e759c2c5e20.tar.bz2
xsk, net: Make sock_def_readable() have external linkage
XDP sockets use the default implementation of struct sock's sk_data_ready callback, which is sock_def_readable(). This function is called in the XDP socket fast-path, and involves a retpoline. By letting sock_def_readable() have external linkage, and being called directly, the retpoline can be avoided. Signed-off-by: Björn Töpel <bjorn.topel@intel.com> Signed-off-by: Daniel Borkmann <daniel@iogearbox.net> Link: https://lore.kernel.org/bpf/20200120092917.13949-1-bjorn.topel@gmail.com
Diffstat (limited to 'net')
-rw-r--r--net/core/sock.c2
-rw-r--r--net/xdp/xsk.c2
2 files changed, 2 insertions, 2 deletions
diff --git a/net/core/sock.c b/net/core/sock.c
index 8459ad579f73..a4c8fac781ff 100644
--- a/net/core/sock.c
+++ b/net/core/sock.c
@@ -2786,7 +2786,7 @@ static void sock_def_error_report(struct sock *sk)
rcu_read_unlock();
}
-static void sock_def_readable(struct sock *sk)
+void sock_def_readable(struct sock *sk)
{
struct socket_wq *wq;
diff --git a/net/xdp/xsk.c b/net/xdp/xsk.c
index 02ada7ab8c6e..df600487a68d 100644
--- a/net/xdp/xsk.c
+++ b/net/xdp/xsk.c
@@ -217,7 +217,7 @@ static int xsk_rcv(struct xdp_sock *xs, struct xdp_buff *xdp)
static void xsk_flush(struct xdp_sock *xs)
{
xskq_prod_submit(xs->rx);
- xs->sk.sk_data_ready(&xs->sk);
+ sock_def_readable(&xs->sk);
}
int xsk_generic_rcv(struct xdp_sock *xs, struct xdp_buff *xdp)