From mboxrd@z Thu Jan 1 00:00:00 1970 Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=209.85.128.44 ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none; t=1796062479; b=ZgnZ5N2zeo4bwAegH4qOMuXd+emV98UqFz9t4hKIYK+g2RBln2MRCIec9HzhmOZAMnOY E5p0nw1WXTr2TCdNM3B9pKJSgIGMLydJ6i7/ccLDosN5f+roRqefEjCoEQolKD3vm0Fpb sg/vU3xJPHHPEf7gedzGtiCdOrI1aJWcd7l9PmzNI6R7xWfjyihe3pyx9GSmciuKNHO76 hrA2uHKXFmyz1LNTydU/Kc16NYXybZGN2YH9iqIe55O1vmzMSOX0ik+4RfRtjWp3aLVZ8 5RPEP8d55GCLX1UWMSHHP5mdddLqHecI0Fy6SE+MuQidfyoSNfQyv9i4WRog3OyVusw== 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=tPp67tMIjM5Up3qHBII6j9AMGHhwOe/9gNXbbDliwMUymXGcD5F9yscZoX1fKTSr+VAC eLCvJUE8FWSQ8ZdQm2a3r7xEBMfMDN9cyghfqnqth/nlJ6BQVIwaq2t99hbQvSp7wJX6y lCokIIOoUTj3L25irApuHEFomecD1wn52foFNsJPqXEmfF36cUoylCMy54o4zbqUWJj42 i4yrVz2rMJEW9fehXA3T3c6QlDDQRabP1Xn1nR2V/4tqHNU/tPVvEmVKSWwth8RTx8eee xEr6SGPR+32TbaYuf0tnbPiJ/rCeHxK7lFDcZ0DKzgZIC5W0385MsGBZCj5u3kPV5Kw== 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.44 Received: from mail-wm1-f44.google.com (mail-wm1-f44.google.com [209.85.128.44]) (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 78118606A320 for ; Mon, 30 Nov 2026 18:14:39 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.2 smtp.subspace.kernel.org 78118606A320 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-f44.google.com with SMTP id 5b1f17b1804b1-4bb6057b333so54206645e9.3 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=AqrtORz0/LjquPoeVK5IMDEC7RZHN6IG/8T5rkxVLWJ7mdwCkov/2i7qKPorSprgqr aWHlg+G0LdGrXeamIrNM8lJ2I4A54TqZiGeWT+8f1K5C1O8y1+foJYczPZrgdL9h8NvC OhYuuzHCtCETFcRmiPzvQSqzGKbkmEhGqAOtXPhBVYzx4zA1RZdxm/LoKopKKBgVwhLC LL3zVpoZwp6KsCjn+p/cqsmLMhEkigxIOYD7nZVlP1gGxqRbdNPr+M69rZ+kbPJZBKol NKYa1zTC9Ysl5wxRE6/6oX8RKLxFoeIEzkyPgKsix3pL5UliaQnv1vZ4Hdcx18odSZzu X9kw== X-Forwarded-Encrypted: i=1; AL+hErHUdWz2BbOt5Boip0Ach5Z0eL6NEj7KOT0NoHmuyobb1n+p/1B8lur9bYCh64x4n2tWhAYGLZaYilJMyfCP/Gw=@vger.kernel.org X-Gm-Message-State: APuU4Z+6n4K5J2EqIJXpeAITIzQnjSmettfxQ0/944XtieWTsjShcbAX vR2HteLfCibvXbvhHHt/25vGIM3LO8FoNJ7H/0r8yvITRHHzNdMp6iq2 X-Gm-Gg: AZFdTZcBqT0pSwkUCvNUlt85nUT+dOulqF/WVayEB56h5Je5JcsheR8wuGjoLFe2SRz c2SVRpABwUxVP5V6Ln4e6/TwfbmAaiIUYUAN/KW7qpxSQHhTUPSQVA4M+SbMhcGurpYMAFLefqb ffbf5p4/o2+jJQCrW+PQU2yTdHw7LvZd7IGvFnneyxodjZRzgOqI8fY3fEBfiLTo4w+i/zqD2SD GfAieNdLM/5PJQ+I6PiWFRgiFuasctruc82ENcF/b7TYNao/C7yTDPjj8YLyNpQcuMnJDePcsUM 3+2A3IJJaN38CgTcZ+6KIicHJAi8DxH5p+RnSuP5L5nDT3RjZn2W20wbxoI9Hba7Sd+AVIBW1Zh MTO92HAmj9qZHVRKfL6qESo1fzvSulFx29i7Cby41yHlgDY6CT2K3V3waoq5DbM1W9VtpYdZ31n yzXCb0szvfcQVWOjXkj+XJZHM31DI3JlRollP49MJQ1sPYmmGyy0sq35/ZBCUhKUzbpH7Wx2G2H d+sYX6iW+1G1smV2u0SffS2kcJWu36svjSSSXMNPjk6GUeaeYk7yxNf16BmfZh2BO++4jRhmvQi v8tu1PXZJwv1QSmAal9wISIATBmi2S1auS7d6CorNlbZ7n0CyspWWsa7+5fAYizLkvOc 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: linux-kselftest@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 > > > > > > > [...] > > >