Received: by 2002:a05:7412:d8a:b0:e2:908c:2ebd with SMTP id b10csp2888018rdg; Mon, 16 Oct 2023 19:39:11 -0700 (PDT) X-Google-Smtp-Source: AGHT+IEaux56rNC1P0Qx8R5B7YQ/JCfuziR6K6p5VZya2vkkEcnP2Em6dVqMF423s1UUxqcc+tkq X-Received: by 2002:a17:902:e54f:b0:1c3:bc7b:8805 with SMTP id n15-20020a170902e54f00b001c3bc7b8805mr977174plf.52.1697510351189; Mon, 16 Oct 2023 19:39:11 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1697510351; cv=none; d=google.com; s=arc-20160816; b=q2eXQvObkSq3JK3ODhhxRoVAlJYHEyX24WNW3UWRdKvEkAsO8zp+HZPeS12PRk8eOc BXzyF9ADKNAvbaoqBZ+jgjJBoKtL++ncSKfOKYrF6LAJ/9d8emOHkW7eFiNFNSgqv071 /sgbf1qqWxtfjlk6GRHHDjo2UOyIVtWLvnsaaIxcUYa6rjbns64rB+RjeSqhlchdM0Yd 0klnsMOLC7TvLwduHpanpUYhKYMiteVPmGsYtAlx84IJGttqqC3n8IA7fHQhOm+0G92q S8JQjfQwZkkdCSD8zQuQI9uf6ssPxy/Rr5ZzjZ5/5P+s0U2iiKYSLUBwxRmc8mXweU5B TOvA== 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=jLFBGnIpAzynaCLSWbQnRiqRNf9pByil8XHxQ2oSj4w=; fh=NfHrushyOELxhZKL6hxPXrH11PWkbVexTi7tdT56774=; b=XunyLb+mxLyJ30/jIRPep7NjJXGBAT0EsOe5CPf4VYhjU7+qdQ+i7j2btPlDCz1FaI NTGwkUIOqCbudpjwvCHR3tStrPS4qB6uTRDFDNYblIjZhHJTS+cQiLRIxUxBzSPO7LvB hrSA8tHH2x/J7PBv+6mFD0QKlcgw56GtOQYucwAjNjdB7kXQxI+RtHkzw0jks7vR7kN4 2eggUrKPIrZFlhfS3s/l57Chkl5/yuBcVUT3kGcO0YvAM+zbwaWqy02CnZMGJklK/lJ+ ZpAt4eoQpH5BHJG3XzwCbrt9SVUe6px/4Dyj5ltw+rQH3zFpu/jYIMZCsxMEkthm8nML FKKA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b="O7qKi/EO"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:8 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Return-Path: Received: from fry.vger.email (fry.vger.email. [2620:137:e000::3:8]) by mx.google.com with ESMTPS id u6-20020a170903124600b001c42b2b02casi800189plh.174.2023.10.16.19.39.10 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 16 Oct 2023 19:39:10 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:8 as permitted sender) client-ip=2620:137:e000::3:8; Authentication-Results: mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b="O7qKi/EO"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:8 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by fry.vger.email (Postfix) with ESMTP id 323DE80B81E3; Mon, 16 Oct 2023 19:39:08 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at fry.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234070AbjJQCjC (ORCPT + 99 others); Mon, 16 Oct 2023 22:39:02 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:48214 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234068AbjJQCjB (ORCPT ); Mon, 16 Oct 2023 22:39:01 -0400 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 1743EF0 for ; Mon, 16 Oct 2023 19:38:16 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1697510295; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=jLFBGnIpAzynaCLSWbQnRiqRNf9pByil8XHxQ2oSj4w=; b=O7qKi/EO1lPDzXULnZGyKoBwu13Ihe1OoZtQLdeAGkxyb9EwTDJPXoH/B/OXleGv2OPYzo VKgxqTvQQMBYWlINsgLgX4MQhOsX+afqaSYXr7lMcM38gSWzSuOy6PTywAmqNadeAdeep/ IZp3f6HfNwR9wafmYLSaC3C4Vvjg08o= Received: from mail-lf1-f70.google.com (mail-lf1-f70.google.com [209.85.167.70]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-279-BVnwgSsqNjedNrKT67qRdw-1; Mon, 16 Oct 2023 22:38:13 -0400 X-MC-Unique: BVnwgSsqNjedNrKT67qRdw-1 Received: by mail-lf1-f70.google.com with SMTP id 2adb3069b0e04-5079f6c127cso2879070e87.3 for ; Mon, 16 Oct 2023 19:38:13 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1697510292; x=1698115092; 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=jLFBGnIpAzynaCLSWbQnRiqRNf9pByil8XHxQ2oSj4w=; b=eiYT24a16zfkY++KBjN3UuEK5fSFQkD4EEdUU6Wzan28kUomAkB4w5tfBkQA5v4ZVj ZWWP7pqLf6eg+56Oufji6oJXxsgTmFmLsoaPXxGGZO4hPew8h87bkXdUKXivCbqQCKPl MqD0rDkhl88VrMHdK7vsjiqAmBTBjPkqPJ8nFH1hiFh1c1kdo+SafR7vt9KSWL84RpG8 nKDQNlUBTTUWjAGUOSrVLWbUEiuyZ8B8BtMb0jrFpRy11AOceftGlTIxJgdncvYfvRZt brVxp4KnwWaGNhuBYuslGaMcqogLe+RlLzN5g4BN9RWDDPHpVw94Hk19FVTRdl0ii30Q NnRA== X-Gm-Message-State: AOJu0YyhWbPF8VsXSkU3TK1Zi/RYdXm6MkadgnLL1VjqO/6LFybKgkjM jDnb97+phZD6+KInQv5Cb1XMLD6d7VblllH8wz5K/mDEDyS0iAT0USihumTbWu3DHdS4H0AL9sO 6M9/1ybj2AXuUPcdoTuNEif2HSKdDCy5EdIUtjZ+K X-Received: by 2002:a19:7616:0:b0:506:8e27:7ce9 with SMTP id c22-20020a197616000000b005068e277ce9mr773827lff.16.1697510292106; Mon, 16 Oct 2023 19:38:12 -0700 (PDT) X-Received: by 2002:a19:7616:0:b0:506:8e27:7ce9 with SMTP id c22-20020a197616000000b005068e277ce9mr773811lff.16.1697510291790; Mon, 16 Oct 2023 19:38:11 -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: Jason Wang Date: Tue, 17 Oct 2023 10:38:00 +0800 Message-ID: Subject: Re: [RFC PATCH v2 1/7] bpf: Introduce BPF_PROG_TYPE_VNET_HASH To: Alexei Starovoitov 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.9 required=5.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,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 fry.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 (fry.vger.email [0.0.0.0]); Mon, 16 Oct 2023 19:39:08 -0700 (PDT) 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 syscal= ls */ > > >> 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 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 ensure= s > > 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? > 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. Thanks >