Data Structures | Functions | Variables
ib_mcast.h File Reference

Infiniband multicast groups. More...

#include <ipxe/infiniband.h>

Go to the source code of this file.

Data Structures

struct  ib_mc_membership
 An Infiniband multicast group membership. More...


int ib_mcast_join (struct ib_device *ibdev, struct ib_queue_pair *qp, struct ib_mc_membership *membership, struct ib_address_vector *av, unsigned int mask, void(*joined)(struct ib_mc_membership *memb, int rc))
void ib_mcast_leave (struct ib_device *ibdev, struct ib_queue_pair *qp, struct ib_mc_membership *membership)
 Leave multicast group.


struct ib_mc_membership __attribute__

Detailed Description

Infiniband multicast groups.

Definition in file ib_mcast.h.

Function Documentation

int ib_mcast_join ( struct ib_device ibdev,
struct ib_queue_pair qp,
struct ib_mc_membership membership,
struct ib_address_vector av,
unsigned int  mask,
void(*)(struct ib_mc_membership *memb, int rc joined 
void ib_mcast_leave ( struct ib_device ibdev,
struct ib_queue_pair qp,
struct ib_mc_membership membership 

Leave multicast group.

ibdevInfiniband device
qpQueue pair
membershipMulticast group membership

Definition at line 209 of file ib_mcast.c.

References assert, ib_mc_membership::attached, ib_mc_membership::av, DBGC, ib_address_vector::gid, ib_device::gsi, ib_destroy_madx(), IB_GID_ARGS, IB_GID_FMT, ib_mcast_detach(), ib_mcast_mad(), IB_MGMT_METHOD_DELETE, ib_mi_send(), ib_mc_membership::madx, ib_device::name, NULL, ib_queue_pair::qpn, rc, and strerror().

Referenced by eoib_leave_broadcast_group(), and ipoib_leave_broadcast_group().

        struct ib_address_vector *av = membership->av;
        union ib_mad mad;
        int rc;

        /* Do nothing if we are already detached from the multicast GID */
        if ( ! membership->attached )

        DBGC ( ibdev, "IBDEV %s QPN %#lx leaving " IB_GID_FMT "\n",
               ibdev->name, qp->qpn, IB_GID_ARGS ( &av->gid ) );

        /* Sanity check */
        assert ( qp != NULL );

        /* Detach from multicast GID */
        ib_mcast_detach ( ibdev, qp, &av->gid );
        membership->attached = 0;

        /* Cancel multicast membership join, if applicable */
        if ( membership->madx ) {
                ib_destroy_madx ( ibdev, ibdev->gsi, membership->madx );
                membership->madx = NULL;

        /* Send a single group leave MAD */
        ib_mcast_mad ( ibdev, av, IB_MGMT_METHOD_DELETE, 0, &mad );
        if ( ( rc = ib_mi_send ( ibdev, ibdev->gsi, &mad, NULL ) ) != 0 ) {
                DBGC ( ibdev, "IBDEV %s QPN %#lx could not send leave request: "
                       "%s\n", ibdev->name, qp->qpn, strerror ( rc ) );

Variable Documentation