Re: [PATCH] bpf: make ringbuf available to modules

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On 7/5/23 3:20 PM, Anton Ivanov wrote:
On 05/07/2023 12:41, Daniel Borkmann wrote:
On 7/5/23 11:19 AM, anton.ivanov@xxxxxxxxxxxxxxxxxx wrote:
From: Anton Ivanov <anton.ivanov@xxxxxxxxxxxxxxxxxx>

Ringbuf which was developed as a part of BPF infrastructure is
a very nice, clean, simple and consise API to relay information
from the kernel to userspace. It can be used in critical sections,
interrupt handlers, etc.

This patch exports ringbuf functionality to make it available to
kernel modules.

Demo: https://github.com/kot-begemot-uk/bpfnic-ng

The demo ships to userspace hardware offload notifications
without any mallocs, any workqueue and/or delayed work which
is normally needed to handle these. As a result it is ~ 150
lines of code instead of the 500+ usually needed to achieve the
same result.

Signed-off-by: Anton Ivanov <anton.ivanov@xxxxxxxxxxxxxxxxxx>

Given this is only for out-of-tree code, we cannot merge this patch.

The out of tree code is simply a demo what you can do with ringbuf outside BPF.

Ringbuf can save anyone writing a device driver quite a lot of work. It is a "ready made" IPC with userspace which requires half the code of any alternative (character device drivers, shared memory, etc).

What I am proposing is that it to make it generic and not BPF only.

That is probably an okay goal (depends on the concrete situation / proposal),
but still this needs to be in upstream tree given we cannot cater for anything
out-of-tree and exporting symbols without good reason for an in-tree user is
and always has been a red flag.

Thanks,
Daniel




[Index of Archives]     [Linux Samsung SoC]     [Linux Rockchip SoC]     [Linux Actions SoC]     [Linux for Synopsys ARC Processors]     [Linux NFS]     [Linux NILFS]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]


  Powered by Linux