From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 57D2BCDB47E for ; Sun, 15 Oct 2023 17:11:02 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230186AbjJORKs (ORCPT ); Sun, 15 Oct 2023 13:10:48 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:46400 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229522AbjJORKq (ORCPT ); Sun, 15 Oct 2023 13:10:46 -0400 Received: from mail-ot1-x335.google.com (mail-ot1-x335.google.com [IPv6:2607:f8b0:4864:20::335]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 967B0AD for ; Sun, 15 Oct 2023 10:10:44 -0700 (PDT) Received: by mail-ot1-x335.google.com with SMTP id 46e09a7af769-6c4bf619b57so2613562a34.1 for ; Sun, 15 Oct 2023 10:10:44 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=daynix-com.20230601.gappssmtp.com; s=20230601; t=1697389844; x=1697994644; darn=vger.kernel.org; h=content-transfer-encoding:in-reply-to:from:content-language :references:cc:to:subject:user-agent:mime-version:date:message-id :from:to:cc:subject:date:message-id:reply-to; bh=fcEgPcBDvVyd0XBq0zLbTYcLGmRmfdNUafJKy3Ustms=; b=hoSrR9M/uOKskN330EFHAemCo+YkOwgPpnzDnKc2/TeHjigMqu6zVC8mPnE9CCfFRW eWmStjygsSlmlm1h+9suoQFkyKy6WyvgS9ahfaMJt/MkqWKHhOmW8xcD90zeIO7olAb3 jiB9YAsNyYxKJOALQzUK8xZ+S3GV76bEdKjRypW4Zvk8PSHt9NublnbXvnAwFur94zeG IPLux44Aw7pMqlf3uD+Sa2CsNFquTQG7pAlM55yO+GCyap9Nn1N1aL7YktGJNjUIe1uL Tb2NsWc30yvMifagxmcR3fTYiOcnK8b6oHX5ekUzP5gRDbv7bSFAAqnMzQo+2P5Pn/P+ KUHw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1697389844; x=1697994644; h=content-transfer-encoding:in-reply-to:from:content-language :references:cc:to:subject:user-agent:mime-version:date:message-id :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=fcEgPcBDvVyd0XBq0zLbTYcLGmRmfdNUafJKy3Ustms=; b=LRGV5fN/ipAWSUhUCMgGKCbdD53kMZ6h6mHOdbPCKume1k3hxO+sOVq2GqXsDvT1mn 5+mRsxmSq35xvSzDad3T2slW6+TP0GeTJhW1szs15nTHv4m3IY/LJdXFwlKP+EDDolXr LV1EyOOuAu4h5jdd/5PPMnHPLeesLqNDFLjjDYdW9CSqp4fKW/nXt/jBvgPyKv2jptWP jVr0XQIxhffhuFKV087fTbhqZ5em1ocexITLM3gWfRLl/al3PRqgem6doRlz6NYR8dwi IuYpoIjnlg+nT0VAatNX++/CamBgRFyeDtFFE0VRjMToxb999yZb/8YFvZK+k40fK2YG 6i6g== X-Gm-Message-State: AOJu0YzAbcRANQn2qY4VFZekuU6VAclbczDUjGhNM1hILWS8V/J0CQOR Pgo/ohMy72jEBB00JZQY3ZeOBQ== X-Google-Smtp-Source: AGHT+IGcY0haZusyeSRqVSgWCHxm5dAXvs9j0Eq3YRg3ATZYQjdXEfYHDPtaM41tGtML69l3X3o1lw== X-Received: by 2002:a05:6830:1b6e:b0:6b8:f730:7ab4 with SMTP id d14-20020a0568301b6e00b006b8f7307ab4mr35126540ote.0.1697389843886; Sun, 15 Oct 2023 10:10:43 -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 s5-20020a625e05000000b006b3b342f37fsm4498221pfb.178.2023.10.15.10.10.37 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Sun, 15 Oct 2023 10:10:43 -0700 (PDT) Message-ID: <2594bb24-74dc-4785-b46d-e1bffcc3e7ed@daynix.com> Date: Mon, 16 Oct 2023 02:10:35 +0900 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [RFC PATCH v2 1/7] bpf: Introduce BPF_PROG_TYPE_VNET_HASH To: Alexei Starovoitov 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 , Jason Wang , "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> Content-Language: en-US From: Akihiko Odaki In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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.