include/net/devlink.h
Source file repositories/reference/linux-study-clean/include/net/devlink.h
File Facts
- System
- Linux kernel
- Corpus path
include/net/devlink.h- Extension
.h- Size
- 78129 bytes
- Lines
- 2172
- Domain
- Networking Core
- Bucket
- Sockets, Protocols, Packet Path, And Network Policy
- Inferred role
- Networking Core: operation-table or driver-model contract
- Status
- pattern implementation candidate
Why This File Exists
Networking stack implementation surface: socket APIs, protocol dispatch, packet flow, routing, filtering, and network namespaces.
- Networking stack implementation surface: socket APIs, protocol dispatch, packet flow, routing, filtering, and network namespaces.
- Defines an operation table; this is where Linux turns generic core objects into subsystem-specific behavior.
- Touches IRQ or DMA behavior; this matters for the representative real-device path.
- Defines or uses C structs; map object ownership, embedded links, reference counts, and lock ownership.
Dependency Surface
linux/device.hlinux/slab.hlinux/gfp.hlinux/list.hlinux/netdevice.hlinux/spinlock.hlinux/workqueue.hlinux/refcount.hnet/net_namespace.hnet/flow_offload.huapi/linux/devlink.hlinux/xarray.hlinux/firmware.h
Detected Declarations
struct devlinkstruct devlink_linecardstruct devlink_port_phys_attrsstruct devlink_port_pci_pf_attrsstruct devlink_port_pci_vf_attrsstruct devlink_port_pci_sf_attrsstruct devlink_port_attrsstruct devlink_ratestruct devlink_portstruct devlink_port_new_attrsstruct devlink_linecard_opsstruct devlink_sb_pool_infostruct devlink_dpipe_fieldstruct devlink_dpipe_headerstruct devlink_dpipe_matchstruct devlink_dpipe_actionstruct devlink_dpipe_valuestruct devlink_dpipe_entrystruct devlink_dpipe_dump_ctxstruct devlink_dpipe_table_opsstruct devlink_dpipe_tablestruct devlink_dpipe_table_opsstruct devlink_dpipe_headersstruct devlink_resource_size_paramsstruct devlink_param_u64_arraystruct devlink_param_gset_ctxstruct devlink_flash_notifystruct devlink_paramstruct devlink_param_itemstruct devlink_flash_update_paramsstruct devlink_regionstruct devlink_info_reqstruct devlink_region_opsstruct devlink_port_region_opsstruct devlink_fmsgstruct devlink_health_reporterstruct devlink_health_reporter_opsstruct devlink_trap_metadatastruct devlink_trap_policerstruct devlink_trap_groupstruct devlink_trapstruct devlink_opsstruct ib_devicestruct devlink_port_opsenum devlink_param_typeenum devlink_param_generic_idenum devlink_health_reporter_stateenum devlink_trap_generic_id
Annotated Snippet
const struct device_driver *driver);
void devlink_shd_put(struct devlink *devlink);
void *devlink_shd_get_priv(struct devlink *devlink);
/**
* struct devlink_port_ops - Port operations
* @port_split: Callback used to split the port into multiple ones.
* @port_unsplit: Callback used to unsplit the port group back into
* a single port.
* @port_type_set: Callback used to set a type of a port.
* @port_del: Callback used to delete selected port along with related function.
* Devlink core calls this upon user request to delete
* a port previously created by devlink_ops->port_new().
* @port_fn_hw_addr_get: Callback used to set port function's hardware address.
* Should be used by device drivers to report
* the hardware address of a function managed
* by the devlink port.
* @port_fn_hw_addr_set: Callback used to set port function's hardware address.
* Should be used by device drivers to set the hardware
* address of a function managed by the devlink port.
* @port_fn_roce_get: Callback used to get port function's RoCE capability.
* Should be used by device drivers to report
* the current state of RoCE capability of a function
* managed by the devlink port.
* @port_fn_roce_set: Callback used to set port function's RoCE capability.
* Should be used by device drivers to enable/disable
* RoCE capability of a function managed
* by the devlink port.
* @port_fn_migratable_get: Callback used to get port function's migratable
* capability. Should be used by device drivers
* to report the current state of migratable capability
* of a function managed by the devlink port.
* @port_fn_migratable_set: Callback used to set port function's migratable
* capability. Should be used by device drivers
* to enable/disable migratable capability of
* a function managed by the devlink port.
* @port_fn_state_get: Callback used to get port function's state.
* Should be used by device drivers to report
* the current admin and operational state of a
* function managed by the devlink port.
* @port_fn_state_set: Callback used to get port function's state.
* Should be used by device drivers set
* the admin state of a function managed
* by the devlink port.
* @port_fn_ipsec_crypto_get: Callback used to get port function's ipsec_crypto
* capability. Should be used by device drivers
* to report the current state of ipsec_crypto
* capability of a function managed by the devlink
* port.
* @port_fn_ipsec_crypto_set: Callback used to set port function's ipsec_crypto
* capability. Should be used by device drivers to
* enable/disable ipsec_crypto capability of a
* function managed by the devlink port.
* @port_fn_ipsec_packet_get: Callback used to get port function's ipsec_packet
* capability. Should be used by device drivers
* to report the current state of ipsec_packet
* capability of a function managed by the devlink
* port.
* @port_fn_ipsec_packet_set: Callback used to set port function's ipsec_packet
* capability. Should be used by device drivers to
* enable/disable ipsec_packet capability of a
* function managed by the devlink port.
* @port_fn_max_io_eqs_get: Callback used to get port function's maximum number
* of event queues. Should be used by device drivers to
* report the maximum event queues of a function
* managed by the devlink port.
* @port_fn_max_io_eqs_set: Callback used to set port function's maximum number
* of event queues. Should be used by device drivers to
* configure maximum number of event queues
* of a function managed by the devlink port.
*
* Note: Driver should return -EOPNOTSUPP if it doesn't support
* port function (@port_fn_*) handling for a particular port.
*/
struct devlink_port_ops {
int (*port_split)(struct devlink *devlink, struct devlink_port *port,
unsigned int count, struct netlink_ext_ack *extack);
int (*port_unsplit)(struct devlink *devlink, struct devlink_port *port,
struct netlink_ext_ack *extack);
int (*port_type_set)(struct devlink_port *devlink_port,
enum devlink_port_type port_type);
int (*port_del)(struct devlink *devlink, struct devlink_port *port,
struct netlink_ext_ack *extack);
int (*port_fn_hw_addr_get)(struct devlink_port *port, u8 *hw_addr,
int *hw_addr_len,
struct netlink_ext_ack *extack);
int (*port_fn_hw_addr_set)(struct devlink_port *port,
const u8 *hw_addr, int hw_addr_len,
struct netlink_ext_ack *extack);
int (*port_fn_roce_get)(struct devlink_port *devlink_port,
Annotation
- Immediate include surface: `linux/device.h`, `linux/slab.h`, `linux/gfp.h`, `linux/list.h`, `linux/netdevice.h`, `linux/spinlock.h`, `linux/workqueue.h`, `linux/refcount.h`.
- Detected declarations: `struct devlink`, `struct devlink_linecard`, `struct devlink_port_phys_attrs`, `struct devlink_port_pci_pf_attrs`, `struct devlink_port_pci_vf_attrs`, `struct devlink_port_pci_sf_attrs`, `struct devlink_port_attrs`, `struct devlink_rate`, `struct devlink_port`, `struct devlink_port_new_attrs`.
- Atlas domain: Networking Core / Sockets, Protocols, Packet Path, And Network Policy.
- Implementation status: pattern implementation candidate.
- IRQ or DMA behavior appears here, which is relevant to the selected PCIe/NVMe device path.
Implementation Notes
- This generated page is the file-by-file coverage layer; curated subsystem chapters should link here when they synthesize a multi-file control flow.
- Core OS pages should be promoted from atlas-only to deep-reviewed when they explain data structures, invariants, locking, lifecycle, and C implementation snippets.
- Driver-family pages are intentionally pattern-oriented unless they are part of the selected PCIe/NVMe representative device path.