Received: by 2002:a05:6358:3188:b0:123:57c1:9b43 with SMTP id q8csp148106rwd; Fri, 26 May 2023 16:43:36 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ62rdyMwTemm6L3X08c4D9VWz5fJ4AieV3nZfqZXlhJq5Mltt76Mlo1Be3iUCNlGJOkknKr X-Received: by 2002:a05:6a00:2193:b0:62d:d045:392 with SMTP id h19-20020a056a00219300b0062dd0450392mr6040408pfi.32.1685144616383; Fri, 26 May 2023 16:43:36 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1685144616; cv=none; d=google.com; s=arc-20160816; b=ziAL5AXVT6jsCWg4oX0MqxI3WNvU1ruwIx7qiJXyYz8F5xlbxUDwzAfKAazQ6CkxYi gOUkyr4Ze0lBRhj3QfzxgToPSpFGbqbhIjgZwEXV5PIQ2WVw1WHPSzWUQA0xVJICd0tP IHjcGQpLZVgCqz9ZLwX40IdOszruIybHpqaKqRHhZ4K/Uf3Q6ateIw+htk688rqYwY5+ w225nuwhXB/1UY7DgqybEWBHv668286iBQ2pbw/5yWqE8o6M1hQ+ti3B694TUdd/UJpw 4wO1prN5WHe+UJcRpYLCCeyQ2BMZPUZGzpYV+9aZIIKRf4AAC6v2hRkiGzs9LI8drX1r tjYg== 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=YzzwX4jI8qfzX9UxemVFwpvHZe0mlondIIclMNme04k=; b=qfEx2aVGInrMpSshRUscqTBNGMwKyK9A5ySJ4COp8Czv+jfua3IgVhr4mXpcx2JthZ s9QtfqSy0iIbDoq1eJjzUd9/81Zg9c0mj7a4phQLs9Va4xjvUe7WftCkLUCUcPuZxqMc V6uy8x+6lAvT9OtuPpsxBqzCCHbBSQGECClH9Fj+17qHl+kxw1m6mlJqJFed6lGES3z4 SltdQ4AIleZkk6KIWfDO4kCSBewwaQ5mcph1SjLkUxHXdCqx/6UmfifQ2fJWdK7kRnnq KFIS+yFLw9CP871WsCxV3mIgOTIF6Qptx/B6K+0Tbc1XF4RO2k5Snrt0eotBYx+n1glE 6+Rw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20221208 header.b=kOmmndwQ; 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 m16-20020a637d50000000b005362a68241bsi1864413pgn.771.2023.05.26.16.43.06; Fri, 26 May 2023 16:43:36 -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=kOmmndwQ; 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 S230172AbjEZXK5 (ORCPT + 99 others); Fri, 26 May 2023 19:10:57 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:52782 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229502AbjEZXKz (ORCPT ); Fri, 26 May 2023 19:10:55 -0400 Received: from mail-pl1-x635.google.com (mail-pl1-x635.google.com [IPv6:2607:f8b0:4864:20::635]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 6B529D3; Fri, 26 May 2023 16:10:54 -0700 (PDT) Received: by mail-pl1-x635.google.com with SMTP id d9443c01a7336-1b00ecabdf2so12527675ad.2; Fri, 26 May 2023 16:10:54 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20221208; t=1685142654; x=1687734654; 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=YzzwX4jI8qfzX9UxemVFwpvHZe0mlondIIclMNme04k=; b=kOmmndwQp9sckObT8PMVXR0Jua13g0JMjsVP11/n53DvSbyiVl07xv7ErsjTN3+ljb pgwYyLArOIMtt6VCBijW02qFExxJhQ+BC8K+NRokMemDTCbWp1Px8LmvnX92jYWgfY5E +4FByQgOzkGVTRBRFvj6Jg8PklCII0pibxyUkOFxZ73yLColAp9C3lW4Sw5Vg1eDmTu5 Pgc7gbcSe/gwsEGuuc5IeNM44r8M054Jo8ONmDpeAzivOlI9NWf4YgNAwJ/v24tPpKYS 02WsVHpxzFl1xzzYvgsF2xMcxgnihqwXeIxpIwnSwEiY89hK5GcSEQbUKrqb6FPgX11t FqYQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1685142654; x=1687734654; 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=YzzwX4jI8qfzX9UxemVFwpvHZe0mlondIIclMNme04k=; b=fORfJG9SdKlbPRASJHkeibxvo1MIHP0Cb8MR8U92CmYe7X6vN556W/XuccdZ+6EGwJ QtO7PDmERvlGXGEeRq1sWqgX2ILxeTAxaLJY3rM3j7jxZILEn6sGA+tLueCA5mxxq5Vi UCa5Si/7uwHSM40Nd0VI0jXXdus5LWOrnEHSCiUdW9bCcsR9ID2XLPo3Hz6yTZtd1d4K qVXtHC7mYlcG3UPBcrnIBzIo6GRSfXwVAw0lnCh4xyVkjxlZJIElZ++9mBVHvJd/UgJt H+fkJKm5i57daLRIRCqKHzEDEW7HxtAPc4mT424QqGrGUPShS1qj/o6SxWo9TavGRjFe duNw== X-Gm-Message-State: AC+VfDzi+YRSm5poJPZiUrF5Y5ytsm4ekZvmEfJwZpH/WrCqrhgqF9wq N0MH7YpHWZMxAYKrRpFdazeDvpMZFGxpPkkI+N8= X-Received: by 2002:a17:903:22c3:b0:1b0:122f:672b with SMTP id y3-20020a17090322c300b001b0122f672bmr4172388plg.47.1685142653765; Fri, 26 May 2023 16:10:53 -0700 (PDT) MIME-Version: 1.0 References: <073cf884-e191-e323-1445-b79c86759557@linux.dev> In-Reply-To: From: Zhouyi Zhou Date: Sat, 27 May 2023 07:10:42 +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 Sun, May 21, 2023 at 4:27=E2=80=AFPM Zhouyi Zhou = wrote: > > 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 vmli= nux 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=3D= 3 > > > '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 invoke following commands, and it works: cd tools/testing/selftests/bpf find . -name vmlinux.h|xargs rm make -j 20 put bpf_cubic.bpf.o to my virtual machine, and it works! I don't know why Thank you all! Best Regards Zhouyi > > I am an enthusiastic learner ;-) > > Thanks in advance > Zhouyi > > >