Received: by 2002:a05:6358:3188:b0:123:57c1:9b43 with SMTP id q8csp1594673rwd; Sun, 21 May 2023 01:53:03 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ4gPgmLioDVMiQsxzNupT2IY+6NtgnPIdnZ9LGO+FCmjzfib9aA1m1j2RS5ciiRkqt/74uu X-Received: by 2002:a05:6a20:8f15:b0:10a:ef03:3346 with SMTP id b21-20020a056a208f1500b0010aef033346mr3276954pzk.9.1684659183158; Sun, 21 May 2023 01:53:03 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1684659183; cv=none; d=google.com; s=arc-20160816; b=03jCZMUHOKVN5LPzOB+QPcRUaKBmpPKzmFIJ2B0dgECuR0Br8vfI7fZ+OQ5d395M/p YPH27q8U5CXA7jPuvRi80DmM8chiK+vSqKz4glVL6eJgCwPHGJqu2nibXlSanZpsQZH0 EaqQlLb2YwPTl4T92j73UxcXx2o4tgUjjNyxXJaUbBou8TPLT+6LPd/G9ZkelwS73zX2 9WzWMcjYsnIxu2t0h1kFjH4tfOrlhT5xUBX+zwDRC+fjWSlhi5yGbbSZi/rsfiaHV9Hi f/qoJnYb2rQE8hk2ElaFBa8C6O2hLkbbnEY+g73bKcSF9bvvlQrNlsSqkeCCC5Kloe1S 9NeA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:cc:to:subject :message-id:date:from:in-reply-to:references:mime-version :dkim-signature; bh=hrdKLIRM4AS0rC58VKVCcGhDZRDgFeoEK6NEHLR6op0=; b=oODuA7z/3Q6PX9F5O/H5g5LDU1/4Z5ILxc7JSh02+C9eXJxHNYR1ahyod4GU04+Imi B4RG0sJn0LfJamlrKwe834qcnIdVVjLzvrB9ZF3I7uVQhMxXKISM9Zyd9ZGr+rOfAoTE 5SbSZIUIdrtpVAG912TmKvBI8eouc3FcrIojJGxyccRcvt902/3Vhdq8Gx5hu+XFBvC1 3osOmgG80H1ZHSgesKPkucySQF8K/9It0ENczvTIuoiymzEJhB+DMcEFN5lEZ34GA0zc 7YNCgCQWqvMitqtOHUzdomDIurFnn+Bvc3FF6AJ02oSGoCNIlQnRXaFWc7SYs7Eh7J4u YtVg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20221208 header.b=qqC0baMB; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id x6-20020a626306000000b00641265d7890si2957176pfb.176.2023.05.21.01.52.49; Sun, 21 May 2023 01:53:03 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20221208 header.b=qqC0baMB; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230187AbjEUInD (ORCPT + 99 others); Sun, 21 May 2023 04:43:03 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:49068 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229990AbjEUI2L (ORCPT ); Sun, 21 May 2023 04:28:11 -0400 Received: from mail-pg1-x530.google.com (mail-pg1-x530.google.com [IPv6:2607:f8b0:4864:20::530]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id D0C7EEA; Sun, 21 May 2023 01:28:07 -0700 (PDT) Received: by mail-pg1-x530.google.com with SMTP id 41be03b00d2f7-517ab9a4a13so4353770a12.1; Sun, 21 May 2023 01:28:07 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20221208; t=1684657687; x=1687249687; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:from:to:cc:subject:date :message-id:reply-to; bh=hrdKLIRM4AS0rC58VKVCcGhDZRDgFeoEK6NEHLR6op0=; b=qqC0baMBH4MOm64Rby4dE76gGcOhRia0P2eyBq4PunGsQDGqGGSRd6yOfvY0cbvKwS eKBUSpdbZyWn3yS40uqyIflux1jmoqei0cGD4T0MEOSz2y4FbTt3AC4J+otJH9iz/26f Pr9Ubw5cL5OZZTe4aQFzqvf4OZavlglzcbji8G0RNyLrbBOZ0slqd00kvjKWlyU3rNOM qFaS/DZ6LkHjG3aFoTZsQ0Qau9z1Y1525tSTzwkr2HZ2pT6lNLNwfKcqHGY9s73g/K49 /7+AbLsitzfYABv0ToXjtVbroJcijvdrJ0ufT49b+8KQUOwVNu0MRlnuiFvIFq208RHs OiPA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1684657687; x=1687249687; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=hrdKLIRM4AS0rC58VKVCcGhDZRDgFeoEK6NEHLR6op0=; b=MBd9bBaTxUbroIMeuc6UlJyb/VhhdB2i35/czNIJSh4yvfIVlPylxGk94CWckSb1dx rmOmbpArvpZOWzFf0qqMu+7UknRQui1GqEUV+Q38JoNBZLA9c2HPYyZyNqIGIWP8Wcr1 ZFuy/uub3jZ/YZj6at+82pZuAnJcG3J/vsOE+GmL/3sRblS/Bu4RL7uvyZLkgqDtmnjJ uxq+LOQSK+0AB7L2wdYbtK0oag0KFNAw5OBhuiTwgsyVkg5nZ6FXQy+ck491ZhHC2Bgy 8S9ezjTsTHNf/TLWG52CybfXPfVXHEXvod9bYHld0UbbQElOx2udGQg7m6M7zH3yj48b TXow== X-Gm-Message-State: AC+VfDzE3c+Hr+TYRW4c+1JONCeVaIqij9GZXtKuLEAbTVxFsNf6EDbk ZFgHhu08zDLWpPL0B+FLvV9ZoRK1gktlsaplf1dU3sF2jCM= X-Received: by 2002:a17:902:e80b:b0:1a1:f5dd:2dce with SMTP id u11-20020a170902e80b00b001a1f5dd2dcemr9325538plg.6.1684657687149; Sun, 21 May 2023 01:28:07 -0700 (PDT) MIME-Version: 1.0 References: <073cf884-e191-e323-1445-b79c86759557@linux.dev> In-Reply-To: From: Zhouyi Zhou Date: Sun, 21 May 2023 16:27:56 +0800 Message-ID: Subject: Re: a small question about bpftool struct_ops To: Martin KaFai Lau Cc: bpf@vger.kernel.org, linux-kernel Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FREEMAIL_FROM, RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi On Sat, May 20, 2023 at 7:37=E2=80=AFAM Zhouyi Zhou = wrote: > > Thank you for responding so quickly ;-) > > On Sat, May 20, 2023 at 3:01=E2=80=AFAM Martin KaFai Lau wrote: > > > > On 5/19/23 5:07 AM, Zhouyi Zhou wrote: > > > Dear developers: > > > I compiled bpftool and bpf tests in mainline (2d1bcbc6cd70), > > > but when I invoke: > > > bpftool struct_ops register bpf_cubic.bpf.o > > > > > > the command line fail with: > > > libbpf: struct_ops init_kern: struct tcp_congestion_ops data is not > > > found in struct bpf_struct_ops_tcp_congestion_ops > > > > At the machine trying to register the bpf_cubic, please dump the vmlinu= x btf and > > search for bpf_struct_ops_tcp_congestion_ops and paste it here: > > > > For example: > > #> bpftool btf dump file /sys/kernel/btf/vmlinux > > > > ... > > > > [74578] STRUCT 'bpf_struct_ops_tcp_congestion_ops' size=3D256 vlen=3D3 > > 'refcnt' type_id=3D145 bits_offset=3D0 > > 'state' type_id=3D74569 bits_offset=3D32 > > 'data' type_id=3D6241 bits_offset=3D512 > OK > [214398] STRUCT 'bpf_struct_ops_tcp_congestion_ops' size=3D256 vlen=3D3 > 'refcnt' type_id=3D298 bits_offset=3D0 > 'state' type_id=3D214224 bits_offset=3D32 > 'data' type_id=3D213704 bits_offset=3D512 > > Please tell me if I could provide any further information. > > You are of great help > > Thank you very much > Zhouyi Thanks for your help Or, can you teach me how to prepare an environment that can run "bpftool struct_ops register xxx.o" ;-) (A few words of description of OS version (Ubuntu/CentOS/Suse for etc) and example kernel .config is enough) I am an enthusiastic learner ;-) Thanks in advance Zhouyi > >