.\" Automatically generated by Pandoc 2.0.6
.\"
.TH "IBV_ATTACH_MCAST" "3" "2006\-10\-31" "libibverbs" "Libibverbs Programmer'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[]
.fi
.SH DESCRIPTION
.PP
\f[B]ibv_attach_mcast()\f[] attaches the QP \f[I]qp\f[] to the multicast
group having MGID \f[I]gid\f[] and MLID \f[I]lid\f[].
.PP
\f[B]ibv_detach_mcast()\f[] detaches the QP \f[I]qp\f[] to the multicast
group having MGID \f[I]gid\f[] and MLID \f[I]lid\f[].
.SH RETURN VALUE
.PP
\f[B]ibv_attach_mcast()\f[] and \f[B]ibv_detach_mcast()\f[] 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[] 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's multicast routing is configured to deliver messages to the
local port.
.SH SEE ALSO
.PP
\f[B]ibv_create_qp\f[](3)
.SH AUTHOR
.PP
Dotan Barak <dotanba@gmail.com>
