tcp_metrics.yaml 3.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169
  1. # SPDX-License-Identifier: ((GPL-2.0 WITH Linux-syscall-note) OR BSD-3-Clause)
  2. name: tcp_metrics
  3. protocol: genetlink-legacy
  4. doc: |
  5. Management interface for TCP metrics.
  6. c-family-name: tcp-metrics-genl-name
  7. c-version-name: tcp-metrics-genl-version
  8. max-by-define: true
  9. kernel-policy: global
  10. definitions:
  11. -
  12. name: tcp-fastopen-cookie-max
  13. type: const
  14. value: 16
  15. attribute-sets:
  16. -
  17. name: tcp-metrics
  18. name-prefix: tcp-metrics-attr-
  19. attributes:
  20. -
  21. name: addr-ipv4
  22. type: u32
  23. byte-order: big-endian
  24. display-hint: ipv4
  25. -
  26. name: addr-ipv6
  27. type: binary
  28. checks:
  29. min-len: 16
  30. byte-order: big-endian
  31. display-hint: ipv6
  32. -
  33. name: age
  34. type: u64
  35. -
  36. name: tw-tsval
  37. type: u32
  38. doc: unused
  39. -
  40. name: tw-ts-stamp
  41. type: s32
  42. doc: unused
  43. -
  44. name: vals
  45. type: nest
  46. nested-attributes: metrics
  47. -
  48. name: fopen-mss
  49. type: u16
  50. -
  51. name: fopen-syn-drops
  52. type: u16
  53. -
  54. name: fopen-syn-drop-ts
  55. type: u64
  56. -
  57. name: fopen-cookie
  58. type: binary
  59. checks:
  60. min-len: tcp-fastopen-cookie-max
  61. -
  62. name: saddr-ipv4
  63. type: u32
  64. byte-order: big-endian
  65. display-hint: ipv4
  66. -
  67. name: saddr-ipv6
  68. type: binary
  69. checks:
  70. min-len: 16
  71. byte-order: big-endian
  72. display-hint: ipv6
  73. -
  74. name: pad
  75. type: pad
  76. -
  77. name: metrics
  78. # Intentionally don't define the name-prefix, see below.
  79. doc: |
  80. Attributes with metrics. Note that the values here do not match
  81. the TCP_METRIC_* defines in the kernel, because kernel defines
  82. are off-by one (e.g. rtt is defined as enum 0, while netlink carries
  83. attribute type 1).
  84. attributes:
  85. -
  86. name: rtt
  87. type: u32
  88. doc: |
  89. Round Trip Time (RTT), in msecs with 3 bits fractional
  90. (left-shift by 3 to get the msec value).
  91. -
  92. name: rttvar
  93. type: u32
  94. doc: |
  95. Round Trip Time VARiance (RTT), in msecs with 2 bits fractional
  96. (left-shift by 2 to get the msec value).
  97. -
  98. name: ssthresh
  99. type: u32
  100. doc: Slow Start THRESHold.
  101. -
  102. name: cwnd
  103. type: u32
  104. doc: Congestion Window.
  105. -
  106. name: reodering
  107. type: u32
  108. doc: Reodering metric.
  109. -
  110. name: rtt-us
  111. type: u32
  112. doc: |
  113. Round Trip Time (RTT), in usecs, with 3 bits fractional
  114. (left-shift by 3 to get the msec value).
  115. -
  116. name: rttvar-us
  117. type: u32
  118. doc: |
  119. Round Trip Time (RTT), in usecs, with 2 bits fractional
  120. (left-shift by 3 to get the msec value).
  121. operations:
  122. list:
  123. -
  124. name: get
  125. doc: Retrieve metrics.
  126. attribute-set: tcp-metrics
  127. dont-validate: [ strict, dump ]
  128. do:
  129. request: &sel_attrs
  130. attributes:
  131. - addr-ipv4
  132. - addr-ipv6
  133. - saddr-ipv4
  134. - saddr-ipv6
  135. reply: &all_attrs
  136. attributes:
  137. - addr-ipv4
  138. - addr-ipv6
  139. - saddr-ipv4
  140. - saddr-ipv6
  141. - age
  142. - vals
  143. - fopen-mss
  144. - fopen-syn-drops
  145. - fopen-syn-drop-ts
  146. - fopen-cookie
  147. dump:
  148. reply: *all_attrs
  149. -
  150. name: del
  151. doc: Delete metrics.
  152. attribute-set: tcp-metrics
  153. dont-validate: [ strict, dump ]
  154. flags: [ admin-perm ]
  155. do:
  156. request: *sel_attrs