qemu-devel
[Top][All Lists]
Advanced

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

Re: [Qemu-devel] [RFC 0/1] Add BPF suuport to Qemu


From: Sameeh Jubran
Subject: Re: [Qemu-devel] [RFC 0/1] Add BPF suuport to Qemu
Date: Wed, 20 Jun 2018 17:40:59 +0300

On Wed, Jun 20, 2018 at 11:13 AM, Jason Wang <address@hidden> wrote:

>
>
> On 2018年06月19日 21:21, Sameeh Jubran wrote:
>
>> From: Sameeh Jubran <address@hidden>
>>
>> The Berkeley Packet Filter has been in the kernel for a while now and I
>> think it is time that it is introduced to Qemu. This patch is an
>> infrastructure for any future usage of the BPF in Qemu.
>>
>> It is important to note that the tun driver had started supporting using
>> BPF programs through ioctls (TUNSETSTEERINGEBPF and TUNSETFILTEREBPF).
>>
>> At first, instead of adding the syscall wrappers, I wanted to integrate
>> libbpf
>> library which resides in the Linux source tree under tools/lib/bpf. It
>> appears
>> to be that by default it compiles to x64 on x64 arch - which can't be
>> integrated into Qemu  - and my attempts to compile the 32 bit versions
>> have
>> failed. What's more interesting is that the vendors don't provide this
>> library
>> in any package, which makes this library a nasty dependency.
>>
>> Please share your thoughts :)
>>
>
> I wonder, instead of a generic eBPF support, can we have a limited but
> sufficient eBPF suppor for TAP only (see dpdk tap driver)? E.g if we only
> do bytecode loading, there's no need for e.g map update helpers.
>
That can do, I am actually using the map update helpers in the code as I am
using it to pass RSS configuration to the kernel program. The motive behind
adding the code this way is to add it as an infrastructure that others can
use in the future.

BTW I think I made a mistake, as it turns out I can add libbpf and it is
much neater than adding the syscall wrappers this way as the code is taken
straight from the linux kernel and can be updated easily using the
scripts's tool - update-linux-headers.sh. I'll prepare the patches and send
them soon.

>
> Thanks
>
>
>
>> Sameeh Jubran (1):
>>    Add BPF support to qemu
>>
>>   MAINTAINERS                     |   7 +
>>   bpf/Makefile.objs               |   1 +
>>   bpf/bpf_syscall.c               |  98 ++++++
>>   include/bpf/bpf_syscall.h       |  35 +++
>>   linux-headers/linux/bpf.h       | 673 ++++++++++++++++++++++++++++++
>> ++++++++++
>>   scripts/update-linux-headers.sh |   3 +-
>>   6 files changed, 816 insertions(+), 1 deletion(-)
>>   create mode 100644 bpf/Makefile.objs
>>   create mode 100644 bpf/bpf_syscall.c
>>   create mode 100644 include/bpf/bpf_syscall.h
>>   create mode 100644 linux-headers/linux/bpf.h
>>
>>
>


-- 
Respectfully,
*Sameeh Jubran*
*Linkedin <https://il.linkedin.com/pub/sameeh-jubran/87/747/a8a>*
*Software Engineer @ Daynix <http://www.daynix.com>.*


reply via email to

[Prev in Thread] Current Thread [Next in Thread]