From: Alexei Starovoitov <alexei.starovoitov@gmail.com>
To: Jason Wang <jasowang@redhat.com>
Cc: Akihiko Odaki <akihiko.odaki@daynix.com>,
Alexei Starovoitov <ast@kernel.org>,
Daniel Borkmann <daniel@iogearbox.net>,
Andrii Nakryiko <andrii@kernel.org>,
Martin KaFai Lau <martin.lau@linux.dev>,
Song Liu <song@kernel.org>,
Yonghong Song <yonghong.song@linux.dev>,
John Fastabend <john.fastabend@gmail.com>,
KP Singh <kpsingh@kernel.org>,
Stanislav Fomichev <sdf@google.com>, Hao Luo <haoluo@google.com>,
Jiri Olsa <jolsa@kernel.org>, Jonathan Corbet <corbet@lwn.net>,
Willem de Bruijn <willemdebruijn.kernel@gmail.com>,
"David S. Miller" <davem@davemloft.net>,
Eric Dumazet <edumazet@google.com>,
Jakub Kicinski <kuba@kernel.org>, Paolo Abeni <pabeni@redhat.com>,
"Michael S. Tsirkin" <mst@redhat.com>,
Xuan Zhuo <xuanzhuo@linux.alibaba.com>,
Mykola Lysenko <mykolal@fb.com>, Shuah Khan <shuah@kernel.org>,
bpf <bpf@vger.kernel.org>,
"open list:DOCUMENTATION" <linux-doc@vger.kernel.org>,
LKML <linux-kernel@vger.kernel.org>,
Network Development <netdev@vger.kernel.org>,
kvm@vger.kernel.org, virtualization@lists.linux-foundation.org,
"open list:KERNEL SELFTEST FRAMEWORK"
<linux-kselftest@vger.kernel.org>,
Yuri Benditovich <yuri.benditovich@daynix.com>,
Andrew Melnychenko <andrew@daynix.com>
Subject: Re: [RFC PATCH v2 1/7] bpf: Introduce BPF_PROG_TYPE_VNET_HASH
Date: Tue, 17 Oct 2023 12:03:48 -0700 [thread overview]
Message-ID: <CAADnVQLt8NWvP8qGWMPx=12PwWWE69P7aS2dbm=khAJkCnJEoQ@mail.gmail.com> (raw)
In-Reply-To: <CACGkMEs22078F7rSLEz6eQabkZZ=kujSONUNMThZz5Gp=YiidQ@mail.gmail.com>
On Mon, Oct 16, 2023 at 7:38 PM Jason Wang <jasowang@redhat.com> wrote:
>
> On Tue, Oct 17, 2023 at 7:53 AM Alexei Starovoitov
> <alexei.starovoitov@gmail.com> wrote:
> >
> > On Sun, Oct 15, 2023 at 10:10 AM Akihiko Odaki <akihiko.odaki@daynix.com> wrote:
> > >
> > > On 2023/10/16 1:07, Alexei Starovoitov wrote:
> > > > On Sun, Oct 15, 2023 at 7:17 AM Akihiko Odaki <akihiko.odaki@daynix.com> wrote:
> > > >>
> > > >> diff --git a/include/uapi/linux/bpf.h b/include/uapi/linux/bpf.h
> > > >> index 0448700890f7..298634556fab 100644
> > > >> --- a/include/uapi/linux/bpf.h
> > > >> +++ b/include/uapi/linux/bpf.h
> > > >> @@ -988,6 +988,7 @@ enum bpf_prog_type {
> > > >> BPF_PROG_TYPE_SK_LOOKUP,
> > > >> BPF_PROG_TYPE_SYSCALL, /* a program that can execute syscalls */
> > > >> BPF_PROG_TYPE_NETFILTER,
> > > >> + BPF_PROG_TYPE_VNET_HASH,
> > > >
> > > > Sorry, we do not add new stable program types anymore.
> > > >
> > > >> @@ -6111,6 +6112,10 @@ struct __sk_buff {
> > > >> __u8 tstamp_type;
> > > >> __u32 :24; /* Padding, future use. */
> > > >> __u64 hwtstamp;
> > > >> +
> > > >> + __u32 vnet_hash_value;
> > > >> + __u16 vnet_hash_report;
> > > >> + __u16 vnet_rss_queue;
> > > >> };
> > > >
> > > > we also do not add anything to uapi __sk_buff.
> > > >
> > > >> +const struct bpf_verifier_ops vnet_hash_verifier_ops = {
> > > >> + .get_func_proto = sk_filter_func_proto,
> > > >> + .is_valid_access = sk_filter_is_valid_access,
> > > >> + .convert_ctx_access = bpf_convert_ctx_access,
> > > >> + .gen_ld_abs = bpf_gen_ld_abs,
> > > >> +};
> > > >
> > > > and we don't do ctx rewrites like this either.
> > > >
> > > > Please see how hid-bpf and cgroup rstat are hooking up bpf
> > > > in _unstable_ way.
> > >
> > > Can you describe what "stable" and "unstable" mean here? I'm new to BPF
> > > and I'm worried if it may mean the interface stability.
> > >
> > > Let me describe the context. QEMU bundles an eBPF program that is used
> > > for the "eBPF steering program" feature of tun. Now I'm proposing to
> > > extend the feature to allow to return some values to the userspace and
> > > vhost_net. As such, the extension needs to be done in a way that ensures
> > > interface stability.
> >
> > bpf is not an option then.
> > we do not add stable bpf program types or hooks any more.
>
> Does this mean eBPF could not be used for any new use cases other than
> the existing ones?
It means that any new use of bpf has to be unstable for the time being.
> > If a kernel subsystem wants to use bpf it needs to accept the fact
> > that such bpf extensibility will be unstable and subsystem maintainers
> > can decide to remove such bpf support in the future.
>
> I don't see how it is different from the existing ones.
Can we remove BPF_CGROUP_RUN_PROG_INET_INGRESS hook along
with BPF_PROG_TYPE_CGROUP_SKB program type?
Obviously not.
We can refactor it. We can move it around, but not remove.
That's the difference in stable vs unstable.
next prev parent reply other threads:[~2023-10-17 19:04 UTC|newest]
Thread overview: 26+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-10-15 14:16 [RFC PATCH v2 0/7] tun: Introduce virtio-net hashing feature Akihiko Odaki
2023-10-15 14:16 ` [RFC PATCH v2 1/7] bpf: Introduce BPF_PROG_TYPE_VNET_HASH Akihiko Odaki
2023-10-15 16:07 ` Alexei Starovoitov
2023-10-15 17:10 ` Akihiko Odaki
2023-10-16 23:53 ` Alexei Starovoitov
2023-10-17 0:36 ` Willem de Bruijn
2023-10-17 2:38 ` Jason Wang
2023-10-17 19:03 ` Alexei Starovoitov [this message]
2023-10-17 19:19 ` Akihiko Odaki
2023-11-18 10:38 ` Akihiko Odaki
2023-11-18 16:08 ` Song Liu
2023-11-19 8:03 ` Akihiko Odaki
2023-11-19 21:02 ` Song Liu
2023-11-20 8:05 ` Akihiko Odaki
2023-11-22 5:25 ` Song Liu
2023-11-22 5:36 ` Akihiko Odaki
2023-12-10 7:03 ` Akihiko Odaki
2023-12-11 1:40 ` Song Liu
2023-12-11 5:04 ` Akihiko Odaki
2023-12-11 17:40 ` Song Liu
2023-10-15 14:16 ` [RFC PATCH v2 2/7] bpf: Add vnet_hash members to __sk_buff Akihiko Odaki
2023-10-15 14:16 ` [RFC PATCH v2 3/7] skbuff: Introduce SKB_EXT_TUN_VNET_HASH Akihiko Odaki
2023-10-15 14:16 ` [RFC PATCH v2 4/7] virtio_net: Add virtio_net_hdr_v1_hash_from_skb() Akihiko Odaki
2023-10-15 14:16 ` [RFC PATCH v2 5/7] tun: Support BPF_PROG_TYPE_VNET_HASH Akihiko Odaki
2023-10-15 14:16 ` [RFC PATCH v2 6/7] selftests/bpf: Test BPF_PROG_TYPE_VNET_HASH Akihiko Odaki
2023-10-15 14:16 ` [RFC PATCH v2 7/7] vhost_net: Support VIRTIO_NET_F_HASH_REPORT Akihiko Odaki
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='CAADnVQLt8NWvP8qGWMPx=12PwWWE69P7aS2dbm=khAJkCnJEoQ@mail.gmail.com' \
--to=alexei.starovoitov@gmail.com \
--cc=akihiko.odaki@daynix.com \
--cc=andrew@daynix.com \
--cc=andrii@kernel.org \
--cc=ast@kernel.org \
--cc=bpf@vger.kernel.org \
--cc=corbet@lwn.net \
--cc=daniel@iogearbox.net \
--cc=davem@davemloft.net \
--cc=edumazet@google.com \
--cc=haoluo@google.com \
--cc=jasowang@redhat.com \
--cc=john.fastabend@gmail.com \
--cc=jolsa@kernel.org \
--cc=kpsingh@kernel.org \
--cc=kuba@kernel.org \
--cc=kvm@vger.kernel.org \
--cc=linux-doc@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-kselftest@vger.kernel.org \
--cc=martin.lau@linux.dev \
--cc=mst@redhat.com \
--cc=mykolal@fb.com \
--cc=netdev@vger.kernel.org \
--cc=pabeni@redhat.com \
--cc=sdf@google.com \
--cc=shuah@kernel.org \
--cc=song@kernel.org \
--cc=virtualization@lists.linux-foundation.org \
--cc=willemdebruijn.kernel@gmail.com \
--cc=xuanzhuo@linux.alibaba.com \
--cc=yonghong.song@linux.dev \
--cc=yuri.benditovich@daynix.com \
/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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).