ibv_import_device(3) — Linux manual page

NAME | SYNOPSIS | DESCRIPTION | RETURN VALUE | SEE ALSO | AUTHOR | COLOPHON

ibv_import_device(3)  Libibverbs Programmer’s Manual ibv_import_device(3)

NAME         top

       ibv_import_device - import a device from a given command FD

SYNOPSIS         top

              #include <infiniband/verbs.h>

              struct ibv_context *ibv_import_device(int cmd_fd);

DESCRIPTION         top

       ibv_import_device() returns an ibv_context pointer that is
       associated with the given cmd_fd.

       The cmd_fd is obtained from the ibv_context cmd_fd member, which
       must be dup’d (eg by dup(), SCM_RIGHTS, etc) before being passed
       to ibv_import_device().

       Once the ibv_context usage has been ended ibv_close_device()
       should be called.  This call may cleanup whatever is
       needed/opposite of the import including closing the command FD.

RETURN VALUE         top

       ibv_import_device() returns a pointer to the allocated RDMA
       context, or NULL if the request fails.

SEE ALSO         top

       ibv_open_device(3), ibv_close_device(3),

AUTHOR         top

       Yishai Hadas ⟨yishaih@mellanox.com⟩

COLOPHON         top

       This page is part of the rdma-core (RDMA Core Userspace Libraries
       and Daemons) project.  Information about the project can be found
       at ⟨https://github.com/linux-rdma/rdma-core⟩.  If you have a bug
       report for this manual page, send it to
       linux-rdma@vger.kernel.org.  This page was obtained from the
       project's upstream Git repository
       ⟨https://github.com/linux-rdma/rdma-core.git⟩ on 2025-08-11.  (At
       that time, the date of the most recent commit that was found in
       the repository was 2025-08-04.)  If you discover any rendering
       problems in this HTML version of the page, or you believe there is
       a better or more up-to-date source for the page, or you have
       corrections or improvements to the information in this COLOPHON
       (which is not part of the original manual page), send a mail to
       man-pages@man7.org

libibverbs                       2020-5-3            ibv_import_device(3)