[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <87ae3eae-84b4-40eb-a637-b65161bdc1ed@daynix.com>
Date: Tue, 19 Dec 2023 21:16:32 +0900
From: Akihiko Odaki <akihiko.odaki@...nix.com>
To: Song Liu <song@...nel.org>
Cc: Alexei Starovoitov <alexei.starovoitov@...il.com>,
Jason Wang <jasowang@...hat.com>, Alexei Starovoitov <ast@...nel.org>,
Daniel Borkmann <daniel@...earbox.net>, Andrii Nakryiko <andrii@...nel.org>,
Martin KaFai Lau <martin.lau@...ux.dev>,
Yonghong Song <yonghong.song@...ux.dev>,
John Fastabend <john.fastabend@...il.com>, KP Singh <kpsingh@...nel.org>,
Stanislav Fomichev <sdf@...gle.com>, Hao Luo <haoluo@...gle.com>,
Jiri Olsa <jolsa@...nel.org>, Jonathan Corbet <corbet@....net>,
Willem de Bruijn <willemdebruijn.kernel@...il.com>,
"David S. Miller" <davem@...emloft.net>, Eric Dumazet <edumazet@...gle.com>,
Jakub Kicinski <kuba@...nel.org>, Paolo Abeni <pabeni@...hat.com>,
"Michael S. Tsirkin" <mst@...hat.com>, Xuan Zhuo
<xuanzhuo@...ux.alibaba.com>, Mykola Lysenko <mykolal@...com>,
Shuah Khan <shuah@...nel.org>, Yuri Benditovich
<yuri.benditovich@...nix.com>, Andrew Melnychenko <andrew@...nix.com>,
Benjamin Tissoires <bentiss@...nel.org>, bpf <bpf@...r.kernel.org>,
"open list:DOCUMENTATION" <linux-doc@...r.kernel.org>, kvm@...r.kernel.org,
LKML <linux-kernel@...r.kernel.org>,
virtualization@...ts.linux-foundation.org,
"open list:KERNEL SELFTEST FRAMEWORK" <linux-kselftest@...r.kernel.org>,
Network Development <netdev@...r.kernel.org>
Subject: Re: Should I add BPF kfuncs for userspace apps? And how?
On 2023/12/19 4:56, Song Liu wrote:
> Hi Akihiko,
>
> On Tue, Dec 12, 2023 at 12:05 AM Akihiko Odaki <akihiko.odaki@...nix.com> wrote:
>>
> [...]
>> ---
>>
>> I'm working on a new feature that aids virtio-net implementations using
>> tuntap virtual network device. You can see [1] for details, but
>> basically it's to extend BPF_PROG_TYPE_SOCKET_FILTER to report four more
>> bytes.
>
> AFAICT, [1] adds a new program type, which is really hard to ship. However,
> you mentioned it is basically "extend BPF_PROG_TYPE_SOCKET_FILTER to
> report four more bytes", which confuses me.
>
> Can we achieve the same goal by extending BPF_PROG_TYPE_SOCKET_FILTER
> (without adding a new program type)? Does this require extending
> __sk_buff, which
> is also not an option any more?
It is certainly possible to achieve the same result by extending
BPF_PROG_TYPE_SOCKET_FILTER.
It is not required to extend __sk_buff; we can repurpose the cb member.
But I think such an API will be error-prone than new members dedicated
for this particular purpose.
Regards,
Akihiko Odaki
Powered by blists - more mailing lists