1 .. SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
6 -------------------------------------------------------------------------------
7 tool to register/unregister/introspect BPF struct_ops
8 -------------------------------------------------------------------------------
12 .. include:: substitutions.rst
17 **bpftool** [*OPTIONS*] **struct_ops** *COMMAND*
19 *OPTIONS* := { |COMMON_OPTIONS| }
22 { **show** | **list** | **dump** | **register** | **unregister** | **help** }
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**
33 | *STRUCT_OPS_MAP* := { **id** *STRUCT_OPS_MAP_ID* | **name** *STRUCT_OPS_MAP_NAME* }
34 | *OBJ* := /a/file/of/bpf_struct_ops.o
39 **bpftool struct_ops { show | list }** [*STRUCT_OPS_MAP*]
40 Show brief information about the struct_ops in the system.
41 If *STRUCT_OPS_MAP* is specified, it shows information only
42 for the given struct_ops. Otherwise, it lists all struct_ops
43 currently existing in the system.
45 Output will start with struct_ops map ID, followed by its map
46 name and its struct_ops's kernel type.
48 **bpftool struct_ops dump** [*STRUCT_OPS_MAP*]
49 Dump details information about the struct_ops in the system.
50 If *STRUCT_OPS_MAP* is specified, it dumps information only
51 for the given struct_ops. Otherwise, it dumps all struct_ops
52 currently existing in the system.
54 **bpftool struct_ops register** *OBJ* [*LINK_DIR*]
55 Register bpf struct_ops from *OBJ*. All struct_ops under
56 the ELF section ".struct_ops" and ".struct_ops.link" will
57 be registered to its kernel subsystem. For each
58 struct_ops in the ".struct_ops.link" section, a link
59 will be created. You can give *LINK_DIR* to provide a
60 directory path where these links will be pinned with the
61 same name as their corresponding map name.
63 **bpftool struct_ops unregister** *STRUCT_OPS_MAP*
64 Unregister the *STRUCT_OPS_MAP* from the kernel subsystem.
66 **bpftool struct_ops help**
67 Print short help message.
71 .. include:: common_options.rst
75 **# bpftool struct_ops show**
79 100: dctcp tcp_congestion_ops
80 105: cubic tcp_congestion_ops
82 **# bpftool struct_ops unregister id 105**
86 Unregistered tcp_congestion_ops cubic id 105
88 **# bpftool struct_ops register bpf_cubic.o**
92 Registered tcp_congestion_ops cubic id 110