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. More...


struct ib_mc_membership __attribute__

Detailed Description

Infiniband multicast groups.

Definition in file ib_mcast.h.

Function Documentation



◆ ib_mcast_join()

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 

◆ ib_mcast_leave()

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.

210  {
211  struct ib_address_vector *av = membership->av;
212  union ib_mad mad;
213  int rc;
215  /* Do nothing if we are already detached from the multicast GID */
216  if ( ! membership->attached )
217  return;
219  DBGC ( ibdev, "IBDEV %s QPN %#lx leaving " IB_GID_FMT "\n",
220  ibdev->name, qp->qpn, IB_GID_ARGS ( &av->gid ) );
222  /* Sanity check */
223  assert ( qp != NULL );
225  /* Detach from multicast GID */
226  ib_mcast_detach ( ibdev, qp, &av->gid );
227  membership->attached = 0;
229  /* Cancel multicast membership join, if applicable */
230  if ( membership->madx ) {
231  ib_destroy_madx ( ibdev, ibdev->gsi, membership->madx );
232  membership->madx = NULL;
233  }
235  /* Send a single group leave MAD */
236  ib_mcast_mad ( ibdev, av, IB_MGMT_METHOD_DELETE, 0, &mad );
237  if ( ( rc = ib_mi_send ( ibdev, ibdev->gsi, &mad, NULL ) ) != 0 ) {
238  DBGC ( ibdev, "IBDEV %s QPN %#lx could not send leave request: "
239  "%s\n", ibdev->name, qp->qpn, strerror ( rc ) );
240  }
241 }
struct ib_mad_transaction * madx
Multicast group join transaction.
Definition: ib_mcast.h:25
struct arbelprm_rc_send_wqe rc
Definition: arbel.h:14
Definition: ib_mad.h:577
char name[IBDEV_NAME_LEN]
Name of this Infiniband device.
Definition: infiniband.h:408
static void ib_mcast_mad(struct ib_device *ibdev, struct ib_address_vector *av, unsigned int method, unsigned int mask, union ib_mad *mad)
Generate multicast membership MAD.
Definition: ib_mcast.c:50
#define DBGC(...)
Definition: compiler.h:505
struct ib_address_vector * av
Address vector.
Definition: ib_mcast.h:21
struct ib_mad_interface * gsi
General services interface.
Definition: infiniband.h:459
int attached
Attached to multicast GID.
Definition: ib_mcast.h:23
assert((readw(&hdr->flags) &(GTF_reading|GTF_writing))==0)
#define IB_GID_ARGS(gid)
Infiniband Global Identifier debug message arguments.
Definition: ib_packet.h:48
char * strerror(int errno)
Retrieve string representation of error number.
Definition: strerror.c:78
void ib_mcast_detach(struct ib_device *ibdev, struct ib_queue_pair *qp, union ib_gid *gid)
Detach from multicast group.
Definition: infiniband.c:789
struct arbelprm_qp_db_record qp
Definition: arbel.h:13
union ib_gid gid
GID, if present.
Definition: infiniband.h:92
#define IB_GID_FMT
Infiniband Global Identifier debug message format.
Definition: ib_packet.h:45
A management datagram.
Definition: ib_mad.h:610
An Infiniband Address Vector.
Definition: infiniband.h:72
#define NULL
NULL pointer (VOID *)
Definition: Base.h:362
int ib_mi_send(struct ib_device *ibdev, struct ib_mad_interface *mi, union ib_mad *mad, struct ib_address_vector *av)
Transmit MAD.
Definition: ib_mi.c:187
union ib_mad mad
Definition: arbel.h:12
void ib_destroy_madx(struct ib_device *ibdev __unused, struct ib_mad_interface *mi __unused, struct ib_mad_transaction *madx)
Destroy management transaction.
Definition: ib_mi.c:327

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(), mad, ib_mc_membership::madx, ib_device::name, NULL, qp, rc, and strerror().

Referenced by eoib_leave_broadcast_group(), and ipoib_leave_broadcast_group().

Variable Documentation

◆ __attribute__