690 lines · yaml
1# SPDX-License-Identifier: ((GPL-2.0 WITH Linux-syscall-note) OR BSD-3-Clause)2 3name: netdev4 5doc:6 netdev configuration over generic netlink.7 8definitions:9 -10 type: flags11 name: xdp-act12 render-max: true13 entries:14 -15 name: basic16 doc:17 XDP features set supported by all drivers18 (XDP_ABORTED, XDP_DROP, XDP_PASS, XDP_TX)19 -20 name: redirect21 doc:22 The netdev supports XDP_REDIRECT23 -24 name: ndo-xmit25 doc:26 This feature informs if netdev implements ndo_xdp_xmit callback.27 -28 name: xsk-zerocopy29 doc:30 This feature informs if netdev supports AF_XDP in zero copy mode.31 -32 name: hw-offload33 doc:34 This feature informs if netdev supports XDP hw offloading.35 -36 name: rx-sg37 doc:38 This feature informs if netdev implements non-linear XDP buffer39 support in the driver napi callback.40 -41 name: ndo-xmit-sg42 doc:43 This feature informs if netdev implements non-linear XDP buffer44 support in ndo_xdp_xmit callback.45 -46 type: flags47 name: xdp-rx-metadata48 entries:49 -50 name: timestamp51 doc:52 Device is capable of exposing receive HW timestamp via bpf_xdp_metadata_rx_timestamp().53 -54 name: hash55 doc:56 Device is capable of exposing receive packet hash via bpf_xdp_metadata_rx_hash().57 -58 name: vlan-tag59 doc:60 Device is capable of exposing receive packet VLAN tag via bpf_xdp_metadata_rx_vlan_tag().61 -62 type: flags63 name: xsk-flags64 entries:65 -66 name: tx-timestamp67 doc:68 HW timestamping egress packets is supported by the driver.69 -70 name: tx-checksum71 doc:72 L3 checksum HW offload is supported by the driver.73 -74 name: queue-type75 type: enum76 entries: [ rx, tx ]77 -78 name: qstats-scope79 type: flags80 entries: [ queue ]81 82attribute-sets:83 -84 name: dev85 attributes:86 -87 name: ifindex88 doc: netdev ifindex89 type: u3290 checks:91 min: 192 -93 name: pad94 type: pad95 -96 name: xdp-features97 doc: Bitmask of enabled xdp-features.98 type: u6499 enum: xdp-act100 -101 name: xdp-zc-max-segs102 doc: max fragment count supported by ZC driver103 type: u32104 checks:105 min: 1106 -107 name: xdp-rx-metadata-features108 doc: Bitmask of supported XDP receive metadata features.109 See Documentation/networking/xdp-rx-metadata.rst for more details.110 type: u64111 enum: xdp-rx-metadata112 -113 name: xsk-features114 doc: Bitmask of enabled AF_XDP features.115 type: u64116 enum: xsk-flags117 -118 name: page-pool119 attributes:120 -121 name: id122 doc: Unique ID of a Page Pool instance.123 type: uint124 checks:125 min: 1126 max: u32-max127 -128 name: ifindex129 doc: |130 ifindex of the netdev to which the pool belongs.131 May be reported as 0 if the page pool was allocated for a netdev132 which got destroyed already (page pools may outlast their netdevs133 because they wait for all memory to be returned).134 type: u32135 checks:136 min: 1137 max: s32-max138 -139 name: napi-id140 doc: Id of NAPI using this Page Pool instance.141 type: uint142 checks:143 min: 1144 max: u32-max145 -146 name: inflight147 type: uint148 doc: |149 Number of outstanding references to this page pool (allocated150 but yet to be freed pages). Allocated pages may be held in151 socket receive queues, driver receive ring, page pool recycling152 ring, the page pool cache, etc.153 -154 name: inflight-mem155 type: uint156 doc: |157 Amount of memory held by inflight pages.158 -159 name: detach-time160 type: uint161 doc: |162 Seconds in CLOCK_BOOTTIME of when Page Pool was detached by163 the driver. Once detached Page Pool can no longer be used to164 allocate memory.165 Page Pools wait for all the memory allocated from them to be freed166 before truly disappearing. "Detached" Page Pools cannot be167 "re-attached", they are just waiting to disappear.168 Attribute is absent if Page Pool has not been detached, and169 can still be used to allocate new memory.170 -171 name: dmabuf172 doc: ID of the dmabuf this page-pool is attached to.173 type: u32174 -175 name: page-pool-info176 subset-of: page-pool177 attributes:178 -179 name: id180 -181 name: ifindex182 -183 name: page-pool-stats184 doc: |185 Page pool statistics, see docs for struct page_pool_stats186 for information about individual statistics.187 attributes:188 -189 name: info190 doc: Page pool identifying information.191 type: nest192 nested-attributes: page-pool-info193 -194 name: alloc-fast195 type: uint196 value: 8 # reserve some attr ids in case we need more metadata later197 -198 name: alloc-slow199 type: uint200 -201 name: alloc-slow-high-order202 type: uint203 -204 name: alloc-empty205 type: uint206 -207 name: alloc-refill208 type: uint209 -210 name: alloc-waive211 type: uint212 -213 name: recycle-cached214 type: uint215 -216 name: recycle-cache-full217 type: uint218 -219 name: recycle-ring220 type: uint221 -222 name: recycle-ring-full223 type: uint224 -225 name: recycle-released-refcnt226 type: uint227 228 -229 name: napi230 attributes:231 -232 name: ifindex233 doc: ifindex of the netdevice to which NAPI instance belongs.234 type: u32235 checks:236 min: 1237 -238 name: id239 doc: ID of the NAPI instance.240 type: u32241 -242 name: irq243 doc: The associated interrupt vector number for the napi244 type: u32245 -246 name: pid247 doc: PID of the napi thread, if NAPI is configured to operate in248 threaded mode. If NAPI is not in threaded mode (i.e. uses normal249 softirq context), the attribute will be absent.250 type: u32251 -252 name: queue253 attributes:254 -255 name: id256 doc: Queue index; most queue types are indexed like a C array, with257 indexes starting at 0 and ending at queue count - 1. Queue indexes258 are scoped to an interface and queue type.259 type: u32260 -261 name: ifindex262 doc: ifindex of the netdevice to which the queue belongs.263 type: u32264 checks:265 min: 1266 -267 name: type268 doc: Queue type as rx, tx. Each queue type defines a separate ID space.269 type: u32270 enum: queue-type271 -272 name: napi-id273 doc: ID of the NAPI instance which services this queue.274 type: u32275 -276 name: dmabuf277 doc: ID of the dmabuf attached to this queue, if any.278 type: u32279 280 -281 name: qstats282 doc: |283 Get device statistics, scoped to a device or a queue.284 These statistics extend (and partially duplicate) statistics available285 in struct rtnl_link_stats64.286 Value of the `scope` attribute determines how statistics are287 aggregated. When aggregated for the entire device the statistics288 represent the total number of events since last explicit reset of289 the device (i.e. not a reconfiguration like changing queue count).290 When reported per-queue, however, the statistics may not add291 up to the total number of events, will only be reported for currently292 active objects, and will likely report the number of events since last293 reconfiguration.294 attributes:295 -296 name: ifindex297 doc: ifindex of the netdevice to which stats belong.298 type: u32299 checks:300 min: 1301 -302 name: queue-type303 doc: Queue type as rx, tx, for queue-id.304 type: u32305 enum: queue-type306 -307 name: queue-id308 doc: Queue ID, if stats are scoped to a single queue instance.309 type: u32310 -311 name: scope312 doc: |313 What object type should be used to iterate over the stats.314 type: uint315 enum: qstats-scope316 -317 name: rx-packets318 doc: |319 Number of wire packets successfully received and passed to the stack.320 For drivers supporting XDP, XDP is considered the first layer321 of the stack, so packets consumed by XDP are still counted here.322 type: uint323 value: 8 # reserve some attr ids in case we need more metadata later324 -325 name: rx-bytes326 doc: Successfully received bytes, see `rx-packets`.327 type: uint328 -329 name: tx-packets330 doc: |331 Number of wire packets successfully sent. Packet is considered to be332 successfully sent once it is in device memory (usually this means333 the device has issued a DMA completion for the packet).334 type: uint335 -336 name: tx-bytes337 doc: Successfully sent bytes, see `tx-packets`.338 type: uint339 -340 name: rx-alloc-fail341 doc: |342 Number of times skb or buffer allocation failed on the Rx datapath.343 Allocation failure may, or may not result in a packet drop, depending344 on driver implementation and whether system recovers quickly.345 type: uint346 -347 name: rx-hw-drops348 doc: |349 Number of all packets which entered the device, but never left it,350 including but not limited to: packets dropped due to lack of buffer351 space, processing errors, explicit or implicit policies and packet352 filters.353 type: uint354 -355 name: rx-hw-drop-overruns356 doc: |357 Number of packets dropped due to transient lack of resources, such as358 buffer space, host descriptors etc.359 type: uint360 -361 name: rx-csum-complete362 doc: Number of packets that were marked as CHECKSUM_COMPLETE.363 type: uint364 -365 name: rx-csum-unnecessary366 doc: Number of packets that were marked as CHECKSUM_UNNECESSARY.367 type: uint368 -369 name: rx-csum-none370 doc: Number of packets that were not checksummed by device.371 type: uint372 -373 name: rx-csum-bad374 doc: |375 Number of packets with bad checksum. The packets are not discarded,376 but still delivered to the stack.377 type: uint378 -379 name: rx-hw-gro-packets380 doc: |381 Number of packets that were coalesced from smaller packets by the device.382 Counts only packets coalesced with the HW-GRO netdevice feature,383 LRO-coalesced packets are not counted.384 type: uint385 -386 name: rx-hw-gro-bytes387 doc: See `rx-hw-gro-packets`.388 type: uint389 -390 name: rx-hw-gro-wire-packets391 doc: |392 Number of packets that were coalesced to bigger packetss with the HW-GRO393 netdevice feature. LRO-coalesced packets are not counted.394 type: uint395 -396 name: rx-hw-gro-wire-bytes397 doc: See `rx-hw-gro-wire-packets`.398 type: uint399 -400 name: rx-hw-drop-ratelimits401 doc: |402 Number of the packets dropped by the device due to the received403 packets bitrate exceeding the device rate limit.404 type: uint405 -406 name: tx-hw-drops407 doc: |408 Number of packets that arrived at the device but never left it,409 encompassing packets dropped for reasons such as processing errors, as410 well as those affected by explicitly defined policies and packet411 filtering criteria.412 type: uint413 -414 name: tx-hw-drop-errors415 doc: Number of packets dropped because they were invalid or malformed.416 type: uint417 -418 name: tx-csum-none419 doc: |420 Number of packets that did not require the device to calculate the421 checksum.422 type: uint423 -424 name: tx-needs-csum425 doc: |426 Number of packets that required the device to calculate the checksum.427 type: uint428 -429 name: tx-hw-gso-packets430 doc: |431 Number of packets that necessitated segmentation into smaller packets432 by the device.433 type: uint434 -435 name: tx-hw-gso-bytes436 doc: See `tx-hw-gso-packets`.437 type: uint438 -439 name: tx-hw-gso-wire-packets440 doc: |441 Number of wire-sized packets generated by processing442 `tx-hw-gso-packets`443 type: uint444 -445 name: tx-hw-gso-wire-bytes446 doc: See `tx-hw-gso-wire-packets`.447 type: uint448 -449 name: tx-hw-drop-ratelimits450 doc: |451 Number of the packets dropped by the device due to the transmit452 packets bitrate exceeding the device rate limit.453 type: uint454 -455 name: tx-stop456 doc: |457 Number of times driver paused accepting new tx packets458 from the stack to this queue, because the queue was full.459 Note that if BQL is supported and enabled on the device460 the networking stack will avoid queuing a lot of data at once.461 type: uint462 -463 name: tx-wake464 doc: |465 Number of times driver re-started accepting send466 requests to this queue from the stack.467 type: uint468 -469 name: queue-id470 subset-of: queue471 attributes:472 -473 name: id474 -475 name: type476 -477 name: dmabuf478 attributes:479 -480 name: ifindex481 doc: netdev ifindex to bind the dmabuf to.482 type: u32483 checks:484 min: 1485 -486 name: queues487 doc: receive queues to bind the dmabuf to.488 type: nest489 nested-attributes: queue-id490 multi-attr: true491 -492 name: fd493 doc: dmabuf file descriptor to bind.494 type: u32495 -496 name: id497 doc: id of the dmabuf binding498 type: u32499 checks:500 min: 1501 502operations:503 list:504 -505 name: dev-get506 doc: Get / dump information about a netdev.507 attribute-set: dev508 do:509 request:510 attributes:511 - ifindex512 reply: &dev-all513 attributes:514 - ifindex515 - xdp-features516 - xdp-zc-max-segs517 - xdp-rx-metadata-features518 - xsk-features519 dump:520 reply: *dev-all521 -522 name: dev-add-ntf523 doc: Notification about device appearing.524 notify: dev-get525 mcgrp: mgmt526 -527 name: dev-del-ntf528 doc: Notification about device disappearing.529 notify: dev-get530 mcgrp: mgmt531 -532 name: dev-change-ntf533 doc: Notification about device configuration being changed.534 notify: dev-get535 mcgrp: mgmt536 -537 name: page-pool-get538 doc: |539 Get / dump information about Page Pools.540 (Only Page Pools associated with a net_device can be listed.)541 attribute-set: page-pool542 do:543 request:544 attributes:545 - id546 reply: &pp-reply547 attributes:548 - id549 - ifindex550 - napi-id551 - inflight552 - inflight-mem553 - detach-time554 - dmabuf555 dump:556 reply: *pp-reply557 config-cond: page-pool558 -559 name: page-pool-add-ntf560 doc: Notification about page pool appearing.561 notify: page-pool-get562 mcgrp: page-pool563 config-cond: page-pool564 -565 name: page-pool-del-ntf566 doc: Notification about page pool disappearing.567 notify: page-pool-get568 mcgrp: page-pool569 config-cond: page-pool570 -571 name: page-pool-change-ntf572 doc: Notification about page pool configuration being changed.573 notify: page-pool-get574 mcgrp: page-pool575 config-cond: page-pool576 -577 name: page-pool-stats-get578 doc: Get page pool statistics.579 attribute-set: page-pool-stats580 do:581 request:582 attributes:583 - info584 reply: &pp-stats-reply585 attributes:586 - info587 - alloc-fast588 - alloc-slow589 - alloc-slow-high-order590 - alloc-empty591 - alloc-refill592 - alloc-waive593 - recycle-cached594 - recycle-cache-full595 - recycle-ring596 - recycle-ring-full597 - recycle-released-refcnt598 dump:599 reply: *pp-stats-reply600 config-cond: page-pool-stats601 -602 name: queue-get603 doc: Get queue information from the kernel.604 Only configured queues will be reported (as opposed to all available605 hardware queues).606 attribute-set: queue607 do:608 request:609 attributes:610 - ifindex611 - type612 - id613 reply: &queue-get-op614 attributes:615 - id616 - type617 - napi-id618 - ifindex619 - dmabuf620 dump:621 request:622 attributes:623 - ifindex624 reply: *queue-get-op625 -626 name: napi-get627 doc: Get information about NAPI instances configured on the system.628 attribute-set: napi629 do:630 request:631 attributes:632 - id633 reply: &napi-get-op634 attributes:635 - id636 - ifindex637 - irq638 - pid639 dump:640 request:641 attributes:642 - ifindex643 reply: *napi-get-op644 -645 name: qstats-get646 doc: |647 Get / dump fine grained statistics. Which statistics are reported648 depends on the device and the driver, and whether the driver stores649 software counters per-queue.650 attribute-set: qstats651 dump:652 request:653 attributes:654 - ifindex655 - scope656 reply:657 attributes:658 - ifindex659 - queue-type660 - queue-id661 - rx-packets662 - rx-bytes663 - tx-packets664 - tx-bytes665 -666 name: bind-rx667 doc: Bind dmabuf to netdev668 attribute-set: dmabuf669 flags: [ admin-perm ]670 do:671 request:672 attributes:673 - ifindex674 - fd675 - queues676 reply:677 attributes:678 - id679 680kernel-family:681 headers: [ "linux/list.h"]682 sock-priv: struct list_head683 684mcast-groups:685 list:686 -687 name: mgmt688 -689 name: page-pool690