.\" Automatically generated by Pandoc 2.18
.\"
.\" Define V font for inline verbatim, using C font in formats
.\" that render this, and otherwise B font.
.ie "\f[CB]x\f[]"x" \{\
. ftr V B
. ftr VI BI
. ftr VB B
. ftr VBI BI
.\}
.el \{\
. ftr V CR
. ftr VI CI
. ftr VB CB
. ftr VBI CBI
.\}
.TH "IBV_ATTACH_MCAST" "3" "2006-10-31" "libibverbs" "Libibverbs Programmer\[cq]s Manual"
.hy
.SH NAME
.PP
ibv_attach_mcast, ibv_detach_mcast - attach and detach a queue pair
(QPs) to/from a multicast group
.SH SYNOPSIS
.IP
.nf
\f[C]
#include <infiniband/verbs.h>

int ibv_attach_mcast(struct ibv_qp *qp, const union ibv_gid *gid, uint16_t lid);

int ibv_detach_mcast(struct ibv_qp *qp, const union ibv_gid *gid, uint16_t lid);
\f[R]
.fi
.SH DESCRIPTION
.PP
\f[B]ibv_attach_mcast()\f[R] attaches the QP \f[I]qp\f[R] to the
multicast group having MGID \f[I]gid\f[R] and MLID \f[I]lid\f[R].
.PP
\f[B]ibv_detach_mcast()\f[R] detaches the QP \f[I]qp\f[R] to the
multicast group having MGID \f[I]gid\f[R] and MLID \f[I]lid\f[R].
.SH RETURN VALUE
.PP
\f[B]ibv_attach_mcast()\f[R] and \f[B]ibv_detach_mcast()\f[R] returns 0
on success, or the value of errno on failure (which indicates the
failure reason).
.SH NOTES
.PP
Only QPs of Transport Service Type \f[B]IBV_QPT_UD\f[R] may be attached
to multicast groups.
.PP
If a QP is attached to the same multicast group multiple times, the QP
will still receive a single copy of a multicast message.
.PP
In order to receive multicast messages, a join request for the multicast
group must be sent to the subnet administrator (SA), so that the
fabric\[cq]s multicast routing is configured to deliver messages to the
local port.
.SH SEE ALSO
.PP
\f[B]ibv_create_qp\f[R](3)
.SH AUTHOR
.PP
Dotan Barak <dotanba@gmail.com>
