From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from smtp2.osuosl.org (smtp2.osuosl.org [140.211.166.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 44E083DBBE for ; Fri, 15 Dec 2023 16:36:50 +0000 (UTC) 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="xXF+b8cP" Received: from localhost (localhost [127.0.0.1]) by smtp2.osuosl.org (Postfix) with ESMTP id BB47A40323 for ; Fri, 15 Dec 2023 16:36:49 +0000 (UTC) DKIM-Filter: OpenDKIM Filter v2.11.0 smtp2.osuosl.org BB47A40323 Authentication-Results: smtp2.osuosl.org; dkim=pass (2048-bit key) header.d=networkplumber-org.20230601.gappssmtp.com header.i=@networkplumber-org.20230601.gappssmtp.com header.a=rsa-sha256 header.s=20230601 header.b=xXF+b8cP X-Virus-Scanned: amavisd-new at osuosl.org X-Spam-Flag: NO X-Spam-Score: -1.9 X-Spam-Level: Received: from smtp2.osuosl.org ([127.0.0.1]) by localhost (smtp2.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id itPRbHnC9UAs for ; Fri, 15 Dec 2023 16:36:48 +0000 (UTC) Received: from mail-pj1-x102f.google.com (mail-pj1-x102f.google.com [IPv6:2607:f8b0:4864:20::102f]) by smtp2.osuosl.org (Postfix) with ESMTPS id 5948C40158 for ; Fri, 15 Dec 2023 16:36:48 +0000 (UTC) DKIM-Filter: OpenDKIM Filter v2.11.0 smtp2.osuosl.org 5948C40158 Received: by mail-pj1-x102f.google.com with SMTP id 98e67ed59e1d1-28b0a9876c8so407443a91.3 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=lists.linux-foundation.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=xXF+b8cPat7hRs3aXJl3PgUaHmY4ZtN+7XduTMhjx7/I+sFzb0Duenz8gAaj2Wi3hP 0vABmo5wFo3HsWUCAWhF4HzyHsgkwZAsBIF8ISVWpfJvCgDSmZ+El6fmAZmRfIOQ16/2 drt/VkBswOVJXT9VoKkWxaHZ6xqe9jJOtjTxaOiJc97EswXXSSPs0qvffQnKN4tieYVz bspJFHRel+D9hh06LqXSx285I/Y1DvD6fhR9nnM12MP6G+9a+M2okaK4lnx/1UsEUSFJ l2s3Q/Z4tDH/faAVjRpk/ClWwDM1xYqnBj4RyGPWl8RQ8mHH69/Njjj99+mqeYSJP8EF gUVQ== 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=eK5AXJLp5FoWTK8G7F/lM6WEsxTosXAVqOgtRn5hrEkXgyZZO+bUD23wYwHlJ9/bwC pqTZGTrVuMOs7c56uKr1MhETVgi4/km1RaGASnA0bxdibj5O7cnTzGKGQyqO7nkD671f X2i1StpmPpstwoXqiEQ8X7q6+L7YP9LVJzDXhyN2kXc7QPwotlnO38A5k9SpT4FdTFTb TL6HjdC+1w5T7W5zuiwfby894IcJCyXRtyEtARqouY53uMYfzH31Esd9zUSPdtjMe8yA SXaR4+DASfzFR6b7Y4cEpo8gAPWQykZiTeYgaKFiqhPG1tWP83+L14qt8P2o8x+BXa7L ULqA== X-Gm-Message-State: AOJu0YwvVGi1dBmHQv6+vC1JfOhhgE36cQCs40aLYLtdGKTfh8uQJFXg q4gfU4lMAKvnrJPSKvt7jJ5B8g== 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: virtualization@lists.linux.dev 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.