92 lines · plain
1.. SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)2 3==================4bpftool-struct_ops5==================6-------------------------------------------------------------------------------7tool to register/unregister/introspect BPF struct_ops8-------------------------------------------------------------------------------9 10:Manual section: 811 12.. include:: substitutions.rst13 14SYNOPSIS15========16 17**bpftool** [*OPTIONS*] **struct_ops** *COMMAND*18 19*OPTIONS* := { |COMMON_OPTIONS| }20 21*COMMANDS* :=22{ **show** | **list** | **dump** | **register** | **unregister** | **help** }23 24STRUCT_OPS COMMANDS25===================26 27| **bpftool** **struct_ops { show | list }** [*STRUCT_OPS_MAP*]28| **bpftool** **struct_ops dump** [*STRUCT_OPS_MAP*]29| **bpftool** **struct_ops register** *OBJ* [*LINK_DIR*]30| **bpftool** **struct_ops unregister** *STRUCT_OPS_MAP*31| **bpftool** **struct_ops help**32|33| *STRUCT_OPS_MAP* := { **id** *STRUCT_OPS_MAP_ID* | **name** *STRUCT_OPS_MAP_NAME* }34| *OBJ* := /a/file/of/bpf_struct_ops.o35 36 37DESCRIPTION38===========39bpftool struct_ops { show | list } [*STRUCT_OPS_MAP*]40 Show brief information about the struct_ops in the system. If41 *STRUCT_OPS_MAP* is specified, it shows information only for the given42 struct_ops. Otherwise, it lists all struct_ops currently existing in the43 system.44 45 Output will start with struct_ops map ID, followed by its map name and its46 struct_ops's kernel type.47 48bpftool struct_ops dump [*STRUCT_OPS_MAP*]49 Dump details information about the struct_ops in the system. If50 *STRUCT_OPS_MAP* is specified, it dumps information only for the given51 struct_ops. Otherwise, it dumps all struct_ops currently existing in the52 system.53 54bpftool struct_ops register *OBJ* [*LINK_DIR*]55 Register bpf struct_ops from *OBJ*. All struct_ops under the ELF section56 ".struct_ops" and ".struct_ops.link" will be registered to its kernel57 subsystem. For each struct_ops in the ".struct_ops.link" section, a link58 will be created. You can give *LINK_DIR* to provide a directory path where59 these links will be pinned with the same name as their corresponding map60 name.61 62bpftool struct_ops unregister *STRUCT_OPS_MAP*63 Unregister the *STRUCT_OPS_MAP* from the kernel subsystem.64 65bpftool struct_ops help66 Print short help message.67 68OPTIONS69=======70.. include:: common_options.rst71 72EXAMPLES73========74**# bpftool struct_ops show**75 76::77 78 100: dctcp tcp_congestion_ops79 105: cubic tcp_congestion_ops80 81**# bpftool struct_ops unregister id 105**82 83::84 85 Unregistered tcp_congestion_ops cubic id 10586 87**# bpftool struct_ops register bpf_cubic.o**88 89::90 91 Registered tcp_congestion_ops cubic id 11092