bpftool-struct_ops.rst 2.6 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091
  1. .. SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
  2. ==================
  3. bpftool-struct_ops
  4. ==================
  5. -------------------------------------------------------------------------------
  6. tool to register/unregister/introspect BPF struct_ops
  7. -------------------------------------------------------------------------------
  8. :Manual section: 8
  9. .. include:: substitutions.rst
  10. SYNOPSIS
  11. ========
  12. **bpftool** [*OPTIONS*] **struct_ops** *COMMAND*
  13. *OPTIONS* := { |COMMON_OPTIONS| }
  14. *COMMANDS* :=
  15. { **show** | **list** | **dump** | **register** | **unregister** | **help** }
  16. STRUCT_OPS COMMANDS
  17. ===================
  18. | **bpftool** **struct_ops { show | list }** [*STRUCT_OPS_MAP*]
  19. | **bpftool** **struct_ops dump** [*STRUCT_OPS_MAP*]
  20. | **bpftool** **struct_ops register** *OBJ* [*LINK_DIR*]
  21. | **bpftool** **struct_ops unregister** *STRUCT_OPS_MAP*
  22. | **bpftool** **struct_ops help**
  23. |
  24. | *STRUCT_OPS_MAP* := { **id** *STRUCT_OPS_MAP_ID* | **name** *STRUCT_OPS_MAP_NAME* }
  25. | *OBJ* := /a/file/of/bpf_struct_ops.o
  26. DESCRIPTION
  27. ===========
  28. bpftool struct_ops { show | list } [*STRUCT_OPS_MAP*]
  29. Show brief information about the struct_ops in the system. If
  30. *STRUCT_OPS_MAP* is specified, it shows information only for the given
  31. struct_ops. Otherwise, it lists all struct_ops currently existing in the
  32. system.
  33. Output will start with struct_ops map ID, followed by its map name and its
  34. struct_ops's kernel type.
  35. bpftool struct_ops dump [*STRUCT_OPS_MAP*]
  36. Dump details information about the struct_ops in the system. If
  37. *STRUCT_OPS_MAP* is specified, it dumps information only for the given
  38. struct_ops. Otherwise, it dumps all struct_ops currently existing in the
  39. system.
  40. bpftool struct_ops register *OBJ* [*LINK_DIR*]
  41. Register bpf struct_ops from *OBJ*. All struct_ops under the ELF section
  42. ".struct_ops" and ".struct_ops.link" will be registered to its kernel
  43. subsystem. For each struct_ops in the ".struct_ops.link" section, a link
  44. will be created. You can give *LINK_DIR* to provide a directory path where
  45. these links will be pinned with the same name as their corresponding map
  46. name.
  47. bpftool struct_ops unregister *STRUCT_OPS_MAP*
  48. Unregister the *STRUCT_OPS_MAP* from the kernel subsystem.
  49. bpftool struct_ops help
  50. Print short help message.
  51. OPTIONS
  52. =======
  53. .. include:: common_options.rst
  54. EXAMPLES
  55. ========
  56. **# bpftool struct_ops show**
  57. ::
  58. 100: dctcp tcp_congestion_ops
  59. 105: cubic tcp_congestion_ops
  60. **# bpftool struct_ops unregister id 105**
  61. ::
  62. Unregistered tcp_congestion_ops cubic id 105
  63. **# bpftool struct_ops register bpf_cubic.o**
  64. ::
  65. Registered tcp_congestion_ops cubic id 110