.\" Automatically generated by Pandoc 3.11 .\" .TH "SA_KEY_SET" "3" "2026\-09\-24" "libibmad" "Libibmad Programmer\(cqs Manual" .SH NAME sa_key_set, sa_key_get \- set or get the SM_Key used for SA requests .SH SYNOPSIS .IP .EX #include \f[B]\f[R] void sa_key_set(\f[B]struct\f[R] ibmad_port *srcport, uint64_t key); uint64_t sa_key_get(const \f[B]struct\f[R] ibmad_port *srcport); .EE .SH DESCRIPTION \f[B]sa_key_set()\f[R] sets the Subnet Administration (SA) SM_Key associated with \f[I]srcport\f[R]. Subsequent requests sent through \f[B]sa_rpc_call()\f[R], including the requests made by \f[B]ib_path_query_via()\f[R] and \f[B]ib_node_query_via()\f[R], encode \f[I]key\f[R] in the SM_Key field of the SA header. .PP An \f[B]ibmad_port\f[R] returned by \f[B]mad_rpc_open_port()\f[R] or \f[B]mad_rpc_open_port2()\f[R] initially has an SA SM_Key of 0. This preserves the untrusted\-request behavior used when \f[B]sa_key_set()\f[R] is not called. .PP \f[B]sa_key_get()\f[R] returns the SA SM_Key currently associated with \f[I]srcport\f[R]. .PP The SA SM_Key is separate from the SMP M_Key configured by \f[B]smp_mkey_set()\f[R]. .SH RETURN VALUE \f[B]sa_key_set()\f[R] has no return value. .PP \f[B]sa_key_get()\f[R] returns the configured SA SM_Key in host byte order. .SH AUTHORS Jonathan Süssemilch Poulain \c .MT jpoulain@coreweave.com .ME \c