STRUCT DEVLINK_LINECARD_OPS(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

okay so this is the page for struct devlink_linecard_ops(9) from the Kernel API Manual, and honestly? it's giving "small but mighty" ✨ it's literally the ops table for linecard operations, and we're gonna go through it together, no cap 🫢


✨ NAME ✨

struct devlink_linecard_ops β€” Linecard operations πŸ’–

like, the whole vibe of this struct is "here's what a driver can do with a linecard slot", periodt.


🌸 SYNOPSIS 🌸

struct devlink_linecard_ops {
    int (*provision)(struct devlink_linecard *linecard, void *priv,
                     const char *type, const void *type_priv,
                     struct netlink_ext_ack *extack);
    int (*unprovision)(struct devlink_linecard *linecard, void *priv,
                       struct netlink_ext_ack *extack);
    bool (*same_provision)(struct devlink_linecard *linecard, void *priv,
                           const char *type, const void *type_priv);
    unsigned int (*types_count)(struct devlink_linecard *linecard, void *priv);
    void (*types_get)(struct devlink_linecard *linecard, void *priv,
                      unsigned int index, const char **type,
                      const void **type_priv);
};

five function pointers, all iconic, all doing their little job πŸ‘‘


πŸŽ€ Members πŸŽ€

the callbacks, one by one πŸ¦‹

  • provision β€” the callback that provisions the linecard slot with a certain type of linecard. and here's the important part, bestie: as a result of this operation, the driver is expected to eventually call one of devlink_linecard_provision_set or devlink_linecard_provision_fail β€” and "eventually" means it could even be after the function call returns πŸ‘€ so don't go assuming it's done the second you return, iykyk.
  • unprovision β€” the callback that unprovisions the linecard slot. same deal as above: as a result of this operation the driver is expected to eventually (again, could be after the function call returns) call either devlink_linecard_provision_clear or devlink_linecard_provision_fail. it's giving "I'll text you later", and the text is one of those two functions πŸ’€
  • same_provision β€” the callback that asks the driver whether the linecard is already provisioned in the same way the user is asking this linecard to be provisioned. like a vibe check on the current provisioning πŸ”₯
  • types_count β€” callback to get the number of supported types. simple, efficient, main character energy.
  • types_get β€” callback to get the next type in the list. it's a "gimme the next one" situation 🌈

πŸ’œ SEE ALSO πŸ’œ

Kernel file ./include/net/devlink.h β€” plus a whole friend group of structs, all of them (9) pages, all of them part of the devlink cinematic universe 🎬:

  • 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_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_port_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)
ngl, that's a lot of SEE ALSOs, but every single one of them is listed above, so we're not skipping a single one 🫢 read them all, bestie, they're family.

and that's the whole page!! mwah πŸ’‹

cute little sign-off before you close the tab: this gem lives in ./include/net, it's dated October 2026, and the page you just read is struct devlink_linecard_ops(9). slay, you're now officially informed πŸŒŸπŸ’…πŸŽ€

πŸ“¦ where this page comes from