STRUCT DEVLINK_PORT_REGION_OPS(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

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