Received: by 2002:a05:7412:d8a:b0:e2:908c:2ebd with SMTP id b10csp3365694rdg; Tue, 17 Oct 2023 12:19:36 -0700 (PDT) X-Google-Smtp-Source: AGHT+IGwooemgqx0WHchORZChM/yJqf1Zz7LfD9kR3f/9MOkUP/8VrZQO6Yfo+koJFYbxBcpGnbj X-Received: by 2002:a05:6a20:4306:b0:157:64e4:4260 with SMTP id h6-20020a056a20430600b0015764e44260mr3403265pzk.9.1697570376443; Tue, 17 Oct 2023 12:19:36 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1697570376; cv=none; d=google.com; s=arc-20160816; b=Ms/EiV8Agq4GB74roL/Su+5iX4AscphnQ0jxnV4KSy4loGe9N7zsJ2XjF3TFoNUyY2 E9l2+qGpwasgb1nTKZDoGOPtKFw6mrQ0u+Wz8Fu3Yae7l7HvNLFlN4UYNty+K3DM3xOn K8CwujVLDCfxbNJvU9E/M7aLi9kOwqBtaC3DGJzJIoVliuABaEHNmOiT3OCLWN3SPa44 7KxBlFZyAx8HYgMynmL4R3MfYTujwQWtDcwFN/U6B+byuhqeppHW/b8BqENWmgiDyvJ8 3LzgC1otqK7jkINUcdv7MeqOG6RREvTsS6f9HRsxDS/0dUYxKgDEE6H92j1hc5hL+/I0 j7Aw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:in-reply-to:from :references:cc:to:content-language:subject:user-agent:mime-version :date:message-id:dkim-signature; bh=oiqh505uiYLILkv7e75NKRYSxfkStnbnu54DlF5oIdE=; fh=ztXqv03hJuglHa+bsPVSjOh5v0FnQifuRSr026y9IJQ=; b=Sa1OmRbeaLzszPkM7u1nr4ZIU1cPEphku4PKEUCvwMC3bwATbGQLQVKoeQebsR8cUr e5jcrPxIBmqg71SCIhVzhAGirfDjrMreLY8x+11Bkw/QHOgBUuc/ARwuUTGtW+TENYK5 IFaSp15ZjBs6kl9tHfxY905LuUpg5ytesj+swR3DNDcca7XQBstD0DnGTnU2KSed57QY AKoL0BgRz/DIt9/svzfr2uqcCl/0fuCMPqIqXOnC8tXS1HBJ35RduO6Q1oK3KJaH3pOp mu2sJo+0wppn/xzB/VmQAD+cvPcmfAPHqn4qZ0mFyyRf08ltdm6sFUXLsap8Fy/Yrw2D sfTw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@daynix-com.20230601.gappssmtp.com header.s=20230601 header.b=DvTgQ7ti; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:7 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from snail.vger.email (snail.vger.email. [2620:137:e000::3:7]) by mx.google.com with ESMTPS id m28-20020a638c1c000000b00578bb5917d7si426995pgd.153.2023.10.17.12.19.36 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 17 Oct 2023 12:19:36 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:7 as permitted sender) client-ip=2620:137:e000::3:7; Authentication-Results: mx.google.com; dkim=pass header.i=@daynix-com.20230601.gappssmtp.com header.s=20230601 header.b=DvTgQ7ti; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:7 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by snail.vger.email (Postfix) with ESMTP id 7693E80F9FB6; Tue, 17 Oct 2023 12:19:35 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at snail.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1344198AbjJQTTc (ORCPT + 99 others); Tue, 17 Oct 2023 15:19:32 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:42320 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1344267AbjJQTTY (ORCPT ); Tue, 17 Oct 2023 15:19:24 -0400 Received: from mail-pj1-x1033.google.com (mail-pj1-x1033.google.com [IPv6:2607:f8b0:4864:20::1033]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 7B2A6194 for ; Tue, 17 Oct 2023 12:19:16 -0700 (PDT) Received: by mail-pj1-x1033.google.com with SMTP id 98e67ed59e1d1-27d3ede72f6so3830010a91.1 for ; Tue, 17 Oct 2023 12:19:16 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=daynix-com.20230601.gappssmtp.com; s=20230601; t=1697570356; x=1698175156; darn=vger.kernel.org; h=content-transfer-encoding:in-reply-to:from:references:cc:to :content-language:subject:user-agent:mime-version:date:message-id :from:to:cc:subject:date:message-id:reply-to; bh=oiqh505uiYLILkv7e75NKRYSxfkStnbnu54DlF5oIdE=; b=DvTgQ7tiVld8Vll0hS+NuZSfsESJZVVtxMFRmx26FU7a7EVYAa2GcBPDgDB1IpVQ1F w4NLcSvb0NFDWWmLLunQIfaqkxL5p6M5INMmaII5LtvRiNVIIQmAqzuHPYwLsJf+OM60 bDH6bYP8nE01wdKL1+sVg/REJjATDBwazSop4chywjuMAYZhCdJPKnFq0M3nCb8nlKrZ 1pQZKG0+1OmCzR1/4NxfjnCNZQm9w27OzfV/Qi9xM0zUcR3mO7IaFnIFysm1/3cdtHRd zBKsKJhPW7VPoHjQRNBS/K6J0aZOGQunoAg4WNn87fIbHANC7CMUSe02fYrPINxIBvRb dNHg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1697570356; x=1698175156; h=content-transfer-encoding:in-reply-to:from:references:cc:to :content-language:subject:user-agent:mime-version:date:message-id :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=oiqh505uiYLILkv7e75NKRYSxfkStnbnu54DlF5oIdE=; b=Eb8NhojPv4/dXexnPzrKmN19rNoXmxZMH+boIEZj9+daNQ3AozjAOQfi8/ZAs+pWti ZF6Zy/hPjJxSnnXJwiaRMq0lcE9AF/KHj7nwjKlsTR23F1jsuXynj3+7adWB4WMB0tAi FL61x9dCqBj3Jn1++k8iyz6jqTvU0MjW+SOODd86CH7tVR6cqs3r6w0M8FONAgLYMur8 4wc09V0/I4gdNkPn8IdsvJ5jaohslrHWROgYClw9LQe6VdsrnfsovwYeTBesNLRSjH+U kZ84RZMcA4vSGC5U5/c85OqC+f2QsNUVBSWRFPcdrSERyKVjog7tjA/0k9XJfqdjhAeB gClw== X-Gm-Message-State: AOJu0YzlJsft4czbm7mq/mwEg+cxX88qiibScHpznQ9/Ahf0XfgYV+bW 6/7SltGsg5Qa3xJPxx/wFPThjA== X-Received: by 2002:a17:90b:1044:b0:27d:3c1a:3d2d with SMTP id gq4-20020a17090b104400b0027d3c1a3d2dmr3206302pjb.21.1697570355901; Tue, 17 Oct 2023 12:19:15 -0700 (PDT) Received: from ?IPV6:2400:4050:a840:1e00:78d2:b862:10a7:d486? ([2400:4050:a840:1e00:78d2:b862:10a7:d486]) by smtp.gmail.com with ESMTPSA id e4-20020a17090ab38400b0027d0d4d4128sm1656284pjr.25.2023.10.17.12.19.09 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Tue, 17 Oct 2023 12:19:15 -0700 (PDT) Message-ID: <9a4853ad-5ef4-4b15-a49e-9edb5ae4468e@daynix.com> Date: Wed, 18 Oct 2023 04:19:08 +0900 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [RFC PATCH v2 1/7] bpf: Introduce BPF_PROG_TYPE_VNET_HASH Content-Language: en-US To: Alexei Starovoitov , Jason Wang Cc: 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 References: <20231015141644.260646-1-akihiko.odaki@daynix.com> <20231015141644.260646-2-akihiko.odaki@daynix.com> <2594bb24-74dc-4785-b46d-e1bffcc3e7ed@daynix.com> From: Akihiko Odaki In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,RCVD_IN_DNSWL_BLOCKED,SPF_HELO_NONE,SPF_NONE autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net 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 (snail.vger.email [0.0.0.0]); Tue, 17 Oct 2023 12:19:35 -0700 (PDT) On 2023/10/18 4:03, Alexei Starovoitov wrote: > On Mon, Oct 16, 2023 at 7:38 PM Jason Wang wrote: >> >> On Tue, Oct 17, 2023 at 7:53 AM Alexei Starovoitov >> wrote: >>> >>> On Sun, Oct 15, 2023 at 10:10 AM Akihiko Odaki wrote: >>>> >>>> On 2023/10/16 1:07, Alexei Starovoitov wrote: >>>>> On Sun, Oct 15, 2023 at 7:17 AM 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 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. Can you elaborate more about making new use unstable "for the time being?" Is it a temporary situation? What is the rationale for that? Such information will help devise a solution that is best for both of the BPF and network subsystems. I would also appreciate if you have some documentation or link to relevant discussions on the mailing list. That will avoid having same discussion you may already have done in the past.