# SPDX-License-Identifier: ((GPL-2.0 WITH Linux-syscall-note) OR BSD-3-Clause) name: netdev doc: netdev configuration over generic netlink. definitions: - type: flags name: xdp-act render-max: true entries: - name: basic doc: XDP features set supported by all drivers (XDP_ABORTED, XDP_DROP, XDP_PASS, XDP_TX) - name: redirect doc: The netdev supports XDP_REDIRECT - name: ndo-xmit doc: This feature informs if netdev implements ndo_xdp_xmit callback. - name: xsk-zerocopy doc: This feature informs if netdev supports AF_XDP in zero copy mode. - name: hw-offload doc: This feature informs if netdev supports XDP hw offloading. - name: rx-sg doc: This feature informs if netdev implements non-linear XDP buffer support in the driver napi callback. - name: ndo-xmit-sg doc: This feature informs if netdev implements non-linear XDP buffer support in ndo_xdp_xmit callback. - type: flags name: xdp-rx-metadata render-max: true entries: - name: timestamp doc: Device is capable of exposing receive HW timestamp via bpf_xdp_metadata_rx_timestamp(). - name: hash doc: Device is capable of exposing receive packet hash via bpf_xdp_metadata_rx_hash(). attribute-sets: - name: dev attributes: - name: ifindex doc: netdev ifindex type: u32 checks: min: 1 - name: pad type: pad - name: xdp-features doc: Bitmask of enabled xdp-features. type: u64 enum: xdp-act - name: xdp-zc-max-segs doc: max fragment count supported by ZC driver type: u32 checks: min: 1 - name: xdp-rx-metadata-features doc: Bitmask of supported XDP receive metadata features. See Documentation/networking/xdp-rx-metadata.rst for more details. type: u64 enum: xdp-rx-metadata - name: page-pool attributes: - name: id doc: Unique ID of a Page Pool instance. type: uint checks: min: 1 max: u32-max - name: ifindex doc: | ifindex of the netdev to which the pool belongs. May be reported as 0 if the page pool was allocated for a netdev which got destroyed already (page pools may outlast their netdevs because they wait for all memory to be returned). type: u32 checks: min: 1 max: s32-max - name: napi-id doc: Id of NAPI using this Page Pool instance. type: uint checks: min: 1 max: u32-max - name: inflight type: uint doc: | Number of outstanding references to this page pool (allocated but yet to be freed pages). Allocated pages may be held in socket receive queues, driver receive ring, page pool recycling ring, the page pool cache, etc. - name: inflight-mem type: uint doc: | Amount of memory held by inflight pages. - name: detach-time type: uint doc: | Seconds in CLOCK_BOOTTIME of when Page Pool was detached by the driver. Once detached Page Pool can no longer be used to allocate memory. Page Pools wait for all the memory allocated from them to be freed before truly disappearing. "Detached" Page Pools cannot be "re-attached", they are just waiting to disappear. Attribute is absent if Page Pool has not been detached, and can still be used to allocate new memory. operations: list: - name: dev-get doc: Get / dump information about a netdev. attribute-set: dev do: request: attributes: - ifindex reply: &dev-all attributes: - ifindex - xdp-features - xdp-zc-max-segs - xdp-rx-metadata-features dump: reply: *dev-all - name: dev-add-ntf doc: Notification about device appearing. notify: dev-get mcgrp: mgmt - name: dev-del-ntf doc: Notification about device disappearing. notify: dev-get mcgrp: mgmt - name: dev-change-ntf doc: Notification about device configuration being changed. notify: dev-get mcgrp: mgmt - name: page-pool-get doc: | Get / dump information about Page Pools. (Only Page Pools associated with a net_device can be listed.) attribute-set: page-pool do: request: attributes: - id reply: &pp-reply attributes: - id - ifindex - napi-id - inflight - inflight-mem - detach-time dump: reply: *pp-reply config-cond: page-pool - name: page-pool-add-ntf doc: Notification about page pool appearing. notify: page-pool-get mcgrp: page-pool config-cond: page-pool - name: page-pool-del-ntf doc: Notification about page pool disappearing. notify: page-pool-get mcgrp: page-pool config-cond: page-pool - name: page-pool-change-ntf doc: Notification about page pool configuration being changed. notify: page-pool-get mcgrp: page-pool config-cond: page-pool mcast-groups: list: - name: mgmt - name: page-pool