Received: by 2002:a05:7412:d8a:b0:e2:908c:2ebd with SMTP id b10csp3358171rdg; Tue, 17 Oct 2023 12:04:33 -0700 (PDT) X-Google-Smtp-Source: AGHT+IH3eY7sErro1TkfeCJv/7MSsFXcyucWb/xUTXjp3d+HCQ7yhJ7rXLA05OP1pSrc1UmOtfxn X-Received: by 2002:a05:6e02:1a46:b0:34f:bed6:60d4 with SMTP id u6-20020a056e021a4600b0034fbed660d4mr4341271ilv.10.1697569472657; Tue, 17 Oct 2023 12:04:32 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1697569472; cv=none; d=google.com; s=arc-20160816; b=NvPMEvrf9a2kexcuAF7r2MRCx9dMdyWRf4ucugLmEAPhEbVoyXSMungChH/bnpqLhu UAoXIGIq+DtYEbQVA3cU0MpFfcbZYt+QZB0XbdjV30RUtyqo51cHahmbpk8lFHdzY7pm KNPop9e7iSmpmx18rSm1TWwKj2xkTGCuBgf2D+x6uAr2Ln2jEzxcmHBlGZeeOnYnoz6I 01uCZKWSNivpRuB6FNF2az1i2G+3AWJbO9XUbfCE6atgADah1zfnIldXcBICEIetjbDX n7uaVa7s2QdMNX0Dce+i0LYYMHgtuSsH1YO5lrG9xOxvSRPQ9Pv2elCDErksxK7NIJSv v5iA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:cc:to:subject :message-id:date:from:in-reply-to:references:mime-version :dkim-signature; bh=3URO8PfjgnFnifpX9a/pgxt4rV16Mqdk8BmJm6wrjEE=; fh=gEhjCo+Dvpk4Z+UN/qgR6gVqfyb4oF9BLyWJY06iUdo=; b=juYNp71tSVvoRx8oSpESzN4pyeKSOr7swXIvsfmGdL2HFukC41IuLhihVwQpv92kd5 VJ2qIZAIp8VSE74rH4sIai/TjZp+Yl79+qi1iXQ+yDYKymuxQ8FlgzFP+qc5xGZUWZcw PdNz7/u74ygXjnCY6jBKaizXo5Afkpw2A7kU5fA7E7qNWmMJ75aG2IY0dqKcbHGfoFTS 1W9C+KKp538v//UN74krnR29+DarxaFh6n3nivEdf47y6L+rvUIxqxQXsHQCrScFFM88 aHLGkbjhIgsCWCvBeMeql25vh/Zdnd9YgpBFh/k7+1Hvs7I560dBZHpNsuAwJpUmhS+9 ZvQQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20230601 header.b=JYlOqaHM; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:5 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from groat.vger.email (groat.vger.email. [2620:137:e000::3:5]) by mx.google.com with ESMTPS id d2-20020a056a0010c200b0068fe0f46f27si1222796pfu.171.2023.10.17.12.04.23 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 17 Oct 2023 12:04:32 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:5 as permitted sender) client-ip=2620:137:e000::3:5; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20230601 header.b=JYlOqaHM; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:5 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by groat.vger.email (Postfix) with ESMTP id 9412F80BB207; Tue, 17 Oct 2023 12:04:21 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at groat.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1344028AbjJQTEF (ORCPT + 99 others); Tue, 17 Oct 2023 15:04:05 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:53482 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232228AbjJQTEE (ORCPT ); Tue, 17 Oct 2023 15:04:04 -0400 Received: from mail-wr1-x432.google.com (mail-wr1-x432.google.com [IPv6:2a00:1450:4864:20::432]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 43E61C6; Tue, 17 Oct 2023 12:04:02 -0700 (PDT) Received: by mail-wr1-x432.google.com with SMTP id ffacd0b85a97d-32d885e97e2so5680626f8f.0; Tue, 17 Oct 2023 12:04:02 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1697569440; x=1698174240; darn=vger.kernel.org; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:from:to:cc:subject:date :message-id:reply-to; bh=3URO8PfjgnFnifpX9a/pgxt4rV16Mqdk8BmJm6wrjEE=; b=JYlOqaHMN/TfINJOTUtG884SeTU0RPTEvkHgrK1tY5HSEDF0DbejWuiEwBS1Rl+/gz CVoMXoAH2NotGP9AmIpE21DetHN0iJ1VWxXqI7/EZikwksNW6TWHXMJesGwR0kro7VFC qZY8BlQwnY1PAR5PSbKdwgyLBODDevKeY7SQLsFuynoNp6owrNnF8JxuIdUgZMQHh+Ah sQ8HtJi9kYM2CqVeSMh4vDTLX6syuK9mlQlTTwzUvU+KoN4TsBDGI8MzbXUjCXs+MSMi wUptc8P3rvA0wbtaZex9efMgE5M9Apc0wBEu7RPK8HiUXCsha5kIX1vkx57TLodzbja6 esQQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1697569440; x=1698174240; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=3URO8PfjgnFnifpX9a/pgxt4rV16Mqdk8BmJm6wrjEE=; b=ZRYJ4KDxvC9svGmbPkGKQasnNgELOn7wBZnVXYo53BUYsef7wfw4dXX0yMQSN0XOv3 /w0Iq6faKcWcK1dOf2YPDtdl80wGAqPldCTtHcmv6s4xnsmeWILX1gRw1Ra25ziJT+e0 Z1WAWBiUNN4bAA6ywzzRpj71VgSTQOMvyBmiSTRnUBKqBkrXnSAk8zTMcdIeE+mI9Atu aI6afvbOGQcqXJ94KqEsg60splORIfYWLw7R/9fpUjGMy+jcIC9VW1CI0N6tgMxvIx/g DSdW/4wK6/wmOuTn3noMoU8NxfOqbKMAMQC1nQz/DB4eWhUitYi0blnC4U5hJA9Ej0rk lyPg== X-Gm-Message-State: AOJu0YyQ6psrh5C3LzHV6OkWsAY3QjjQjqRmMaxR2QkwKjuIhoOwr++I JlaheQMPtZGtFlEvhIdQAUJshBs7BG1nfsoVhvs= X-Received: by 2002:a5d:4e47:0:b0:32d:65ab:2228 with SMTP id r7-20020a5d4e47000000b0032d65ab2228mr2493781wrt.11.1697569440390; Tue, 17 Oct 2023 12:04:00 -0700 (PDT) MIME-Version: 1.0 References: <20231015141644.260646-1-akihiko.odaki@daynix.com> <20231015141644.260646-2-akihiko.odaki@daynix.com> <2594bb24-74dc-4785-b46d-e1bffcc3e7ed@daynix.com> In-Reply-To: From: Alexei Starovoitov Date: Tue, 17 Oct 2023 12:03:48 -0700 Message-ID: Subject: Re: [RFC PATCH v2 1/7] bpf: Introduce BPF_PROG_TYPE_VNET_HASH To: Jason Wang Cc: Akihiko Odaki , Alexei Starovoitov , Daniel Borkmann , Andrii Nakryiko , Martin KaFai Lau , Song Liu , Yonghong Song , John Fastabend , KP Singh , Stanislav Fomichev , Hao Luo , Jiri Olsa , Jonathan Corbet , Willem de Bruijn , "David S. Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , "Michael S. Tsirkin" , Xuan Zhuo , Mykola Lysenko , Shuah Khan , bpf , "open list:DOCUMENTATION" , LKML , Network Development , kvm@vger.kernel.org, virtualization@lists.linux-foundation.org, "open list:KERNEL SELFTEST FRAMEWORK" , Yuri Benditovich , Andrew Melnychenko Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Spam-Status: No, score=-0.6 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SPF_HELO_NONE, SPF_PASS autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on groat.vger.email Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (groat.vger.email [0.0.0.0]); Tue, 17 Oct 2023 12:04:21 -0700 (PDT) On Mon, Oct 16, 2023 at 7:38=E2=80=AFPM Jason Wang wr= ote: > > On Tue, Oct 17, 2023 at 7:53=E2=80=AFAM Alexei Starovoitov > wrote: > > > > On Sun, Oct 15, 2023 at 10:10=E2=80=AFAM Akihiko Odaki wrote: > > > > > > On 2023/10/16 1:07, Alexei Starovoitov wrote: > > > > On Sun, Oct 15, 2023 at 7:17=E2=80=AFAM Akihiko Odaki 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 sysc= alls */ > > > >> 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 =3D { > > > >> + .get_func_proto =3D sk_filter_func_proto, > > > >> + .is_valid_access =3D sk_filter_is_valid_access, > > > >> + .convert_ctx_access =3D bpf_convert_ctx_access, > > > >> + .gen_ld_abs =3D 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 B= PF > > > and I'm worried if it may mean the interface stability. > > > > > > Let me describe the context. QEMU bundles an eBPF program that is use= d > > > 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 an= d > > > vhost_net. As such, the extension needs to be done in a way that ensu= res > > > 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.