srpt_lookup_port(9)
π srpt_lookup_port β the kernel API manual, but make it cute
okay so bestie, welcome to srpt_lookup_port(9) from the Kernel API Manual β¨ this one's a tiny little function and honestly it's giving "small but mighty" β so let's get into it π
πΈ NAME πΈ
srpt_lookup_port β literally just look up an RDMA port by its name πβ¨
π¦ SYNOPSIS π¦
struct port_and_port_id srpt_lookup_port (const char *name );
that's it. that's the whole signature. she's compact π
note that the name parameter is a const char *, and the whole thing hands you back a struct port_and_port_id β no cap π«Ά
π ARGUMENTS π
nameβ the ASCII port name, aka the little string you're using to find your port π keep it ASCII, bestie, that's the vibe π
π DESCRIPTION π
so here's the thing you actually need to remember, and this is the important part so pay attention π
if an RDMA port pointer comes back to you, this function increments the RDMA port reference count π₯ which means you're now holding a reference, which means you are responsible for it. the caller (that's you, bestie π
) must drop that reference count by calling srpt_port_put_ref.
β οΈ hello?? do not forget the srpt_port_put_ref!! you got a ref, you gotta put the ref back. that's the whole deal. leaking refs is not the main character energy we're going for π
π SEE ALSO π
the whole friend group π«Ά these are the siblings, cousins, and distant relatives β every single one, no skips:
- Kernel file
./drivers/infiniband/ulp/srpt/ib_srpt.cπ srpt_event_handler(9)srpt_srq_event(9)srpt_qp_event(9)srpt_set_ioc(9)srpt_get_class_port_info(9)srpt_get_iou(9)srpt_get_ioc(9)srpt_get_svc_entries(9)srpt_mgmt_method_get(9)srpt_mad_send_handler(9)srpt_mad_recv_handler(9)srpt_refresh_port(9)srpt_unregister_mad_agent(9)srpt_alloc_ioctx(9)srpt_free_ioctx(9)srpt_alloc_ioctx_ring(9)srpt_free_ioctx_ring(9)srpt_set_cmd_state(9)srpt_test_and_set_cmd_state(9)srpt_post_recv(9)srpt_zerolength_write(9)srpt_get_desc_tbl(9)srpt_init_ch_qp(9)srpt_ch_qp_rtr(9)srpt_ch_qp_rts(9)srpt_ch_qp_err(9)srpt_get_send_ioctx(9)srpt_abort_cmd(9)srpt_rdma_read_done(9)srpt_build_cmd_rsp(9)srpt_build_tskmgmt_rsp(9)srpt_handle_cmd(9)srpt_handle_tsk_mgmt(9)srpt_handle_new_iu(9)srpt_send_done(9)srpt_create_ch_ib(9)srpt_close_ch(9)srpt_cm_req_recv(9)srpt_cm_rtu_recv(9)srpt_cm_handler(9)srpt_queue_response(9)srpt_release_sport(9)srpt_add_one(9)srpt_remove_one(9)srpt_close_session(9)srpt_parse_i_port_id(9)srpt_make_tpg(9)srpt_drop_tpg(9)srpt_make_tport(9)srpt_drop_tport(9)srpt_init_module(9)
and that's the page, bestie π₯° before you go β this iconic little doc lives in ./drivers/infiniband/ulp/srpt and it's dated October 2026 ποΈβ¨ slay, go drop your ref counts, and i'll see you in the next manpage ππ¦π
π¦ 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