From: dthaler1968@googlemail.com
To: "'Andrii Nakryiko'" <andrii.nakryiko@gmail.com>,
"'Shankar Seal'" <Shankar.Seal=40microsoft.com@dmarc.ietf.org>
Cc: <bpf@ietf.org>, <bpf@vger.kernel.org>
Subject: RE: [Bpf] Re: Writing into a ring buffer map from user space
Date: Tue, 28 May 2024 10:42:56 -0700 [thread overview]
Message-ID: <0c4801dab126$7a502fc0$6ef08f40$@gmail.com> (raw)
In-Reply-To: <CAEf4BzZf=7Sb9Zf7Bt_oJh=Pq6b=03wspmr8iJSY-KRyJVZ3nw@mail.gmail.com>
Andrii Nakryiko <andrii.nakryiko@gmail.com> wrote:
> On Tue, May 28, 2024 at 9:32 AM Shankar Seal
> <Shankar.Seal=40microsoft.com@dmarc.ietf.org> wrote:
> >
> > Adding bpf@vger.kernel.org
> >
> > A common use case of an BPF ring buffer map to use as a queue of
> > events generated by BPF programs that can be read in-order by user
> > space applications. I have a scenario requirement for a user space
> > application to write into a ring buffer (or similar) map, such that
> > events by BPF programs in kernel and user space applications are
> > interleaved in the order they were generated, that can be consumed by
> > another user space application
> >
> > I would like to implement this new feature in the
> https://github.com/microsoft/ebpf-for-windows project. But before I go ahead with
> the implementation, I wanted to check if there is any way to accomplish this in
> Linux today? If not, is there any reason why this should not be done?
>
> Yes, there is. See user_ring_buffer ([0], [1]).
>
> [0]
> https://github.com/torvalds/linux/blob/master/tools/testing/selftests/bpf/prog_tests/
> user_ringbuf.c
> [1]
> https://github.com/torvalds/linux/blob/master/tools/testing/selftests/bpf/progs/user_
> ringbuf_success.c
Both of those links go to GPL code so I suspect Shankar cannot use those links.
I think the answer is that BPF_MAP_TYPE_USER_RINGBUF is defined for this
purpose and Shankar can read https://lwn.net/Articles/907056/
Thanks,
Dave
WARNING: multiple messages have this Message-ID (diff)
From: dthaler1968=40googlemail.com@dmarc.ietf.org
To: "'Andrii Nakryiko'" <andrii.nakryiko@gmail.com>,
"'Shankar Seal'" <Shankar.Seal=40microsoft.com@dmarc.ietf.org>
Cc: bpf@ietf.org, bpf@vger.kernel.org
Subject: [Bpf] Re: Writing into a ring buffer map from user space
Date: Tue, 28 May 2024 10:42:56 -0700 [thread overview]
Message-ID: <0c4801dab126$7a502fc0$6ef08f40$@gmail.com> (raw)
Message-ID: <20240528174256.PUopE8NXr4diVqo31qbe0jkStfoBJB5xy8PexHAEqco@z> (raw)
In-Reply-To: <CAEf4BzZf=7Sb9Zf7Bt_oJh=Pq6b=03wspmr8iJSY-KRyJVZ3nw@mail.gmail.com>
Andrii Nakryiko <andrii.nakryiko@gmail.com> wrote:
> On Tue, May 28, 2024 at 9:32 AM Shankar Seal
> <Shankar.Seal=40microsoft.com@dmarc.ietf.org> wrote:
> >
> > Adding bpf@vger.kernel.org
> >
> > A common use case of an BPF ring buffer map to use as a queue of
> > events generated by BPF programs that can be read in-order by user
> > space applications. I have a scenario requirement for a user space
> > application to write into a ring buffer (or similar) map, such that
> > events by BPF programs in kernel and user space applications are
> > interleaved in the order they were generated, that can be consumed by
> > another user space application
> >
> > I would like to implement this new feature in the
> https://github.com/microsoft/ebpf-for-windows project. But before I go ahead with
> the implementation, I wanted to check if there is any way to accomplish this in
> Linux today? If not, is there any reason why this should not be done?
>
> Yes, there is. See user_ring_buffer ([0], [1]).
>
> [0]
> https://github.com/torvalds/linux/blob/master/tools/testing/selftests/bpf/prog_tests/
> user_ringbuf.c
> [1]
> https://github.com/torvalds/linux/blob/master/tools/testing/selftests/bpf/progs/user_
> ringbuf_success.c
Both of those links go to GPL code so I suspect Shankar cannot use those links.
I think the answer is that BPF_MAP_TYPE_USER_RINGBUF is defined for this
purpose and Shankar can read https://lwn.net/Articles/907056/
Thanks,
Dave
--
Bpf mailing list -- bpf@ietf.org
To unsubscribe send an email to bpf-leave@ietf.org
next prev parent reply other threads:[~2024-05-28 17:43 UTC|newest]
Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <PH0PR21MB19101A296E6A180AD99EDD3898F12@PH0PR21MB1910.namprd21.prod.outlook.com>
2024-05-28 16:32 ` [Bpf] Re: Writing into a ring buffer map from user space Shankar Seal
2024-05-28 17:29 ` Andrii Nakryiko
2024-05-28 17:29 ` Andrii Nakryiko
2024-05-28 17:42 ` dthaler1968 [this message]
2024-05-28 17:42 ` dthaler1968=40googlemail.com
2024-06-06 5:01 ` [Bpf] Re: [EXTERNAL] " Shankar Seal
2024-06-21 6:49 ` Shankar Seal
2024-06-25 3:36 ` Andrii Nakryiko
2024-06-25 3:50 ` Shankar Seal
2024-06-26 23:43 ` Andrii Nakryiko
2024-06-29 6:44 ` Shankar Seal
2024-06-29 6:44 ` Shankar Seal
2024-07-02 0:54 ` Andrii Nakryiko
2024-07-02 0:54 ` Andrii Nakryiko
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='0c4801dab126$7a502fc0$6ef08f40$@gmail.com' \
--to=dthaler1968@googlemail.com \
--cc=Shankar.Seal=40microsoft.com@dmarc.ietf.org \
--cc=andrii.nakryiko@gmail.com \
--cc=bpf@ietf.org \
--cc=bpf@vger.kernel.org \
/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.