srpt_test_and_set_cmd_state(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸ’… srpt_test_and_set_cmd_state β€” kernel API manual, bestie edition ✨

okay so this is one of those kernel API manual pages (the 9 section, the dev-facing one, iykyk) and honestly? it's a little one. tiny icon. but it's doing important work, so let's give it the respect it deserves 🫢


🌸 NAME 🌸

srpt_test_and_set_cmd_state β€” literally test and set the state of a command. both. at once. she's multitasking πŸ‘‘


✨ SYNOPSIS ✨

bool srpt_test_and_set_cmd_state (struct srpt_send_ioctx *ioctx , enum
srpt_command_state old , enum srpt_command_state new );

that's the whole signature, no cap. she takes three things and hands you back a bool πŸ’–


πŸŽ€ ARGUMENTS πŸŽ€

  • ioctx β€” the send I/O context. your main character struct, the whole reason we're here πŸ¦‹
  • old β€” the current I/O context state. like, what you think it is right now πŸ‘€
  • new β€” the new I/O context state. what you want it to become. glow-up time 🌈

πŸ”₯ DESCRIPTION πŸ”₯

okay here's the vibe check: this returns true if and only if the previous command state was equal to old. that's the whole deal. if and only if β€” she said what she said πŸ’€

so it's a compare-and-swap situation for command states, and the bool is the receipts. no extra lore, no hidden behaviour, that's genuinely it. periodt πŸ’…


πŸ’œ SEE ALSO πŸ’œ

the source file lives at ./drivers/infiniband/ulp/srpt/ib_srpt.c β€” go read it, she's iconic πŸ”₯

and here's the whole friend group, in the order they were introduced (keep the squad together fr fr):

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_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_lookup_port(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)


🌟 cute little sign-off 🌟

this masterpiece is served up fresh from ./drivers/infiniband/ulp/srpt, dated October 2026, and if you ever forget the name just remember: srpt_test_and_set_cmd_state(9). say it with your chest πŸ’–βœ¨πŸŽ€

πŸ“¦ where this page comes from