_ib_alloc_device(9)
β¨ _ib_alloc_device(9) β¨
okay so bestie, this is a page from the Kernel API Manual and it's literally all about _ib_alloc_device β the lil' allocator that hands you an IB device struct. she's lowkey the main character of every low-level RDMA driver's probe path π
πΈ NAME πΈ
_ib_alloc_device β allocate an IB device struct π
π¦ SYNOPSIS π¦
struct ib_device * _ib_alloc_device (size_t size , struct net *net );
like, that's the whole vibe. one function, two args, no cap β¨
π ARGUMENTS π
sizeβ the size of the structure you want to allocate. yes ma'am, that's your number, give it what it needs π«Άnetβ the network namespace this device should live in. β οΈ and bestie, listen: that namespace must stay valid untilib_register_deviceis completed. like, do not let it get yanked out from under you mid-registration, that's giving undefined chaos π
π DESCRIPTION π
okay so here's the tea π β low-level drivers should use ib_alloc_device to allocate a struct ib_device. that's the whole assignment, fr fr.
size is the size of the structure being allocated, including any private data your low-level driver is gonna tuck inside it. so like, you're not just getting the plain struct, you're getting room for your own lil' extras too β iconic behavior honestly β¨
and then the important part: ib_dealloc_device must be used to free structures allocated with ib_alloc_device. no mixing and matching, no kfree-ing it yourself, that's not the move π keep the pairs together, they're a matched set, periodt.
π SEE ALSO π
Kernel file ./drivers/infiniband/core/device.c β plus literally the entire extended universe of friends, iykyk π§:
rdma_dev_access_netns(9)rdma_dev_has_raw_cap(9)ib_device_put(9)ib_dealloc_device(9)ib_port_immutable_read(9)ib_register_device(9)ib_unregister_device(9)ib_unregister_device_and_put(9)ib_unregister_driver(9)ib_unregister_device_queued(9)ib_register_client(9)ib_unregister_client(9)ib_get_client_nl_info(9)ib_set_client_data(9)ib_register_event_handler(9)ib_unregister_event_handler(9)ib_query_port(9)ib_device_set_netdev(9)ib_query_netdev_port(9)ib_device_get_by_netdev(9)ib_enum_roce_netdev(9)ib_enum_all_roce_netdevs(9)ib_device_enable_gid_updates(9)ib_device_disable_gid_updates(9)ib_query_pkey(9)ib_modify_device(9)ib_modify_port(9)ib_find_gid(9)ib_find_pkey(9)ib_get_net_dev_by_params(9)
anyway, that's the whole page bestie, you ate that π
β this cutie lives in ./drivers/infiniband/core, dated October 2026, filed under _ib_alloc_device(9). mwah, go allocate something slay β¨π¦π
π¦ 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