From: Jesper Dangaard Brouer <brouer@redhat.com>
To: "Björn Töpel" <bjorn.topel@gmail.com>
Cc: magnus.karlsson@intel.com, alexander.h.duyck@intel.com,
alexander.duyck@gmail.com, john.fastabend@gmail.com, ast@fb.com,
willemdebruijn.kernel@gmail.com, daniel@iogearbox.net,
mst@redhat.com, netdev@vger.kernel.org,
michael.lundkvist@ericsson.com, jesse.brandeburg@intel.com,
anjali.singhai@intel.com, qi.z.zhang@intel.com,
"Björn Töpel" <bjorn.topel@intel.com>,
brouer@redhat.com
Subject: Re: [PATCH bpf-next v3 15/15] samples/bpf: sample application and documentation for AF_XDP sockets
Date: Wed, 2 May 2018 22:59:03 +0200 [thread overview]
Message-ID: <20180502225903.39180be8@redhat.com> (raw)
In-Reply-To: <20180502110136.3738-16-bjorn.topel@gmail.com>
On Wed, 2 May 2018 13:01:36 +0200 Björn Töpel <bjorn.topel@gmail.com> wrote:
> +static void rx_drop(struct xdpsock *xsk)
> +{
> + struct xdp_desc descs[BATCH_SIZE];
> + unsigned int rcvd, i;
> +
> + rcvd = xq_deq(&xsk->rx, descs, BATCH_SIZE);
> + if (!rcvd)
> + return;
> +
> + for (i = 0; i < rcvd; i++) {
> + u32 idx = descs[i].idx;
> +
> + lassert(idx < NUM_FRAMES);
> +#if DEBUG_HEXDUMP
> + char *pkt;
> + char buf[32];
> +
> + pkt = xq_get_data(xsk, idx, descs[i].offset);
> + sprintf(buf, "idx=%d", idx);
> + hex_dump(pkt, descs[i].len, buf);
> +#endif
> + }
> +
> + xsk->rx_npkts += rcvd;
> +
> + umem_fill_to_kernel_ex(&xsk->umem->fq, descs, rcvd);
> +}
I would really like to see an option that can enable reading the
data/memory in the packet. Else the test is rather fake...
I hacked it myself manually to read first u32.
- Before: 10,771,083 pps
- After: 9,430,741 pps
The slowdown is not as big as I expected, which is good :-)
With perf stat I can see more LLC-load's, but not misses. It is not
getting registered as a cache-miss that I read data on the remote CPPU.
p.s. these tests are with mlx5 (which only have XDP_REDIRECT RX-side).
- -
Best regards,
Jesper Dangaard Brouer
MSc.CS, Principal Kernel Engineer at Red Hat
LinkedIn: http://www.linkedin.com/in/brouer
Before:
sudo ~/perf stat -C3 -e L1-icache-load-misses -e cycles -e instructions -e cache-misses -e cache-references -e LLC-store-misses -e LLC-store -e LLC-load-misses -e LLC-load -r 3 sleep 1
Performance counter stats for 'CPU(s) 3' (3 runs):
200,020 L1-icache-load-misses ( +- 0.76% ) (33.31%)
3,920,754,587 cycles ( +- 0.14% ) (44.50%)
3,062,308,209 instructions # 0.78 insn per cycle ( +- 0.28% ) (55.65%)
823 cache-misses # 0.011 % of all cache refs ( +- 70.81% ) (66.74%)
7,587,132 cache-references ( +- 0.48% ) (77.83%)
0 LLC-store-misses (77.83%)
384,401 LLC-store ( +- 2.97% ) (77.83%)
15 LLC-load-misses # 0.00% of all LL-cache hits ( +-100.00% ) (22.17%)
3,192,312 LLC-load ( +- 0.35% ) (22.17%)
1.001199221 seconds time elapsed ( +- 0.00% )
After:
$ sudo ~/perf stat -C3 -e L1-icache-load-misses -e cycles -e instructions -e cache-misses -e cache-references -e LLC-store-misses -e LLC-store -e LLC-load-misses -e LLC-load -r 3 sleep 1
Performance counter stats for 'CPU(s) 3' (3 runs):
154,921 L1-icache-load-misses ( +- 3.88% ) (33.31%)
3,924,791,213 cycles ( +- 0.10% ) (44.50%)
2,930,116,185 instructions # 0.75 insn per cycle ( +- 0.33% ) (55.65%)
342 cache-misses # 0.002 % of all cache refs ( +- 65.52% ) (66.74%)
15,810,892 cache-references ( +- 0.13% ) (77.83%)
0 LLC-store-misses (77.83%)
925,544 LLC-store ( +- 2.33% ) (77.83%)
155 LLC-load-misses # 0.00% of all LL-cache hits ( +- 67.22% ) (22.17%)
12,791,264 LLC-load ( +- 0.04% ) (22.17%)
1.001206058 seconds time elapsed ( +- 0.00% )
next prev parent reply other threads:[~2018-05-02 20:59 UTC|newest]
Thread overview: 47+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-05-02 11:01 [PATCH bpf-next v3 00/15] Introducing AF_XDP support Björn Töpel
2018-05-02 11:01 ` [PATCH bpf-next v3 01/15] net: initial AF_XDP skeleton Björn Töpel
2018-05-23 22:50 ` Stephen Hemminger
2018-05-24 6:38 ` Björn Töpel
2018-05-24 17:57 ` Alexei Starovoitov
2018-05-02 11:01 ` [PATCH bpf-next v3 02/15] xsk: add user memory registration support sockopt Björn Töpel
2018-05-04 12:34 ` Daniel Borkmann
2018-05-02 11:01 ` [PATCH bpf-next v3 03/15] xsk: add umem fill queue support and mmap Björn Töpel
2018-05-04 12:49 ` Daniel Borkmann
2018-05-02 11:01 ` [PATCH bpf-next v3 04/15] xsk: add Rx queue setup and mmap support Björn Töpel
2018-05-02 11:01 ` [PATCH bpf-next v3 05/15] xsk: add support for bind for Rx Björn Töpel
2018-05-02 11:01 ` [PATCH bpf-next v3 06/15] xsk: add Rx receive functions and poll support Björn Töpel
2018-05-04 12:59 ` Daniel Borkmann
2018-05-22 7:42 ` Björn Töpel
2018-05-02 11:01 ` [PATCH bpf-next v3 07/15] bpf: introduce new bpf AF_XDP map type BPF_MAP_TYPE_XSKMAP Björn Töpel
2018-10-08 15:31 ` Eric Dumazet
2018-10-08 16:05 ` Björn Töpel
2018-10-08 16:52 ` Björn Töpel
2018-10-08 16:55 ` Eric Dumazet
2018-10-08 17:04 ` Björn Töpel
2018-10-08 17:40 ` [PATCH bpf] xsk: do not call synchronize_net() under RCU read lock Björn Töpel
2018-10-09 0:30 ` Song Liu
2018-10-11 8:22 ` Daniel Borkmann
2018-05-02 11:01 ` [PATCH bpf-next v3 08/15] xsk: wire up XDP_DRV side of AF_XDP Björn Töpel
2018-05-02 11:01 ` [PATCH bpf-next v3 09/15] xsk: wire up XDP_SKB " Björn Töpel
2018-05-02 11:01 ` [PATCH bpf-next v3 10/15] xsk: add umem completion queue support and mmap Björn Töpel
2018-05-02 11:01 ` [PATCH bpf-next v3 11/15] xsk: add Tx queue setup and mmap support Björn Töpel
2018-05-02 11:01 ` [PATCH bpf-next v3 12/15] dev: packet: make packet_direct_xmit a common function Björn Töpel
2018-05-02 11:01 ` [PATCH bpf-next v3 13/15] xsk: support for Tx Björn Töpel
2018-05-02 11:01 ` [PATCH bpf-next v3 14/15] xsk: statistics support Björn Töpel
2018-05-02 11:01 ` [PATCH bpf-next v3 15/15] samples/bpf: sample application and documentation for AF_XDP sockets Björn Töpel
2018-05-02 20:59 ` Jesper Dangaard Brouer [this message]
2018-05-03 13:55 ` [PATCH bpf-next v3 00/15] Introducing AF_XDP support Willem de Bruijn
2018-05-03 15:07 ` David Miller
2018-05-03 22:49 ` Daniel Borkmann
2018-05-03 23:38 ` Alexei Starovoitov
2018-05-04 11:22 ` Magnus Karlsson
2018-05-05 0:34 ` Alexei Starovoitov
2018-05-07 9:13 ` Magnus Karlsson
2018-05-07 13:09 ` Jesper Dangaard Brouer
2018-05-07 19:47 ` Björn Töpel
2018-05-17 6:46 ` Björn Töpel
2018-05-18 3:38 ` Alexei Starovoitov
2018-05-18 13:43 ` Daniel Borkmann
2018-05-18 15:18 ` Björn Töpel
2018-05-18 16:17 ` Daniel Borkmann
2018-05-18 16:32 ` Björn Töpel
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20180502225903.39180be8@redhat.com \
--to=brouer@redhat.com \
--cc=alexander.duyck@gmail.com \
--cc=alexander.h.duyck@intel.com \
--cc=anjali.singhai@intel.com \
--cc=ast@fb.com \
--cc=bjorn.topel@gmail.com \
--cc=bjorn.topel@intel.com \
--cc=daniel@iogearbox.net \
--cc=jesse.brandeburg@intel.com \
--cc=john.fastabend@gmail.com \
--cc=magnus.karlsson@intel.com \
--cc=michael.lundkvist@ericsson.com \
--cc=mst@redhat.com \
--cc=netdev@vger.kernel.org \
--cc=qi.z.zhang@intel.com \
--cc=willemdebruijn.kernel@gmail.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.