ib_cm.h File Reference

Infiniband communication management. More...

#include <gpxe/infiniband.h>
#include <gpxe/retry.h>

Go to the source code of this file.

Data Structures

struct  ib_connection_operations
 Infiniband connection operations. More...
struct  ib_connection
 An Infiniband connection. More...

Functions

 FILE_LICENCE (GPL2_OR_LATER)
struct ib_connectionib_create_conn (struct ib_device *ibdev, struct ib_queue_pair *qp, struct ib_gid *dgid, struct ib_gid_half *service_id, void *req_private_data, size_t req_private_data_len, struct ib_connection_operations *op)
 Create connection to remote QP.
void ib_destroy_conn (struct ib_device *ibdev, struct ib_queue_pair *qp, struct ib_connection *conn)


Detailed Description

Infiniband communication management.

Definition in file ib_cm.h.


Function Documentation

FILE_LICENCE ( GPL2_OR_LATER   ) 

struct ib_connection* ib_create_conn ( struct ib_device ibdev,
struct ib_queue_pair qp,
struct ib_gid dgid,
struct ib_gid_half service_id,
void *  private_data,
size_t  private_data_len,
struct ib_connection_operations op 
) [read]

Create connection to remote QP.

Parameters:
ibdev Infiniband device
qp Queue pair
dgid Target GID
service_id Target service ID
private_data Connection request private data
private_data_len Length of connection request private data
op Connection operations
Return values:
conn Connection

Definition at line 349 of file ib_cm.c.

References ib_queue_pair::av, DBGC, ib_gid_half::dwords, ib_gid::dwords, free(), ib_address_vector::gid, ib_address_vector::gid_present, ib_create_path(), ib_destroy_path(), ib_path_set_ownerdata(), ib_connection::ibdev, ib_connection::list, list_add, ib_connection::local_id, memcpy, memset(), ntohl, NULL, ib_connection::op, ib_connection::path, ib_connection::private_data, ib_connection::private_data_len, ib_connection::qp, ib_queue_pair::qpn, random(), ib_connection::service_id, ib_gid_half::u, ib_gid::u, and zalloc().

Referenced by ib_cmrc_xfer_deliver_iob().

00352                                                        {
00353         struct ib_connection *conn;
00354 
00355         /* Allocate and initialise request */
00356         conn = zalloc ( sizeof ( *conn ) + private_data_len );
00357         if ( ! conn )
00358                 goto err_alloc_conn;
00359         conn->ibdev = ibdev;
00360         conn->qp = qp;
00361         memset ( &qp->av, 0, sizeof ( qp->av ) );
00362         qp->av.gid_present = 1;
00363         memcpy ( &qp->av.gid, dgid, sizeof ( qp->av.gid ) );
00364         conn->local_id = random();
00365         memcpy ( &conn->service_id, service_id, sizeof ( conn->service_id ) );
00366         conn->op = op;
00367         conn->private_data_len = private_data_len;
00368         memcpy ( &conn->private_data, private_data, private_data_len );
00369 
00370         /* Create path */
00371         conn->path = ib_create_path ( ibdev, &qp->av, &ib_cm_path_op );
00372         if ( ! conn->path )
00373                 goto err_create_path;
00374         ib_path_set_ownerdata ( conn->path, conn );
00375 
00376         /* Add to list of connections */
00377         list_add ( &conn->list, &ib_cm_conns );
00378 
00379         DBGC ( conn, "CM %p created for IBDEV %p QPN %lx\n",
00380                conn, ibdev, qp->qpn );
00381         DBGC ( conn, "CM %p connecting to %08x:%08x:%08x:%08x %08x:%08x\n",
00382                conn, ntohl ( dgid->u.dwords[0] ), ntohl ( dgid->u.dwords[1] ),
00383                ntohl ( dgid->u.dwords[2] ), ntohl ( dgid->u.dwords[3] ),
00384                ntohl ( service_id->u.dwords[0] ),
00385                ntohl ( service_id->u.dwords[1] ) );
00386 
00387         return conn;
00388 
00389         ib_destroy_path ( ibdev, conn->path );
00390  err_create_path:
00391         free ( conn );
00392  err_alloc_conn:
00393         return NULL;
00394 }

void ib_destroy_conn ( struct ib_device ibdev,
struct ib_queue_pair qp,
struct ib_connection conn 
)


Generated on Tue Apr 6 20:01:50 2010 for gPXE by  doxygen 1.5.7.1