.\" Automatically generated by Pandoc 3.1.11.1
.\"
.TH "IBV_ATTACH_MCAST" "3" "2006\-10\-31" "libibverbs" "Libibverbs Programmer\[cq]s Manual"
.SH NAME
ibv_attach_mcast, ibv_detach_mcast \- attach and detach a queue pair
(QPs) to/from a multicast group
.SH SYNOPSIS
.IP
.EX
#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);
.EE
.SH DESCRIPTION
\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
\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
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
\f[B]ibv_create_qp\f[R](3)
.SH AUTHOR
Dotan Barak \c
.MT dotanba@gmail.com
.ME \c
