bpf.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: "Björn Töpel" <bjorn.topel@gmail.com>
To: netdev@vger.kernel.org, ast@kernel.org, daniel@iogearbox.net,
	jakub.kicinski@netronome.com
Cc: "Björn Töpel" <bjorn.topel@gmail.com>,
	bpf@vger.kernel.org, magnus.karlsson@gmail.com,
	magnus.karlsson@intel.com, maciej.fijalkowski@intel.com,
	jonathan.lemon@gmail.com, toke@redhat.com
Subject: [PATCH bpf-next v4 0/3] xsk: XSKMAP performance improvements
Date: Thu, 31 Oct 2019 09:47:46 +0100	[thread overview]
Message-ID: <20191031084749.14626-1-bjorn.topel@gmail.com> (raw)

This set consists of three patches from Maciej and myself which are
optimizing the XSKMAP lookups.  In the first patch, the sockets are
moved to be stored at the tail of the struct xsk_map. The second
patch, Maciej implements map_gen_lookup() for XSKMAP. The third patch,
introduced in this revision, moves various XSKMAP functions, to permit
the compiler to do more aggressive inlining.

Based on the XDP program from tools/lib/bpf/xsk.c where
bpf_map_lookup_elem() is explicitly called, this work yields a 5%
improvement for xdpsock's rxdrop scenario. The last patch yields 2%
improvement.

Jonathan's Acked-by: for patch 1 and 2 was carried on to the v4. Note
that the overflow checks are done in the bpf_map_area_alloc() and
bpf_map_charge_init() functions, which was fixed in [1], but not
applied to the bpf tree yet.

Cheers,
Björn and Maciej

[1] https://patchwork.ozlabs.org/patch/1186170/

v1->v2: * Change size/cost to size_t and use {struct, array}_size
          where appropriate. (Jakub)
v2->v3: * Proper commit message for patch 2.
v3->v4: * Change size_t to u64 to handle 32-bit overflows. (Jakub)
        * Introduced patch 3

Björn Töpel (2):
  xsk: store struct xdp_sock as a flexible array member of the XSKMAP
  xsk: restructure/inline XSKMAP lookup/redirect/flush

Maciej Fijalkowski (1):
  bpf: implement map_gen_lookup() callback for XSKMAP

 include/linux/bpf.h    |  25 ---------
 include/net/xdp_sock.h |  51 ++++++++++++++-----
 kernel/bpf/xskmap.c    | 112 +++++++++++++----------------------------
 net/xdp/xsk.c          |  33 +++++++++++-
 4 files changed, 106 insertions(+), 115 deletions(-)

-- 
2.20.1


             reply	other threads:[~2019-10-31  8:48 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-10-31  8:47 Björn Töpel [this message]
2019-10-31  8:47 ` [PATCH bpf-next v4 1/3] xsk: store struct xdp_sock as a flexible array member of the XSKMAP Björn Töpel
2019-10-31  8:47 ` [PATCH bpf-next v4 2/3] bpf: implement map_gen_lookup() callback for XSKMAP Björn Töpel
2019-10-31 23:48   ` Daniel Borkmann
2019-11-01  8:31     ` Björn Töpel
2019-10-31  8:47 ` [PATCH bpf-next v4 3/3] xsk: restructure/inline XSKMAP lookup/redirect/flush 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=20191031084749.14626-1-bjorn.topel@gmail.com \
    --to=bjorn.topel@gmail.com \
    --cc=ast@kernel.org \
    --cc=bpf@vger.kernel.org \
    --cc=daniel@iogearbox.net \
    --cc=jakub.kicinski@netronome.com \
    --cc=jonathan.lemon@gmail.com \
    --cc=maciej.fijalkowski@intel.com \
    --cc=magnus.karlsson@gmail.com \
    --cc=magnus.karlsson@intel.com \
    --cc=netdev@vger.kernel.org \
    --cc=toke@redhat.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).