ib_device_get_by_netdev(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

✨ ib_device_get_by_netdev(9) ✨

okay so bestie, welcome to the kernel API manual 🫢 this one's from the ib_device_get_by_netdev(9) page and it's literally all about hunting down an IB device that's linked to a netdev. lowkey important stuff, let's get into it πŸ’…


🌸 NAME 🌸

ib_device_get_by_netdev β€” find an IB device associated with a netdev πŸŽ€


✨ SYNOPSIS ✨

struct ib_device * ib_device_get_by_netdev (struct net_device *ndev ,
enum rdma_driver_id driver_id );

bestie look at that signature, it's giving "give me a device and I'll give you the goods" πŸ’–


πŸ¦‹ ARGUMENTS πŸ¦‹

  • ndev β€” the netdev you're trying to locate, like the main character you're searching for πŸ”
  • driver_id β€” the driver ID that must match. and the iconic part? RDMA_DRIVER_UNKNOWN matches all of them, no cap πŸ‘‘

πŸ’œ DESCRIPTION πŸ’œ

So here's the vibe: this function finds and holds an ib_device that's associated with a netdev via ib_device_set_netdev. like it's making the connection official 🫢

⚠️ okay but listen β€” the caller must call ib_device_put on the returned pointer. not optional, not "maybe later", fr fr. you hold it, you put it back πŸ’…

🌈 SEE ALSO 🌈

Kernel file ./drivers/infiniband/core/device.c, plus the whole squad of related friends:

rdma_dev_access_netns(9), rdma_dev_has_raw_cap(9), ib_device_put(9), _ib_alloc_device(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_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)

like literally an entire friend group, obsessed 🧚✨


and that's the page bestie! this one lives in ./drivers/infiniband/core, dated October 2026 β€” signed off with love, ib_device_get_by_netdev(9) πŸ’– see you in the next manpage, mwah! πŸŽ€πŸ’œ

πŸ“¦ where this page comes from