#include <fcntl.h> #include <infiniband/verbs.h> "struct ibv_xrc_domain *ibv_open_xrc_domain(struct ibv_context " "*context" "," " int " "fd" ", int " "oflag" ); .nl "int ibv_close_xrc_domain(struct ibv_xrc_domain " "*d" );
O_CREAT If a domain belonging to device named by context is already associated with the inode, this flag has no effect, except as noted under O_EXCL below. Otherwise, a new XRC domain is created and is associated with inode specified by fd.
O_EXCL If O_EXCL and O_CREAT are set, open will fail if a domain associated with the inode exists. The check for the existence of the domain and creation of the domain if it does not exist is atomic with respect to other processes executing open with fd naming the same inode.
If fd equals -1, no inode is is associated with the domain, and the only valid value for oflag is O_CREAT.
ibv_close_xrc_domain() closes the XRC domain d. If this is the last reference, the XRC domain will be destroyed.
ibv_close_xrc_domain() returns 0 on success, or the value of errno on failure (which indicates the failure reason).
ibv_close_xrc_domain() may fail if any QP or SRQ are still associated with the XRC domain being closed.
Dotan Barak <dotanb@mellanox.co.il>