devl_port_resource_register(9)
π 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 au64that 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 aconst 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 π
0on success π- a negative error code otherwise π (yes, negative. do not pass go, do not collect $200)
π«Ά SEE ALSO π«Ά
- Kernel file
./net/devlink/resource.cβstruct devlink_resource(9) devl_resource_register(9)devl_resources_unregister(9)devlink_resources_unregister(9)devl_resource_size_get(9)devl_resource_occ_get_register(9)devl_resource_occ_get_unregister(9)devl_port_resources_unregister(9)
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
- 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