[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CAJ+HfNirBncXGcath_MKpzbcf3JRBRU7ThpapCQh_zMNqQVtxQ@mail.gmail.com>
Date: Tue, 21 Jan 2020 13:06:54 +0100
From: Björn Töpel <bjorn.topel@...il.com>
To: John Fastabend <john.fastabend@...il.com>
Cc: Netdev <netdev@...r.kernel.org>,
Alexei Starovoitov <ast@...nel.org>,
Daniel Borkmann <daniel@...earbox.net>,
Björn Töpel <bjorn.topel@...el.com>,
bpf <bpf@...r.kernel.org>,
"Karlsson, Magnus" <magnus.karlsson@...el.com>,
Jonathan Lemon <jonathan.lemon@...il.com>
Subject: Re: [PATCH bpf-next] xsk, net: make sock_def_readable() have external linkage
On Tue, 21 Jan 2020 at 01:48, John Fastabend <john.fastabend@...il.com> wrote:
>
> Björn Töpel wrote:
> > From: Björn Töpel <bjorn.topel@...el.com>
> >
> > 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@...el.com>
> > ---
> > include/net/sock.h | 2 ++
> > net/core/sock.c | 2 +-
> > net/xdp/xsk.c | 2 +-
> > 3 files changed, 4 insertions(+), 2 deletions(-)
> >
>
> I think this is fine but curious were you able to measure the
> difference with before/after pps or something?
Ugh, yeah, of course I've should have added that. Sorry for that! Here
goes; Benchmark is xdpsock rxdrop, NAPI running on core 20:
**Pre-patch: xdpsock rxdrop: 22.8 Mpps
Performance counter stats for 'CPU(s) 20':
10,000.58 msec cpu-clock # 1.000 CPUs
utilized
12 context-switches # 0.001 K/sec
1 cpu-migrations # 0.000 K/sec
0 page-faults # 0.000 K/sec
29,931,407,416 cycles # 2.993 GHz
82,538,852,331 instructions # 2.76 insn per
cycle
15,894,169,979 branches # 1589.324 M/sec
30,916,486 branch-misses # 0.19% of all
branches
10.000636027 seconds time elapsed
**Post-patch: xdpsock rxdrop: 23.2 Mpps
10,000.90 msec cpu-clock # 1.000 CPUs
utilized
12 context-switches # 0.001 K/sec
1 cpu-migrations # 0.000 K/sec
0 page-faults # 0.000 K/sec
29,932,353,067 cycles # 2.993 GHz
84,299,636,827 instructions # 2.82 insn per
cycle
16,228,795,437 branches # 1622.733 M/sec
28,113,847 branch-misses # 0.17% of all
branches
10.000596454 seconds time elapsed
This could fall into the category of noise. :-) PPS and IPC is up a
bit. OTOH, maybe UDP can benefit from this as well?
Björn
Powered by blists - more mailing lists