EFADV_QUERY_MR(3)

πŸ’… EFADV_QUERY_MR(3) β€” like, the EFA Direct Verbs manual, bestie πŸ¦‹

okay so this is page EFADV_QUERY_MR(3) from the EFA Direct Verbs Manual, and it's genuinely so good β€” it's all about peeking at the device-specific tea on a Memory Region. no cap, let's get into it ✨


🌸 NAME 🌸

efadv_query_mr β€” query EFA specific Memory Region attributes πŸŽ€


✨ SYNOPSIS ✨

#include <infiniband/efadv.h>

int efadv_query_mr(struct ibv_mr *ibvmr, struct efadv_mr_attr *attr, uint32_t inlen);

like, that's the whole vibe. three args, one int back. slay πŸ’…


πŸ’– DESCRIPTION πŸ’–

so efadv_query_mr() queries device-specific Memory Region attributes. it's giving "let me find out what this MR is actually doing on the hardware" πŸ”₯

compatibility is handled using the comp_mask and inlen fields β€” that's the whole mechanism, fr fr.

struct efadv_mr_attr {
    uint64_t comp_mask;
    uint16_t ic_id_validity;
    uint16_t recv_ic_id;
    uint16_t rdma_read_ic_id;
    uint16_t rdma_recv_ic_id;
};

now let's break down every field, one by one, because we do not skip ✨

  • inlen β€” In (input! you set it): the size of struct efadv_mr_attr.
  • comp_mask β€” the compatibility mask. iconic, necessary, does exactly what it says.
  • ic_id_validity β€” the validity mask for the interconnect id fields. it tells you which of the id fields below actually have valid values in them:
    • EFADV_MR_ATTR_VALIDITY_RECV_IC_ID β€” means recv_ic_id has a valid value βœ”οΈ
    • EFADV_MR_ATTR_VALIDITY_RDMA_READ_IC_ID β€” means rdma_read_ic_id has a valid value βœ”οΈ
    • EFADV_MR_ATTR_VALIDITY_RDMA_RECV_IC_ID β€” means rdma_recv_ic_id has a valid value βœ”οΈ
  • recv_ic_id β€” the physical interconnect the device uses to reach the MR for receive operation 🫢
  • rdma_read_ic_id β€” the physical interconnect the device uses to reach the MR for RDMA read operation πŸ’œ
  • rdma_recv_ic_id β€” the physical interconnect the device uses to reach the MR for RDMA write receive 🌈

three different interconnects, three different operations, all queried in one go β€” main character energy honestly πŸ‘‘


πŸŽ€ RETURN VALUE πŸŽ€

efadv_query_mr() returns 0 on success, or the value of errno on failure (which indicates the failure reason). so like, zero is the good ending, anything else means go read errno and find out what went wrong 😭


πŸ¦‹ SEE ALSO πŸ¦‹

  • efadv(7) β€” the big one, go read it next, iykyk πŸ’«

⭐ NOTES ⭐

  • compatibility mask (comp_mask) is an out field and currently has no values. so it's out-only for now and there's literally nothing in it β€” not me telling you to check it, because there's nothing to check πŸ™ˆ

🌸 AUTHORS 🌸

Michael Margolin <mrgolin@amazon.com> β€” thank you for your service, king πŸ‘‘πŸ’–


and that's the whole page bestie, you ate that 🫢 this was efa, dated 2023-11-13, and it's the EFADV_QUERY_MR(3) page β€” go forth and query those MRs, periodt πŸ’…βœ¨

πŸ“¦ where this page comes from