IBV_OPEN_XRC_DOMAIN(3)

NAME
ibv_open_xrc_domain, ibv_close_xrc_domain - open or close an eXtended Reliable Connection (XRC) domain

SYNOPSIS
#include <fcntl.h>
#include <infiniband/verbs.h>

struct ibv_xrc_domain *ibv_open_xrc_domain(struct ibv_context *context,
                                           int fd, int oflag);
int ibv_close_xrc_domain(struct ibv_xrc_domain *d);

DESCRIPTION
ibv_open_xrc_domain() open an XRC domain for the InfiniBand device context context or return a reference to an opened one. fd is the file descriptor to be associated with the XRC domain. The argument oflag describes the desired file creation attributes; it is either 0 or the bitwise OR of one or more of the following flags:

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.

RETURN VALUE
ibv_open_xrc_domain() returns a pointer to an opened XRC, or NULL if the request fails.

ibv_close_xrc_domain() returns 0 on success, or the value of errno on failure (which indicates the failure reason).

NOTES
Not all devices support XRC. To check if a device supports it, check if the IBV_DEVICE_XRC bit is set in the device capabilities flags.

ibv_close_xrc_domain() may fail if any QP or SRQ are still associated with the XRC domain being closed.

SEE ALSO
ibv_create_xrc_srq(3), ibv_create_qp(3), ibv_create_xrc_rcv_qp(3), ibv_modify_xrc_rcv_qp(3), ibv_query_xrc_rcv_qp(3), ibv_reg_xrc_rcv_qp(3)

AUTHORS

Dotan Barak <dotanb@mellanox.co.il>