devl_port_resource_register(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸ’… devl_port_resource_register(9) β€” the kernel API manual, bestie edition

okay so bestie, welcome to the Kernel API Manual page for devl_port_resource_register ✨ this one's short and sweet and honestly kind of iconic for how much it trusts you to read the other docs. let's get into it 🫢


🌸 NAME 🌸

devl_port_resource_register β€” devlink port resource register. that's it, that's the whole vibe. it registers a resource on a devlink port πŸ’…


✨ SYNOPSIS ✨

int devl_port_resource_register (struct devlink_port *devlink_port ,
const char *resource_name , u64 resource_size , u64 resource_id , u64
parent_resource_id , const struct devlink_resource_size_params *params
);

like, six arguments, returns an int, classic. no cap 🌈


πŸŽ€ ARGUMENTS πŸŽ€

  • devlink_port β€” the devlink port. the main character, fr fr. the port you're doing this to πŸ‘‘
  • resource_name β€” the resource's name. yep, it's the name of the resource 🏷️
  • resource_size β€” the resource's size. we love a u64 that says exactly what it is πŸ’–
  • resource_id β€” the resource's id. gotta have an id, iykyk πŸ”₯
  • parent_resource_id β€” the resource's parent id. yes it's a whole family tree situation 🌳
  • params β€” the size parameters. it's a const struct devlink_resource_size_params *, so, you know, size params 🌸

πŸ¦‹ DESCRIPTION πŸ¦‹

so here's the tea: generic resources should reuse the same names across drivers. not me stressing this enough: same names, across drivers, everywhere. consistency slays πŸ’…

the generic resources list lives right here, and bestie you should go look at it:

Documentation/networking/devlink/devlink-resource.rst

it's basically the resource name canon. go read it, it's giving required reading πŸ“šβœ¨


πŸ’€ RETURN πŸ’€

  • 0 on success πŸŽ‰
  • a negative error code otherwise 😭 (yes, negative. do not pass go, do not collect $200)

🫢 SEE ALSO 🫢

like a little friend group of functions honestly, obsessed πŸ§šπŸ’œ


and that's the whole page, bestie! this masterpiece lives in ./net/devlink, dated October 2026, and it's page devl_port_resource_register(9) of the Kernel API Manual. slay, go register some resources πŸ’…πŸŒΊβ­

πŸ“¦ where this page comes from