STRUCT DEVLINK_PORT_REGION_OPS(9)
β¨ struct devlink_port_region_ops β Region operations for a port β¨
okay so bestie, welcome to the Kernel API Manual π«Ά this is the page for struct devlink_port_region_ops, and it's basically the little operations handbook a devlink port hands over so the kernel knows how to name its region, take a snapshot of it, and read chunks out of it. iconic behavior, honestly π
πΈ NAME πΈ
struct devlink_port_region_ops β Region operations for a port π
π¦ SYNOPSIS π¦
struct devlink_port_region_ops {
const char *name;
void (*destructor)(const void *data);
int (*snapshot)(struct devlink_port *port, const struct devlink_port_region_ops *ops, struct netlink_ext_ack *extack, u8 **data);
int (*read)(struct devlink_port *port, const struct devlink_port_region_ops *ops, struct netlink_ext_ack *extack, u64 offset, u32 size, u8 *data);
void *priv;
};
π Members π
so like, here's the whole cast of characters, main character energy only β¨
β name
the region name, periodt. that's it, that's the vibe π―
π destructor
the callback used to free snapshot memory when deleting β it's giving cleanup crew, it's giving "you had your fun, now let it go" π§Ήβ¨ signature is void (*destructor)(const void *data).
πΈ snapshot
callback to request an immediate snapshot. on success, the data variable must be updated to point to the snapshot data π₯ no cap β if it succeeds you gotta set it. heads up though: this function will be called while the devlink instance lock is held, so don't go doing anything unhinged in there ππ
π read
callback to directly read a portion of the region. on success, the data pointer will be updated with the contents of the requested portion of the region π also, same warning as above: this function will be called while the devlink instance lock is held β locked and loaded, bestie π
π§ priv
pointer to driver private data for the region operation β your little stash of secrets, iykyk π
π SEE ALSO π
Kernel file ./include/net/devlink.h, plus the whole friend group:
struct devlink_port_pci_pf_attrs(9)struct devlink_port_pci_vf_attrs(9)struct devlink_port_pci_sf_attrs(9)struct devlink_port_attrs(9)struct devlink_linecard_ops(9)struct devlink_dpipe_field(9)struct devlink_dpipe_header(9)struct devlink_dpipe_match(9)struct devlink_dpipe_action(9)struct devlink_dpipe_value(9)struct devlink_dpipe_entry(9)struct devlink_dpipe_dump_ctx(9)struct devlink_dpipe_table(9)struct devlink_dpipe_table_ops(9)struct devlink_dpipe_headers(9)struct devlink_resource_size_params(9)struct devlink_flash_notify(9)struct devlink_param(9)struct devlink_flash_update_params(9)struct devlink_region_ops(9)struct devlink_health_reporter_ops(9)struct devlink_trap_metadata(9)struct devlink_trap_policer(9)struct devlink_trap_group(9)struct devlink_trap(9)struct devlink_port_ops(9)
lowkey a whole syllabus of devlink structs β go read them, bestie, you'll slay ππ
aaand that's the page!! π brought to you from ./include/net, dated October 2026, and yeah the header/footer both say struct devli...t_region_ops(9) because the terminal truncated it, not me π stay hydrated, take your snapshots responsibly, mwah ππ
π¦ where this page comes from
- nixpkgs unstable: linux-manual 7.3.1
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms