From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-pj1-f46.google.com (mail-pj1-f46.google.com [209.85.216.46]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 3B1813DBB1 for ; Fri, 15 Dec 2023 16:36:48 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=networkplumber.org Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=networkplumber.org Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=networkplumber-org.20230601.gappssmtp.com header.i=@networkplumber-org.20230601.gappssmtp.com header.b="FMziPy5F" Received: by mail-pj1-f46.google.com with SMTP id 98e67ed59e1d1-28abb389323so406375a91.2 for ; Fri, 15 Dec 2023 08:36:48 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=networkplumber-org.20230601.gappssmtp.com; s=20230601; t=1702658207; x=1703263007; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:subject:cc:to:from:date:from:to:cc:subject:date :message-id:reply-to; bh=aJvYVagYHhoUh6izHlhrfd4VlIqIxeyLW6YH9/IOyR8=; b=FMziPy5F0KuuWbuqia792leGIkEYU7QDEsuclB9QFip9dubN5SF+2PDn8809rmnxjK wMl4/DjHttWumZ8JNKgouE6nNNdjGPJbkUWzvuTrg7izvDguTeO22lhyWP4d5F6NUjjv WEnEVqSnaCtRLYN8UOKJcTytt4fPr0Fz1+SfOKCSELF8j7CNdjAy+ttS3Iu9ENbaJSTR c/WyjxpScQosXyDYH82FyxqAlfLw3qFVra0/rKsTvt07kgX3Oh+qYC1v2wLwcPlTrten Dfzn9qqzinuyvyPsX24hjsF3Meu6uw+htdB5Zs/puf76TwPgA4A0cs+j1hWs8w44Ejcq liBw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1702658207; x=1703263007; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:subject:cc:to:from:date:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=aJvYVagYHhoUh6izHlhrfd4VlIqIxeyLW6YH9/IOyR8=; b=CHk8cv4qTH5137srHBeZ15KpHKQlm6MrAQzXNKHdoS9jpvgUypm3nmNbnHHY3A8Vkw cuF6T9yTQfWuSEEFQgmEu4NUjTY8EK1R1pICfjLQIhs88FrRO9R6MssJNepnTjJTcN4c uwI/xi6nnWWGVVowXLZu1zOTbknl9TWN5ESgbassyRu4g7UCaNPBBNQlPH+3XOM/sJMq gm3bD8SFfsRRXe0L8g0UWlRVR7DiOti8u/LWA/GPocS6fIgE7Ju1rSUZLGapyDpuM1Er b9P8AToEqfKE7ScTUPX4lAyoVpf92ncETprRXWIHXgSwSzDU8ZYArHqOg3KzS6FAqiKY aVLQ== X-Gm-Message-State: AOJu0YwFy1ZyPFP+dwusJziVHxfZfshpqrwZ4kbue8eSjm/TRhplzFrd t+YZZjzn+5naYQeYfhAbI+N/1Q== X-Google-Smtp-Source: AGHT+IFeZMff91cUpMEe/cVJxJ+9czTxTnqQpAPTa8UZm78P42ynaIIY0rSElsDc43O0h3A+3heBEQ== X-Received: by 2002:a17:90a:4687:b0:28a:efa3:682f with SMTP id z7-20020a17090a468700b0028aefa3682fmr2312037pjf.74.1702658207601; Fri, 15 Dec 2023 08:36:47 -0800 (PST) Received: from hermes.local (204-195-123-141.wavecable.com. [204.195.123.141]) by smtp.gmail.com with ESMTPSA id h5-20020a17090a9c0500b0028ad273525dsm6353303pjp.25.2023.12.15.08.36.46 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 15 Dec 2023 08:36:47 -0800 (PST) Date: Fri, 15 Dec 2023 08:36:44 -0800 From: Stephen Hemminger To: Akihiko Odaki Cc: Benjamin Tissoires , Alexei Starovoitov , Jason Wang , Alexei Starovoitov , Daniel Borkmann , Andrii Nakryiko , Martin KaFai Lau , 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 , Yuri Benditovich , Andrew Melnychenko , Benjamin Tissoires , bpf , "open list:DOCUMENTATION" , kvm@vger.kernel.org, LKML , virtualization@lists.linux-foundation.org, "open list:KERNEL SELFTEST FRAMEWORK" , Network Development Subject: Re: Should I add BPF kfuncs for userspace apps? And how? Message-ID: <20231215083644.4dd9a323@hermes.local> In-Reply-To: <72b8e198-7058-469a-a1e0-17f48330deca@daynix.com> References: <2f33be45-fe11-4b69-8e89-4d2824a0bf01@daynix.com> <0d68722c-9e29-407b-9ef0-331683c995d2@daynix.com> <20231214094042.75f704f6@hermes.local> <72b8e198-7058-469a-a1e0-17f48330deca@daynix.com> Precedence: bulk X-Mailing-List: netdev@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit On Fri, 15 Dec 2023 14:49:56 +0900 Akihiko Odaki wrote: > >> It is exactly what BPF_PROG_TYPE_SOCKET_FILTER does, but it lacks a > >> mechanism to report hash values so I need to extend it or invent a new > >> method. Extending BPF_PROG_TYPE_SOCKET_FILTER is not a way forward since > >> CO-RE is superior to the context rewrite it relies on. But apparently > >> adopting kfuncs and CO-RE also means to lose the "we don't break user > >> space" contract although I have no intention to expose kernel internals > >> to the eBPF program. > > > > An example is how one part of DPDK recomputes RSS over TAP. > > > > https://git.dpdk.org/dpdk/tree/drivers/net/tap/bpf/tap_bpf_program.c > > > > This feature is likely to be removed, because it is not actively used > > and the changes in BPF program loading broke it on current kernel > > releases. Which brings up the point that since the kernel does > > not have stable API/ABI for BPF program infrastructure, I would > > avoid it for projects that don't want to deal with that. > > It's unfortunate to hear that, but thanks for the information. > I'll consider more about the option not using BPF (plain ioctl and > in-kernel implementation). With libbpf, things are much better. It is just that projects like DPDK have to support wide range of kernels including older versions of RHEL.