archive mirror
 help / color / mirror / Atom feed
From: Pavel Begunkov <>
To: Jens Axboe <>,
Subject: [RFC 0/4] add BPF-driven requests
Date: Wed, 17 Feb 2021 12:38:02 +0000	[thread overview]
Message-ID: <> (raw)

Pretty much an RFC for executing BPF requests in io_uring to start a
discussion, so any ideas and wish lists are welcom. Some technical
but not much important for the discussion detais are omitted in the
patchset, i.e. good cancellation system, optimisations and some BPF
specific parts.

Some of major missing points:
1. We need to pass an CQE/result of a previous linked request to BPF.

2. Whether to keep to a new IORING_OP_BPF opcode, or do it in a common
path for each request, e.g. on CQE completion. The former looks saner,
but is not nicely aligned with (1.).

3. Allow BPF programs to generate CQEs not binded to a request. A
problem can be with supporting overflowed CQEs, it's either to
always kmalloc()'ing storage for them instead of using req's memory
or piling up on top. Eventually we will need it anyway to be able
to post several CQEs for a single requests.

Pavel Begunkov (4):
  bpf: add IOURING program type
  io_uring: implement bpf prog registration
  io_uring: add IORING_OP_BPF
  io_uring: enable BPF to submit SQEs

 fs/io_uring.c                 | 259 +++++++++++++++++++++++++++++++++-
 include/linux/bpf_types.h     |   2 +
 include/uapi/linux/bpf.h      |   2 +
 include/uapi/linux/io_uring.h |   3 +
 kernel/bpf/syscall.c          |   1 +
 kernel/bpf/verifier.c         |   3 +
 6 files changed, 264 insertions(+), 6 deletions(-)


             reply	other threads:[~2021-02-17 12:42 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-02-17 12:38 Pavel Begunkov [this message]
2021-02-17 12:38 ` [PATCH 1/4] bpf: add IOURING program type Pavel Begunkov
2021-02-17 12:38 ` [PATCH 2/4] io_uring: implement bpf prog registration Pavel Begunkov
2021-02-17 12:38 ` [PATCH 3/4] io_uring: add IORING_OP_BPF Pavel Begunkov
2021-02-17 12:38 ` [PATCH 4/4] io_uring: enable BPF to submit SQEs Pavel Begunkov

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:

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \ \ \ \ \
    --subject='Re: [RFC 0/4] add BPF-driven requests' \

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link

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).