From mboxrd@z Thu Jan 1 00:00:00 1970 Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=209.85.128.48 ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none; t=1796062479; b=xHwUUbEesr6D18Z+0bGCDhBMmBfptm8paZyLWSV+qnmOm94Ygo6VRXI3Sr4KzVv04iyC WPcQRVChsdaHMRG6UWQsExqj4zhEQ14O0Vv3Cc8Hg00NdA6ajQ1eBK8jRpmvAYIzLsKuy c2c/uBn93Hcu4moTVktDIn3w78vaAMAU6L0r13ZzVbexiOnQw/+tOv6k2OYhEwayU1SuX 1GP08WLG4pwZymPhZ4zDdZSZiNlVma9NTmoT4l0bauNTmV82CEvxIhWTLfBTtiAvMaMSK sIeNDhH5i5m1p+86tSpzGhX78DxpzVKH2wlG8s5vXxxI2/3Nizezs6FJBgdOy8dcgpw== ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1796062479; h=DMARC-Filter:Received:DKIM-Signature:X-Google-DKIM-Signature: X-Forwarded-Encrypted:X-Gm-Message-State:X-Gm-Gg:X-Received:Received: Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:Content-Transfer-Encoding: In-Reply-To; bh=zIj+m4hbOH+uOywM9x3CY9XyKQPLm38hH7w29KoQWIs=; b=sUiJNZB88TtuQcxDPwSKod5pW/+RV3Nza2tM3I7ILUXm3JDhOS6zXnDxufuyk/CBRGnG +tiMedwo2LNu2f3oGav6AfjZN27DNJoTSyxYVbKuZDFQGfvpSQMxn85APbDIeWHzYlNn7 WCkNRk8wJyqQMT6H1JPLWNemZ+YuzECFYlbg7XJ1I3kLQ2UVu+0tWsTj7Pc1XV1kKqxUY 5qYsHZjYSLYFcjXXSBUhrK8mCg/y0NFIZlL1y5qnLDE75SpvYA8DYiK/8+B6S/JoeMUiz J9OuUfso8hbGp0EioBZHX1LtcoEBx9ajcD1UaEDiaF8hOvkOgJJtGLH6wJ0PWt4hsgA== ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256 header.s=20260707 header.b=qkV5OFq+; arc=none smtp.remote-ip=209.85.128.48 Received: from mail-wm1-f48.google.com (mail-wm1-f48.google.com [209.85.128.48]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature ECDSA (prime256v1) server-digest SHA256) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 6FFBC606A31C for ; Mon, 30 Nov 2026 18:14:39 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.2 smtp.subspace.kernel.org 6FFBC606A31C Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256 header.s=20260707 header.b=qkV5OFq+ Received: by mail-wm1-f48.google.com with SMTP id 5b1f17b1804b1-4bb6adaf0f1so92490325e9.0 for ; Mon, 30 Nov 2026 10:14:39 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20260707; t=1796062478; x=1796667278; darn=vger.kernel.org; h=in-reply-to:content-transfer-encoding:content-disposition :content-type:mime-version:references:message-id:subject:cc:to:from :date:from:to:cc:subject:date:message-id:reply-to:content-type; bh=zIj+m4hbOH+uOywM9x3CY9XyKQPLm38hH7w29KoQWIs=; b=qkV5OFq+v7hW55MOig7HnCQQDniPETSjwvAh1hZ161Kk1S3R4n7ZDAtDQ/GXel+sdC iKregI4uocRf3rqZoZAnp3YcHfgmxT7khoR5Ehyl+d0640wSV5Zuao6zSh/+l6BFGexA g8Sm4pIC81dFLkWAOV0uBEs/PGOZKEQHNLzESgg6VcR6SYH+QIOIXBlIucYNgAWXbtuV WunirspEz9y4qifgW9P/NRAp1hNxp9ehjcwaNTT+bTH2yjNkLFIrPrrD4n0AD71DCOrc gl8CmJl0yEdsdfzNc8MrnzOcukmDS6FlGPv/IsYWuoBj5aVyCeEiUByJuWv+liGvCAMd rH7g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20260707; t=1796062478; x=1796667278; h=in-reply-to:content-transfer-encoding:content-disposition :content-type:mime-version:references:message-id:subject:cc:to:from :date:x-gm-gg:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to:content-type; bh=zIj+m4hbOH+uOywM9x3CY9XyKQPLm38hH7w29KoQWIs=; b=cwi3ivZ+8baZR31Dh0kW6HATXOwDWqgBdZAp7kdwHifG4Xfbsin/DvqMxXe2yvqKvk r/geRybS2JCdUJarKY+d08uaxG0rLqDnjZx5P40xbgovCBGJCKRPqY18gD7Xe8nGykhn J0iZ+tP0X4kIm8mEjUEkRFdPJ7d6dHIlrdScb/YHVi14x8Jo9WiOVmNTFVy2Crx4phSz KWYRKTaW8pv3ER+Pw1sWAyI5a30XqsA0pSRGFmQiWSJExxZCEA9+3jlv3oPFT0XzSiaq RI6o/+ZlN/QyjP3v+9equFHPdUarJlZsM9vPZEnmPfdsuLRqPpWrPu2cAGOAkT/aL2mP idSA== X-Forwarded-Encrypted: i=1; AL+hErHilNnURcOW9tLA6P1goSaW728Xtp2Ej90Zrxyc9vTSUT4TpGhvPKx2+ju31lyUXRLbyhw=@vger.kernel.org X-Gm-Message-State: APuU4Z8Mh1Ql42Bnzz5+lLi+qcVTYKRlL1c3WOV+fsrIvmT2xF3fS5/2 rl5/Yo4JKmQ2CklUdWOwxVddiCTlUQ22hKV3BXfkgSVwu0co43sM/HtE X-Gm-Gg: AZFdTZe199Z7s8kHlmV7XNg2wOJ7esRfN0WnGTLNXvFzLcuH9efbh91IG6gsGf8+hd+ 8+BUPcrffXg4VCPGaM5qIN+BeqENW+r1QOtOeDavqR/FQqj4jm3kFN2jeDhrDI10CS7An3wzo22 omtSY3cLff6BNYVRWp0zqiAgyqLPe5GA67yDFeMgGqJXGMfUbZTZNr/IgfNAQAHlPU0/R+40Kuv y5XYKEWrWxAIqi/kHKak+w/UMqSnhUJeyElvV1Qql4SlpihhA9VdDyCAbKAVXcMgYea9X0oVjUp R3BxaZvI7JSOdp05op776x8xdpFfnPTgS89J++Y05cEHnZlZrkeT4WOuVJZsmLjrom9VoKhrhjv LTW5IfJJOQOv+tlI8PuwzYySrdzWbvmyWZGaAVcqzHKM33ZVSzobAoEVChd24CcV5fZ3zRq9aO2 W0pZ1Yic+w+bzlSlK9mAZQxtjyIunRAm8TiXYqtuGwt2d0xpEwIaKeIPFTvrGuKvHym7PyP2Cu3 saZUotLNU19ZTzaviTc4uTymJXJaUD+G5K/hxrq6ZYwGxOxmGBBJQRGWtzVZc5yqJ2rBiwHmAQR Hl7s7FKp9q+NEdXYDcLUbKgM8sx2cVoYuFEMfJG0HapPZZf+W7CKzrX7gGcNy8gVxTLB X-Received: by 2002:a05:600c:674f:b0:4bb:7e4e:de69 with SMTP id 5b1f17b1804b1-4bb88814c37mr660150295e9.20.1796062477506; Mon, 30 Nov 2026 10:14:37 -0800 (PST) Received: from gmail.com (deskosmtp.auranext.com. [195.134.167.217]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-4bb884b8429sm1488489545e9.14.2026.11.30.10.14.36 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 30 Nov 2026 10:14:37 -0800 (PST) Date: Mon, 30 Nov 2026 19:14:34 +0100 From: Mahe Tardy To: Sid Nayyar Cc: Anton Protopopov , Alexei Starovoitov , Ihor Solodrai , Daniel Borkmann , John Fastabend , Andrii Nakryiko , Eduard Zingerman , Kumar Kartikeya Dwivedi , Martin KaFai Lau , Song Liu , Yonghong Song , Jiri Olsa , Emil Tsalapatis , Quentin Monnet , Shuah Khan , bpf@vger.kernel.org, linux-kernel@vger.kernel.org, linux-kselftest@vger.kernel.org, Giuliano Procida , Neill Kapron , =?iso-8859-1?Q?Thi=E9baud?= Weksteen , Maxime Ripard Subject: Re: [PATCH RFC bpf-next 0/7] bpf: Support struct_ops in light skeletons Message-ID: References: <20261106-lskel-struct-ops-v1-0-a4486ffc79cb@google.com> X-Mailing-List: bpf@vger.kernel.org List-Id: List-Post: List-Help: List-Subscribe: List-Unsubscribe: List-Owner: Precedence: list MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: On Wed, Nov 11, 2026 at 01:05:25PM +0530, Sid Nayyar wrote: > On Tue, Nov 10, 2026 at 6:43 PM Anton Protopopov wrote: > > > > On Mon, Nov 9, 2026 at 10:40 PM Alexei Starovoitov > > wrote: > > > > > > On Mon, Nov 09, 2026 at 11:46 AM Ihor Solodrai wrote: > > > > > > > Andrii, Alexei, wdyt? Any other ideas? > > > > > > The loader asks the kernel for ids, sizes and offsets only to pass them > > > back in the next three commands: > > > > > > the loader asks and passes it back in > > > -------------------------------- ------------------------------------ > > > id, size of bpf_struct_ops_ BPF_MAP_CREATE > > > id of , index of the member BPF_PROG_LOAD > > > offset of data, of every member BPF_MAP_UPDATE_ELEM > > > > > > the kernel can match by name instead. > > > > > > The kernel has both BTFs. BPF_MAP_CREATE of a struct_ops map demands > > > btf_fd of the object already, and bpf_struct_ops.c doesn't use it. > > > The kernel can find its struct_ops and the members by name, > > > like btf_parse_kptr() finds the type of a kptr. > > > Then the loader passes what bpftool knows when it generates > > > the skeleton: > > > > > > command the loader passes > > > ------------------- --------------------------------------------------- > > > BPF_MAP_CREATE btf_fd, btf_value_type_id and value_size of the > > > struct in the BTF of the object > > > BPF_PROG_LOAD attach_btf_obj_fd = btf_fd, attach_btf_id = that > > > struct, expected_attach_type = index of its member > > > BPF_MAP_UPDATE_ELEM that struct with the prog fds in it > > > > > > The kernel rejects such BPF_MAP_CREATE and BPF_PROG_LOAD today. > > > Nothing changes for existing users. > > > The BTF of the object is in the blob, so the signature covers the names. > > > > > > Then no need for a helper or a kfunc. The 4k buffer, the fds of module > > > BTF and the offsets at run time go away. > > > map->def.value_size, prog->attach_btf_id and prog->expected_attach_type > > > don't hold offsets into the blob. > > > > > > The diff below replaces patches 1-5. Patches 6 and 7 stay. > > > > I like Alexei's approach here, it fits with shirudo. I also have tested it. > > (Patches 6,7 weren't tested, shirudo uses libbpf without bpftool.) > > > > Thank you Alexei, Ihor and Anton for the reviews. > > I agree that the loader's efforts to find out ids, sizes and offsets > for STRUCT_OPS maps and its members is wasteful since it only passes > those values back to the kernel. I will redo my patch series using > Alexei's proposed approach and send it out for review as soon as > possible. Hey Sid, I'm working with Anton and we are interested into merging this to have this for 7.5 eventually. We've been following this and since it's been something like 20 days, would that help if we re-send this patch set with Alexei's proposal. Thanks! > > Regards, > Siddharth > > > > > > > [...] > > >