lkml.org 
[lkml]   [2023]   [Sep]   [5]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH] samples/bpf: Add sample usage for BPF_PROG_TYPE_NETFILTER











At 2023-09-05 05:01:14, "Alexei Starovoitov" <alexei.starovoitov@gmail.com> wrote:
>On Mon, Sep 4, 2023 at 3:49 AM Florian Westphal <fw@strlen.de> wrote:
>>
>> David Wang <00107082@163.com> wrote:
>> > This sample code implements a simple ipv4
>> > blacklist via the new bpf type BPF_PROG_TYPE_NETFILTER,
>> > which was introduced in 6.4.
>> >
>> > The bpf program drops package if destination ip address
>> > hits a match in the map of type BPF_MAP_TYPE_LPM_TRIE,
>> >
>> > The userspace code would load the bpf program,
>> > attach it to netfilter's FORWARD/OUTPUT hook,
>> > and then write ip patterns into the bpf map.
>>
>> Thanks, I think its good to have this.
>
>Yes, but only in selftests/bpf.
>samples/bpf/ are not tested and bit rot heavily.

Hi Alexei,

I need to know whether samples/bpf is still a good place to put code.
I will put the code in another open source project for bpf samples, mentioned by Toke.
But I still want to put it in samples/bpf , since the code only compile/work with new kernel.

Need your feedback on this, could this code be kept in samples/bpf? :)

Thanks
David.
\
 
 \ /
  Last update: 2023-09-05 18:43    [W:0.123 / U:0.252 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site