iPXE
Functions | Variables
ib_cm.c File Reference

Infiniband communication management. More...

#include <stdint.h>
#include <stdlib.h>
#include <string.h>
#include <byteswap.h>
#include <errno.h>
#include <assert.h>
#include <ipxe/infiniband.h>
#include <ipxe/ib_mi.h>
#include <ipxe/ib_pathrec.h>
#include <ipxe/ib_cm.h>

Go to the source code of this file.

Functions

 FILE_LICENCE (GPL2_OR_LATER_OR_UBDL)
 
static LIST_HEAD (ib_cm_conns)
 List of connections. More...
 
static struct ib_connectionib_cm_find (uint32_t local_id)
 Find connection by local communication ID. More...
 
static int ib_cm_send_rtu (struct ib_device *ibdev, struct ib_mad_interface *mi, struct ib_mad_tid *tid, struct ib_address_vector *av, uint32_t local_id, uint32_t remote_id)
 Send "ready to use" response. More...
 
static void ib_cm_recv_rep (struct ib_device *ibdev, struct ib_mad_interface *mi, union ib_mad *mad, struct ib_address_vector *av)
 Handle duplicate connection replies. More...
 
static int ib_cm_send_drep (struct ib_device *ibdev, struct ib_mad_interface *mi, struct ib_mad_tid *tid, struct ib_address_vector *av, uint32_t local_id, uint32_t remote_id)
 Send reply to disconnection request. More...
 
static void ib_cm_recv_dreq (struct ib_device *ibdev, struct ib_mad_interface *mi, union ib_mad *mad, struct ib_address_vector *av)
 Handle disconnection requests. More...
 
static int ib_cm_rejection_reason_to_rc (uint16_t reason)
 Convert connection rejection reason to return status code. More...
 
static void ib_cm_req_complete (struct ib_device *ibdev, struct ib_mad_interface *mi, struct ib_mad_transaction *madx, int rc, union ib_mad *mad, struct ib_address_vector *av)
 Handle connection request transaction completion. More...
 
static void ib_cm_path_complete (struct ib_device *ibdev, struct ib_path *path, int rc, struct ib_address_vector *av)
 Handle connection path transaction completion. More...
 
struct ib_connectionib_create_conn (struct ib_device *ibdev, struct ib_queue_pair *qp, union ib_gid *dgid, union ib_guid *service_id, void *private_data, size_t private_data_len, struct ib_connection_operations *op)
 Create connection to remote QP. More...
 
void ib_destroy_conn (struct ib_device *ibdev, struct ib_queue_pair *qp __unused, struct ib_connection *conn)
 Destroy connection to remote QP. More...
 

Variables

struct ib_mad_agent ib_cm_agent [] __ib_mad_agent
 Communication management agents. More...
 
static struct ib_mad_transaction_operations ib_cm_req_op
 Connection request operations. More...
 
static struct ib_path_operations ib_cm_path_op
 Connection path operations. More...
 

Detailed Description

Infiniband communication management.

Definition in file ib_cm.c.

Function Documentation

◆ FILE_LICENCE()

FILE_LICENCE ( GPL2_OR_LATER_OR_UBDL  )

◆ LIST_HEAD()

static LIST_HEAD ( ib_cm_conns  )
static

List of connections.

◆ ib_cm_find()

static struct ib_connection* ib_cm_find ( uint32_t  local_id)
static

Find connection by local communication ID.

Parameters
local_idLocal communication ID
Return values
connConnection, or NULL

Definition at line 53 of file ib_cm.c.

53  {
54  struct ib_connection *conn;
55 
56  list_for_each_entry ( conn, &ib_cm_conns, list ) {
57  if ( conn->local_id == local_id )
58  return conn;
59  }
60  return NULL;
61 }
struct list_head list
List of connections.
Definition: ib_cm.h:50
uint32_t local_id
Local communication ID.
Definition: ib_cm.h:41
#define list_for_each_entry(pos, head, member)
Iterate over entries in a list.
Definition: list.h:420
An Infiniband connection.
Definition: ib_cm.h:35
uint32_t local_id
Local communication ID.
Definition: ib_mad.h:12
#define NULL
NULL pointer (VOID *)
Definition: Base.h:362

References ib_connection::list, list_for_each_entry, local_id, ib_connection::local_id, and NULL.

Referenced by ib_cm_recv_dreq(), and ib_cm_recv_rep().

◆ ib_cm_send_rtu()

static int ib_cm_send_rtu ( struct ib_device ibdev,
struct ib_mad_interface mi,
struct ib_mad_tid tid,
struct ib_address_vector av,
uint32_t  local_id,
uint32_t  remote_id 
)
static

Send "ready to use" response.

Parameters
ibdevInfiniband device
miManagement interface
tidTransaction identifier
avAddress vector
local_idLocal communication ID
remote_idRemote communication ID
Return values
rcReturn status code

Definition at line 74 of file ib_cm.c.

78  {
79  union ib_mad mad;
81  int rc;
82 
83  /* Construct "ready to use" response */
84  memset ( &mad, 0, sizeof ( mad ) );
88  memcpy ( &mad.hdr.tid, tid, sizeof ( mad.hdr.tid ) );
90  rtu->local_id = htonl ( local_id );
91  rtu->remote_id = htonl ( remote_id );
92  if ( ( rc = ib_mi_send ( ibdev, mi, &mad, av ) ) != 0 ) {
93  DBGC ( local_id, "CM %08x could not send RTU: %s\n",
94  local_id, strerror ( rc ) );
95  return rc;
96  }
97 
98  return 0;
99 }
#define IB_CM_CLASS_VERSION
Communication management class version.
Definition: ib_mad.h:311
uint8_t method
Definition: ib_mad.h:542
struct arbelprm_rc_send_wqe rc
Definition: arbel.h:14
uint32_t local_id
Local communication ID.
Definition: ib_mad.h:468
#define DBGC(...)
Definition: compiler.h:505
#define IB_MGMT_CLASS_CM
Definition: ib_mad.h:561
uint8_t mgmt_class
Definition: ib_mad.h:540
struct ib_mad_tid tid
Definition: ib_mad.h:17
#define htonl(value)
Definition: byteswap.h:133
#define IB_CM_ATTR_READY_TO_USE
Definition: ib_mad.h:319
void * memcpy(void *dest, const void *src, size_t len) __nonnull
uint8_t class_version
Definition: ib_mad.h:541
A communication management ready to use reply.
Definition: ib_mad.h:466
uint32_t remote_id
Remote communication ID.
Definition: ib_mad.h:470
#define IB_MGMT_METHOD_SEND
Definition: ib_mad.h:572
struct ib_mad_cm cm
Definition: ib_mad.h:614
char * strerror(int errno)
Retrieve string representation of error number.
Definition: strerror.c:78
struct ib_cm_ready_to_use ready_to_use
Definition: ib_mad.h:509
union ib_cm_data cm_data
Definition: ib_mad.h:606
uint32_t remote_id
Remote communication ID.
Definition: ib_mad.h:14
struct ib_mad_tid tid
Definition: ib_mad.h:545
struct ib_mad_hdr hdr
Definition: ib_mad.h:611
uint16_t attr_id
Definition: ib_mad.h:546
A management datagram.
Definition: ib_mad.h:610
uint32_t local_id
Local communication ID.
Definition: ib_mad.h:12
#define htons(value)
Definition: byteswap.h:135
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 * memset(void *dest, int character, size_t len) __nonnull

References ib_mad_hdr::attr_id, ib_mad_hdr::class_version, ib_mad::cm, ib_mad_cm::cm_data, DBGC, ib_mad::hdr, htonl, htons, IB_CM_ATTR_READY_TO_USE, IB_CM_CLASS_VERSION, IB_MGMT_CLASS_CM, IB_MGMT_METHOD_SEND, ib_mi_send(), local_id, ib_cm_ready_to_use::local_id, mad, memcpy(), memset(), ib_mad_hdr::method, ib_mad_hdr::mgmt_class, rc, ib_cm_data::ready_to_use, remote_id, ib_cm_ready_to_use::remote_id, strerror(), tid, and ib_mad_hdr::tid.

Referenced by ib_cm_recv_rep(), and ib_cm_req_complete().

◆ ib_cm_recv_rep()

static void ib_cm_recv_rep ( struct ib_device ibdev,
struct ib_mad_interface mi,
union ib_mad mad,
struct ib_address_vector av 
)
static

Handle duplicate connection replies.

Parameters
ibdevInfiniband device
miManagement interface
madReceived MAD
avSource address vector
Return values
rcReturn status code

If a "ready to use" MAD is lost, the peer may resend the connection reply. We have to respond to these with duplicate "ready to use" MADs, otherwise the peer may time out and drop the connection.

Definition at line 114 of file ib_cm.c.

117  {
119  struct ib_connection *conn;
120  uint32_t local_id = ntohl ( rep->remote_id );
121  int rc;
122 
123  /* Identify connection */
124  conn = ib_cm_find ( local_id );
125  if ( conn ) {
126  /* Try to send "ready to use" reply */
127  if ( ( rc = ib_cm_send_rtu ( ibdev, mi, &mad->hdr.tid, av,
128  conn->local_id,
129  conn->remote_id ) ) != 0 ) {
130  /* Ignore errors; the remote end will retry */
131  }
132  } else {
133  DBGC ( local_id, "CM %08x unexpected REP\n", local_id );
134  }
135 }
A communication management connection reply.
Definition: ib_mad.h:435
struct arbelprm_rc_send_wqe rc
Definition: arbel.h:14
#define DBGC(...)
Definition: compiler.h:505
#define ntohl(value)
Definition: byteswap.h:134
static int ib_cm_send_rtu(struct ib_device *ibdev, struct ib_mad_interface *mi, struct ib_mad_tid *tid, struct ib_address_vector *av, uint32_t local_id, uint32_t remote_id)
Send "ready to use" response.
Definition: ib_cm.c:74
uint32_t remote_id
Remote communication ID.
Definition: ib_cm.h:43
uint32_t local_id
Local communication ID.
Definition: ib_cm.h:41
struct ib_cm_connect_reply connect_reply
Definition: ib_mad.h:508
struct ib_mad_cm cm
Definition: ib_mad.h:614
union ib_cm_data cm_data
Definition: ib_mad.h:606
unsigned int uint32_t
Definition: stdint.h:12
An Infiniband connection.
Definition: ib_cm.h:35
struct ib_mad_tid tid
Definition: ib_mad.h:545
struct ib_mad_hdr hdr
Definition: ib_mad.h:611
struct ib_device * ibdev
Infiniband device.
Definition: ib_cm.h:37
uint32_t local_id
Local communication ID.
Definition: ib_mad.h:12
uint32_t remote_id
Remote communication ID.
Definition: ib_mad.h:439
static struct ib_connection * ib_cm_find(uint32_t local_id)
Find connection by local communication ID.
Definition: ib_cm.c:53
union ib_mad mad
Definition: arbel.h:12

References ib_mad::cm, ib_mad_cm::cm_data, ib_cm_data::connect_reply, DBGC, ib_mad::hdr, ib_cm_find(), ib_cm_send_rtu(), ib_connection::ibdev, local_id, ib_connection::local_id, mad, ntohl, rc, ib_connection::remote_id, ib_cm_connect_reply::remote_id, and ib_mad_hdr::tid.

◆ ib_cm_send_drep()

static int ib_cm_send_drep ( struct ib_device ibdev,
struct ib_mad_interface mi,
struct ib_mad_tid tid,
struct ib_address_vector av,
uint32_t  local_id,
uint32_t  remote_id 
)
static

Send reply to disconnection request.

Parameters
ibdevInfiniband device
miManagement interface
tidTransaction identifier
avAddress vector
local_idLocal communication ID
remote_idRemote communication ID
Return values
rcReturn status code

Definition at line 148 of file ib_cm.c.

152  {
153  union ib_mad mad;
155  int rc;
156 
157  /* Construct reply to disconnection request */
158  memset ( &mad, 0, sizeof ( mad ) );
162  memcpy ( &mad.hdr.tid, tid, sizeof ( mad.hdr.tid ) );
164  drep->local_id = htonl ( local_id );
165  drep->remote_id = htonl ( remote_id );
166  if ( ( rc = ib_mi_send ( ibdev, mi, &mad, av ) ) != 0 ) {
167  DBGC ( local_id, "CM %08x could not send DREP: %s\n",
168  local_id, strerror ( rc ) );
169  return rc;
170  }
171 
172  return 0;
173 }
#define IB_CM_CLASS_VERSION
Communication management class version.
Definition: ib_mad.h:311
uint8_t method
Definition: ib_mad.h:542
struct arbelprm_rc_send_wqe rc
Definition: arbel.h:14
#define DBGC(...)
Definition: compiler.h:505
#define IB_MGMT_CLASS_CM
Definition: ib_mad.h:561
uint32_t remote_id
Remote communication ID.
Definition: ib_mad.h:498
A communication management disconnection reply.
Definition: ib_mad.h:494
uint8_t mgmt_class
Definition: ib_mad.h:540
struct ib_mad_tid tid
Definition: ib_mad.h:17
#define htonl(value)
Definition: byteswap.h:133
void * memcpy(void *dest, const void *src, size_t len) __nonnull
uint8_t class_version
Definition: ib_mad.h:541
#define IB_MGMT_METHOD_SEND
Definition: ib_mad.h:572
struct ib_mad_cm cm
Definition: ib_mad.h:614
#define IB_CM_ATTR_DISCONNECT_REPLY
Definition: ib_mad.h:321
char * strerror(int errno)
Retrieve string representation of error number.
Definition: strerror.c:78
struct ib_cm_disconnect_reply disconnect_reply
Definition: ib_mad.h:511
union ib_cm_data cm_data
Definition: ib_mad.h:606
uint32_t remote_id
Remote communication ID.
Definition: ib_mad.h:14
struct ib_mad_tid tid
Definition: ib_mad.h:545
struct ib_mad_hdr hdr
Definition: ib_mad.h:611
uint16_t attr_id
Definition: ib_mad.h:546
A management datagram.
Definition: ib_mad.h:610
uint32_t local_id
Local communication ID.
Definition: ib_mad.h:12
#define htons(value)
Definition: byteswap.h:135
uint32_t local_id
Local communication ID.
Definition: ib_mad.h:496
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 * memset(void *dest, int character, size_t len) __nonnull

References ib_mad_hdr::attr_id, ib_mad_hdr::class_version, ib_mad::cm, ib_mad_cm::cm_data, DBGC, ib_cm_data::disconnect_reply, ib_mad::hdr, htonl, htons, IB_CM_ATTR_DISCONNECT_REPLY, IB_CM_CLASS_VERSION, IB_MGMT_CLASS_CM, IB_MGMT_METHOD_SEND, ib_mi_send(), local_id, ib_cm_disconnect_reply::local_id, mad, memcpy(), memset(), ib_mad_hdr::method, ib_mad_hdr::mgmt_class, rc, remote_id, ib_cm_disconnect_reply::remote_id, strerror(), tid, and ib_mad_hdr::tid.

Referenced by ib_cm_recv_dreq().

◆ ib_cm_recv_dreq()

static void ib_cm_recv_dreq ( struct ib_device ibdev,
struct ib_mad_interface mi,
union ib_mad mad,
struct ib_address_vector av 
)
static

Handle disconnection requests.

Parameters
ibdevInfiniband device
miManagement interface
madReceived MAD
avSource address vector
Return values
rcReturn status code

Definition at line 184 of file ib_cm.c.

187  {
188  struct ib_cm_disconnect_request *dreq =
190  struct ib_connection *conn;
191  uint32_t local_id = ntohl ( dreq->remote_id );
192  uint32_t remote_id = ntohl ( dreq->local_id );
193  int rc;
194 
195  /* Identify connection */
196  conn = ib_cm_find ( local_id );
197  if ( conn ) {
198  /* Notify upper layer */
199  conn->op->changed ( ibdev, conn->qp, conn, -ENOTCONN,
200  &dreq->private_data,
201  sizeof ( dreq->private_data ) );
202  } else {
203  DBGC ( local_id, "CM %08x unexpected DREQ\n", local_id );
204  }
205 
206  /* Send reply */
207  if ( ( rc = ib_cm_send_drep ( ibdev, mi, &mad->hdr.tid, av, local_id,
208  remote_id ) ) != 0 ) {
209  /* Ignore errors; the remote end will retry */
210  }
211 };
struct arbelprm_rc_send_wqe rc
Definition: arbel.h:14
uint32_t remote_id
Remote communication ID.
Definition: ib_mad.h:483
#define DBGC(...)
Definition: compiler.h:505
#define ntohl(value)
Definition: byteswap.h:134
void(* changed)(struct ib_device *ibdev, struct ib_queue_pair *qp, struct ib_connection *conn, int rc, void *private_data, size_t private_data_len)
Handle change of connection status.
Definition: ib_cm.h:29
static int ib_cm_send_drep(struct ib_device *ibdev, struct ib_mad_interface *mi, struct ib_mad_tid *tid, struct ib_address_vector *av, uint32_t local_id, uint32_t remote_id)
Send reply to disconnection request.
Definition: ib_cm.c:148
A communication management disconnection request.
Definition: ib_mad.h:479
#define ENOTCONN
The socket is not connected.
Definition: errno.h:569
struct ib_mad_cm cm
Definition: ib_mad.h:614
struct ib_connection_operations * op
Connection operations.
Definition: ib_cm.h:47
uint8_t private_data[220]
Private data.
Definition: ib_mad.h:487
union ib_cm_data cm_data
Definition: ib_mad.h:606
uint32_t remote_id
Remote communication ID.
Definition: ib_mad.h:14
unsigned int uint32_t
Definition: stdint.h:12
An Infiniband connection.
Definition: ib_cm.h:35
struct ib_mad_tid tid
Definition: ib_mad.h:545
uint32_t local_id
Local communication ID.
Definition: ib_mad.h:481
struct ib_mad_hdr hdr
Definition: ib_mad.h:611
struct ib_queue_pair * qp
Queue pair.
Definition: ib_cm.h:39
struct ib_cm_disconnect_request disconnect_request
Definition: ib_mad.h:510
struct ib_device * ibdev
Infiniband device.
Definition: ib_cm.h:37
uint32_t local_id
Local communication ID.
Definition: ib_mad.h:12
static struct ib_connection * ib_cm_find(uint32_t local_id)
Find connection by local communication ID.
Definition: ib_cm.c:53
union ib_mad mad
Definition: arbel.h:12

References ib_connection_operations::changed, ib_mad::cm, ib_mad_cm::cm_data, DBGC, ib_cm_data::disconnect_request, ENOTCONN, ib_mad::hdr, ib_cm_find(), ib_cm_send_drep(), ib_connection::ibdev, local_id, ib_cm_disconnect_request::local_id, mad, ntohl, ib_connection::op, ib_cm_disconnect_request::private_data, ib_connection::qp, rc, remote_id, ib_cm_disconnect_request::remote_id, and ib_mad_hdr::tid.

◆ ib_cm_rejection_reason_to_rc()

static int ib_cm_rejection_reason_to_rc ( uint16_t  reason)
static

Convert connection rejection reason to return status code.

Parameters
reasonRejection reason (in network byte order)
Return values
rcReturn status code

Definition at line 235 of file ib_cm.c.

235  {
236  switch ( reason ) {
238  return -ENODEV;
239  case htons ( IB_CM_REJECT_STALE_CONN ) :
240  return -EALREADY;
241  case htons ( IB_CM_REJECT_CONSUMER ) :
242  return -ENOTTY;
243  default:
244  return -EPERM;
245  }
246 }
#define IB_CM_REJECT_CONSUMER
Definition: ib_mad.h:429
#define IB_CM_REJECT_STALE_CONN
Definition: ib_mad.h:428
#define ENODEV
No such device.
Definition: errno.h:509
#define EALREADY
Connection already in progress.
Definition: errno.h:323
#define EPERM
Operation not permitted.
Definition: errno.h:614
#define ENOTTY
Inappropriate I/O control operation.
Definition: errno.h:594
uint16_t reason
Rejection reason.
Definition: ib_mad.h:20
return
Definition: natsemi.h:326
#define htons(value)
Definition: byteswap.h:135
#define IB_CM_REJECT_BAD_SERVICE_ID
CM rejection reasons.
Definition: ib_mad.h:427

References EALREADY, ENODEV, ENOTTY, EPERM, htons, IB_CM_REJECT_BAD_SERVICE_ID, IB_CM_REJECT_CONSUMER, IB_CM_REJECT_STALE_CONN, and reason.

Referenced by ib_cm_req_complete().

◆ ib_cm_req_complete()

static void ib_cm_req_complete ( struct ib_device ibdev,
struct ib_mad_interface mi,
struct ib_mad_transaction madx,
int  rc,
union ib_mad mad,
struct ib_address_vector av 
)
static

Handle connection request transaction completion.

Parameters
ibdevInfiniband device
miManagement interface
madxManagement transaction
rcStatus code
madReceived MAD (or NULL on error)
avSource address vector (or NULL on error)

Definition at line 258 of file ib_cm.c.

262  {
263  struct ib_connection *conn = ib_madx_get_ownerdata ( madx );
264  struct ib_queue_pair *qp = conn->qp;
265  struct ib_cm_common *common = &mad->cm.cm_data.common;
268  uint32_t local_id = conn->local_id;
269  void *private_data = NULL;
270  size_t private_data_len = 0;
271 
272  /* Report failures */
273  if ( ( rc == 0 ) && ( mad->hdr.status != htons ( IB_MGMT_STATUS_OK ) ))
274  rc = -EIO;
275  if ( rc != 0 ) {
276  DBGC ( local_id, "CM %08x connection request failed: %s\n",
277  local_id, strerror ( rc ) );
278  goto out;
279  }
280 
281  /* Record remote communication ID */
282  conn->remote_id = ntohl ( common->local_id );
283 
284  /* Handle response */
285  switch ( mad->hdr.attr_id ) {
286 
288  /* Extract fields */
289  qp->av.qpn = ( ntohl ( rep->local_qpn ) >> 8 );
290  qp->send.psn = ( ntohl ( rep->starting_psn ) >> 8 );
291  private_data = &rep->private_data;
292  private_data_len = sizeof ( rep->private_data );
293  DBGC ( local_id, "CM %08x connected to QPN %#lx PSN %#x\n",
294  local_id, qp->av.qpn, qp->send.psn );
295 
296  /* Modify queue pair */
297  if ( ( rc = ib_modify_qp ( ibdev, qp ) ) != 0 ) {
298  DBGC ( local_id, "CM %08x could not modify queue "
299  "pair: %s\n", local_id, strerror ( rc ) );
300  goto out;
301  }
302 
303  /* Send "ready to use" reply */
304  if ( ( rc = ib_cm_send_rtu ( ibdev, mi, &mad->hdr.tid, av,
305  conn->local_id,
306  conn->remote_id ) ) != 0 ) {
307  /* Treat as non-fatal */
308  rc = 0;
309  }
310  break;
311 
313  /* Extract fields */
314  DBGC ( local_id, "CM %08x connection rejected (reason %d)\n",
315  local_id, ntohs ( rej->reason ) );
316  /* Private data is valid only for a Consumer Reject */
317  if ( rej->reason == htons ( IB_CM_REJECT_CONSUMER ) ) {
318  private_data = &rej->private_data;
319  private_data_len = sizeof ( rej->private_data );
320  }
322  break;
323 
324  default:
325  DBGC ( local_id, "CM %08x unexpected response (attribute "
326  "%04x)\n", local_id, ntohs ( mad->hdr.attr_id ) );
327  rc = -ENOTSUP;
328  break;
329  }
330 
331  out:
332  /* Destroy the completed transaction */
333  ib_destroy_madx ( ibdev, ibdev->gsi, madx );
334  conn->madx = NULL;
335 
336  /* Hand off to the upper completion handler */
337  conn->op->changed ( ibdev, qp, conn, rc, private_data,
338  private_data_len );
339 }
A communication management connection reply.
Definition: ib_mad.h:435
#define IB_CM_ATTR_CONNECT_REJECT
Definition: ib_mad.h:317
struct arbelprm_rc_send_wqe rc
Definition: arbel.h:14
uint16_t reason
Rejection reason.
Definition: ib_mad.h:419
int ib_modify_qp(struct ib_device *ibdev, struct ib_queue_pair *qp)
Modify queue pair.
Definition: infiniband.c:294
#define DBGC(...)
Definition: compiler.h:505
#define IB_CM_REJECT_CONSUMER
Definition: ib_mad.h:429
uint8_t private_data[196]
Private data.
Definition: ib_mad.h:459
#define ntohl(value)
Definition: byteswap.h:134
struct ib_mad_interface * gsi
General services interface.
Definition: infiniband.h:459
static int ib_cm_send_rtu(struct ib_device *ibdev, struct ib_mad_interface *mi, struct ib_mad_tid *tid, struct ib_address_vector *av, uint32_t local_id, uint32_t remote_id)
Send "ready to use" response.
Definition: ib_cm.c:74
uint32_t remote_id
Remote communication ID.
Definition: ib_cm.h:43
#define ntohs(value)
Definition: byteswap.h:136
__be32 qpn
Definition: CIB_PRM.h:29
uint32_t starting_psn
Starting PSN.
Definition: ib_mad.h:447
#define ENOTSUP
Operation not supported.
Definition: errno.h:589
uint32_t local_id
Local communication ID.
Definition: ib_cm.h:41
void(* changed)(struct ib_device *ibdev, struct ib_queue_pair *qp, struct ib_connection *conn, int rc, void *private_data, size_t private_data_len)
Handle change of connection status.
Definition: ib_cm.h:29
static int ib_cm_rejection_reason_to_rc(uint16_t reason)
Convert connection rejection reason to return status code.
Definition: ib_cm.c:235
__be32 out[4]
Definition: CIB_PRM.h:36
struct ib_cm_common common
Definition: ib_mad.h:505
struct ib_cm_connect_reply connect_reply
Definition: ib_mad.h:508
struct ib_mad_cm cm
Definition: ib_mad.h:614
Communication management common fields.
Definition: ib_mad.h:328
char * strerror(int errno)
Retrieve string representation of error number.
Definition: strerror.c:78
#define IB_CM_ATTR_CONNECT_REPLY
Definition: ib_mad.h:318
struct ib_connection_operations * op
Connection operations.
Definition: ib_cm.h:47
uint8_t private_data[148]
Private data.
Definition: ib_mad.h:423
uint32_t local_qpn
Local QPN.
Definition: ib_mad.h:18
struct ib_cm_connect_reject connect_reject
Definition: ib_mad.h:507
union ib_cm_data cm_data
Definition: ib_mad.h:606
uint32_t local_id
Local communication ID.
Definition: ib_mad.h:330
unsigned int uint32_t
Definition: stdint.h:12
struct ib_cm_common common
Definition: ib_mad.h:11
An Infiniband connection.
Definition: ib_cm.h:35
struct ib_mad_tid tid
Definition: ib_mad.h:545
static __always_inline void * ib_madx_get_ownerdata(struct ib_mad_transaction *madx)
Get Infiniband management transaction owner-private data.
Definition: ib_mi.h:117
An Infiniband Queue Pair.
Definition: infiniband.h:157
struct arbelprm_qp_db_record qp
Definition: arbel.h:13
A communication management connection rejection.
Definition: ib_mad.h:409
struct ib_mad_hdr hdr
Definition: ib_mad.h:611
struct ib_queue_pair * qp
Queue pair.
Definition: ib_cm.h:39
#define IB_MGMT_STATUS_OK
Definition: ib_mad.h:580
#define EIO
Input/output error.
Definition: errno.h:433
uint8_t private_data[92]
Private data.
Definition: ib_mad.h:44
uint16_t reason
Rejection reason.
Definition: ib_mad.h:20
uint16_t attr_id
Definition: ib_mad.h:546
uint32_t local_id
Local communication ID.
Definition: ib_mad.h:12
struct ib_mad_transaction * madx
Connection request management transaction.
Definition: ib_cm.h:55
#define NULL
NULL pointer (VOID *)
Definition: Base.h:362
#define htons(value)
Definition: byteswap.h:135
union ib_mad mad
Definition: arbel.h:12
uint16_t status
Definition: ib_mad.h:543
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 ib_mad_hdr::attr_id, ib_connection_operations::changed, ib_mad::cm, ib_mad_cm::cm_data, ib_cm_data::common, common, ib_cm_data::connect_reject, ib_cm_data::connect_reply, DBGC, EIO, ENOTSUP, ib_device::gsi, ib_mad::hdr, htons, IB_CM_ATTR_CONNECT_REJECT, IB_CM_ATTR_CONNECT_REPLY, IB_CM_REJECT_CONSUMER, ib_cm_rejection_reason_to_rc(), ib_cm_send_rtu(), ib_destroy_madx(), ib_madx_get_ownerdata(), IB_MGMT_STATUS_OK, ib_modify_qp(), local_id, ib_connection::local_id, ib_cm_common::local_id, ib_cm_connect_reply::local_qpn, mad, ib_connection::madx, ntohl, ntohs, NULL, ib_connection::op, out, private_data, ib_cm_connect_reject::private_data, ib_cm_connect_reply::private_data, qp, ib_connection::qp, rc, ib_cm_connect_reject::reason, ib_connection::remote_id, ib_cm_connect_reply::starting_psn, ib_mad_hdr::status, strerror(), and ib_mad_hdr::tid.

◆ ib_cm_path_complete()

static void ib_cm_path_complete ( struct ib_device ibdev,
struct ib_path path,
int  rc,
struct ib_address_vector av 
)
static

Handle connection path transaction completion.

Parameters
ibdevInfiniband device
pathPath
rcStatus code
avAddress vector, or NULL on error

Definition at line 354 of file ib_cm.c.

356  {
357  struct ib_connection *conn = ib_path_get_ownerdata ( path );
358  struct ib_queue_pair *qp = conn->qp;
359  union ib_mad mad;
361  uint32_t local_id = conn->local_id;
362  size_t private_data_len;
363 
364  /* Report failures */
365  if ( rc != 0 ) {
366  DBGC ( local_id, "CM %08x path lookup failed: %s\n",
367  local_id, strerror ( rc ) );
368  conn->op->changed ( ibdev, qp, conn, rc, NULL, 0 );
369  goto out;
370  }
371 
372  /* Update queue pair peer path */
373  memcpy ( &qp->av, av, sizeof ( qp->av ) );
374 
375  /* Construct connection request */
376  memset ( &mad, 0, sizeof ( mad ) );
381  req->local_id = htonl ( conn->local_id );
382  memcpy ( &req->service_id, &conn->service_id,
383  sizeof ( req->service_id ) );
384  memcpy ( &req->local_ca, &ibdev->node_guid, sizeof ( req->local_ca ) );
385  req->local_qpn__responder_resources = htonl ( ( qp->qpn << 8 ) | 1 );
386  req->local_eecn__initiator_depth = htonl ( ( 0 << 8 ) | 1 );
388  htonl ( ( 0x14 << 3 ) | ( IB_CM_TRANSPORT_RC << 1 ) |
389  ( 0 << 0 ) );
391  htonl ( ( qp->recv.psn << 8 ) | ( 0x14 << 3 ) |
392  ( 0x07 << 0 ) );
393  req->pkey = htons ( ibdev->pkey );
395  ( ( IB_MTU_2048 << 4 ) | ( 1 << 3 ) | ( 0x07 << 0 ) );
396  req->max_cm_retries__srq = ( ( 0x0f << 4 ) | ( 0 << 3 ) );
397  req->primary.local_lid = htons ( ibdev->lid );
398  req->primary.remote_lid = htons ( conn->qp->av.lid );
399  memcpy ( &req->primary.local_gid, &ibdev->gid,
400  sizeof ( req->primary.local_gid ) );
401  memcpy ( &req->primary.remote_gid, &conn->qp->av.gid,
402  sizeof ( req->primary.remote_gid ) );
404  htonl ( ( 0 << 12 ) | ( conn->qp->av.rate << 0 ) );
405  req->primary.hop_limit = 0;
407  ( ( conn->qp->av.sl << 4 ) | ( 1 << 3 ) );
408  req->primary.local_ack_timeout = ( 0x13 << 3 );
409  private_data_len = conn->private_data_len;
410  if ( private_data_len > sizeof ( req->private_data ) )
411  private_data_len = sizeof ( req->private_data );
412  memcpy ( &req->private_data, &conn->private_data, private_data_len );
413 
414  /* Create connection request */
415  av->qpn = IB_QPN_GSI;
416  av->qkey = IB_QKEY_GSI;
417  conn->madx = ib_create_madx ( ibdev, ibdev->gsi, &mad, av,
418  &ib_cm_req_op );
419  if ( ! conn->madx ) {
420  DBGC ( local_id, "CM %08x could not create connection "
421  "request\n", local_id );
422  conn->op->changed ( ibdev, qp, conn, rc, NULL, 0 );
423  goto out;
424  }
425  ib_madx_set_ownerdata ( conn->madx, conn );
426 
427  out:
428  /* Destroy the completed transaction */
429  ib_destroy_path ( ibdev, path );
430  conn->path = NULL;
431 }
#define IB_CM_CLASS_VERSION
Communication management class version.
Definition: ib_mad.h:311
uint16_t pkey
Partition key.
Definition: ib_mad.h:387
uint32_t starting_psn__local_timeout__retry_count
Starting PSN, local CM response timeout and retry count.
Definition: ib_mad.h:385
uint16_t remote_lid
Remote port LID.
Definition: ib_mad.h:342
uint8_t method
Definition: ib_mad.h:542
uint32_t flow_label__rate
Flow label and rate.
Definition: ib_mad.h:348
static struct ib_mad_transaction_operations ib_cm_req_op
Connection request operations.
Definition: ib_cm.c:342
struct arbelprm_rc_send_wqe rc
Definition: arbel.h:14
#define IB_MTU_2048
Definition: ib_mad.h:162
union ib_gid gid
Port GID (comprising GID prefix and port GUID)
Definition: infiniband.h:439
uint16_t lid
Port LID.
Definition: infiniband.h:441
uint8_t private_data[0]
Connection request private data.
Definition: ib_cm.h:60
#define DBGC(...)
Definition: compiler.h:505
size_t private_data_len
Length of connection request private data.
Definition: ib_cm.h:58
#define IB_CM_TRANSPORT_RC
CM transport types.
Definition: ib_mad.h:401
struct ib_cm_path primary
Primary path.
Definition: ib_mad.h:393
#define IB_MGMT_CLASS_CM
Definition: ib_mad.h:561
struct ib_mad_interface * gsi
General services interface.
Definition: infiniband.h:459
uint8_t hop_limit
Hop limit.
Definition: ib_mad.h:352
union ib_guid service_id
Service ID.
Definition: ib_mad.h:369
uint8_t mgmt_class
Definition: ib_mad.h:540
union ib_guid service_id
Target service ID.
Definition: ib_cm.h:45
#define htonl(value)
Definition: byteswap.h:133
uint8_t private_data[92]
Private data.
Definition: ib_mad.h:397
#define IB_QKEY_GSI
General service interface queue key.
Definition: infiniband.h:30
enum ib_rate rate
Rate.
Definition: infiniband.h:86
uint32_t local_id
Local communication ID.
Definition: ib_cm.h:41
void(* changed)(struct ib_device *ibdev, struct ib_queue_pair *qp, struct ib_connection *conn, int rc, void *private_data, size_t private_data_len)
Handle change of connection status.
Definition: ib_cm.h:29
void * memcpy(void *dest, const void *src, size_t len) __nonnull
uint32_t local_qpn__responder_resources
Local QPN and responder resources.
Definition: ib_mad.h:377
uint8_t class_version
Definition: ib_mad.h:541
unsigned long qkey
Queue key.
Definition: infiniband.h:79
uint32_t local_eecn__initiator_depth
Local EECN and initiator depth.
Definition: ib_mad.h:379
static __always_inline void * ib_path_get_ownerdata(struct ib_path *path)
Get Infiniband path owner-private data.
Definition: ib_pathrec.h:63
#define IB_CM_ATTR_CONNECT_REQUEST
Definition: ib_mad.h:315
struct ib_mad_transaction * ib_create_madx(struct ib_device *ibdev, struct ib_mad_interface *mi, union ib_mad *mad, struct ib_address_vector *av, struct ib_mad_transaction_operations *op)
Create management transaction.
Definition: ib_mi.c:287
uint32_t remote_eecn__remote_timeout__service_type__ee_flow_ctrl
Remote EECN, remote CM response timeout, transport service type, EE flow control.
Definition: ib_mad.h:383
__be32 out[4]
Definition: CIB_PRM.h:36
static __always_inline void ib_madx_set_ownerdata(struct ib_mad_transaction *madx, void *priv)
Set Infiniband management transaction owner-private data.
Definition: ib_mi.h:106
uint8_t local_ack_timeout
Local ACK timeout.
Definition: ib_mad.h:356
uint16_t local_lid
Local port LID.
Definition: ib_mad.h:340
#define IB_MGMT_METHOD_SEND
Definition: ib_mad.h:572
struct ib_mad_cm cm
Definition: ib_mad.h:614
#define IB_QPN_GSI
General service interface QPN.
Definition: infiniband.h:27
char * strerror(int errno)
Retrieve string representation of error number.
Definition: strerror.c:78
union ib_gid remote_gid
Remote port GID.
Definition: ib_mad.h:346
A communication management connection request.
Definition: ib_mad.h:363
struct ib_connection_operations * op
Connection operations.
Definition: ib_cm.h:47
union ib_guid node_guid
Node GUID.
Definition: infiniband.h:437
union ib_cm_data cm_data
Definition: ib_mad.h:606
unsigned long qpn
Queue Pair Number.
Definition: infiniband.h:74
struct ib_address_vector av
Address vector.
Definition: infiniband.h:184
unsigned int uint32_t
Definition: stdint.h:12
An Infiniband connection.
Definition: ib_cm.h:35
struct ib_path * path
Path to target.
Definition: ib_cm.h:53
union ib_gid local_gid
Local port GID.
Definition: ib_mad.h:344
An Infiniband Queue Pair.
Definition: infiniband.h:157
struct ib_cm_connect_request connect_request
Definition: ib_mad.h:506
unsigned int sl
Service level.
Definition: infiniband.h:88
struct arbelprm_qp_db_record qp
Definition: arbel.h:13
struct ib_mad_hdr hdr
Definition: ib_mad.h:611
uint8_t max_cm_retries__srq
Max CM retries and SRQ.
Definition: ib_mad.h:391
union ib_guid local_ca
Local CA GUID.
Definition: ib_mad.h:371
struct ib_queue_pair * qp
Queue pair.
Definition: ib_cm.h:39
union ib_gid gid
GID, if present.
Definition: infiniband.h:92
uint16_t attr_id
Definition: ib_mad.h:546
uint8_t payload_mtu__rdc_exists__rnr_retry
Path packet payload MTU, RDC exists, RNR retry count.
Definition: ib_mad.h:389
A management datagram.
Definition: ib_mad.h:610
uint16_t pkey
Partition key.
Definition: infiniband.h:447
uint32_t local_id
Local communication ID.
Definition: ib_mad.h:12
struct ib_mad_transaction * madx
Connection request management transaction.
Definition: ib_cm.h:55
unsigned int lid
Local ID.
Definition: infiniband.h:81
void ib_destroy_path(struct ib_device *ibdev, struct ib_path *path)
Destroy path.
Definition: ib_pathrec.c:156
#define NULL
NULL pointer (VOID *)
Definition: Base.h:362
#define htons(value)
Definition: byteswap.h:135
uint8_t sl__subnet_local
SL and subnet local.
Definition: ib_mad.h:354
union ib_mad mad
Definition: arbel.h:12
uint32_t local_id
Local communication ID.
Definition: ib_mad.h:365
void * memset(void *dest, int character, size_t len) __nonnull

References ib_mad_hdr::attr_id, ib_queue_pair::av, ib_connection_operations::changed, ib_mad_hdr::class_version, ib_mad::cm, ib_mad_cm::cm_data, ib_cm_data::connect_request, DBGC, ib_cm_path::flow_label__rate, ib_address_vector::gid, ib_device::gid, ib_device::gsi, ib_mad::hdr, ib_cm_path::hop_limit, htonl, htons, IB_CM_ATTR_CONNECT_REQUEST, IB_CM_CLASS_VERSION, ib_cm_req_op, IB_CM_TRANSPORT_RC, ib_create_madx(), ib_destroy_path(), ib_madx_set_ownerdata(), IB_MGMT_CLASS_CM, IB_MGMT_METHOD_SEND, IB_MTU_2048, ib_path_get_ownerdata(), IB_QKEY_GSI, IB_QPN_GSI, ib_address_vector::lid, ib_device::lid, ib_cm_path::local_ack_timeout, ib_cm_connect_request::local_ca, ib_cm_connect_request::local_eecn__initiator_depth, ib_cm_path::local_gid, local_id, ib_connection::local_id, ib_cm_connect_request::local_id, ib_cm_path::local_lid, ib_cm_connect_request::local_qpn__responder_resources, mad, ib_connection::madx, ib_cm_connect_request::max_cm_retries__srq, memcpy(), memset(), ib_mad_hdr::method, ib_mad_hdr::mgmt_class, ib_device::node_guid, NULL, ib_connection::op, out, ib_connection::path, ib_cm_connect_request::payload_mtu__rdc_exists__rnr_retry, ib_cm_connect_request::pkey, ib_device::pkey, ib_cm_connect_request::primary, ib_connection::private_data, ib_cm_connect_request::private_data, ib_connection::private_data_len, ib_address_vector::qkey, qp, ib_connection::qp, ib_address_vector::qpn, ib_address_vector::rate, rc, ib_cm_connect_request::remote_eecn__remote_timeout__service_type__ee_flow_ctrl, ib_cm_path::remote_gid, ib_cm_path::remote_lid, ib_connection::service_id, ib_cm_connect_request::service_id, ib_address_vector::sl, ib_cm_path::sl__subnet_local, ib_cm_connect_request::starting_psn__local_timeout__retry_count, and strerror().

◆ ib_create_conn()

struct ib_connection* ib_create_conn ( struct ib_device ibdev,
struct ib_queue_pair qp,
union ib_gid dgid,
union ib_guid service_id,
void *  private_data,
size_t  private_data_len,
struct ib_connection_operations op 
)

Create connection to remote QP.

Parameters
ibdevInfiniband device
qpQueue pair
dgidTarget GID
service_idTarget service ID
private_dataConnection request private data
private_data_lenLength of connection request private data
opConnection operations
Return values
connConnection

Definition at line 451 of file ib_cm.c.

454  {
455  struct ib_connection *conn;
457 
458  /* Allocate and initialise request */
459  conn = zalloc ( sizeof ( *conn ) + private_data_len );
460  if ( ! conn )
461  goto err_alloc_conn;
462  conn->ibdev = ibdev;
463  conn->qp = qp;
464  memset ( &qp->av, 0, sizeof ( qp->av ) );
465  qp->av.gid_present = 1;
466  memcpy ( &qp->av.gid, dgid, sizeof ( qp->av.gid ) );
467  conn->local_id = local_id = random();
468  memcpy ( &conn->service_id, service_id, sizeof ( conn->service_id ) );
469  conn->op = op;
472 
473  /* Create path */
474  conn->path = ib_create_path ( ibdev, &qp->av, &ib_cm_path_op );
475  if ( ! conn->path )
476  goto err_create_path;
477  ib_path_set_ownerdata ( conn->path, conn );
478 
479  /* Add to list of connections */
480  list_add ( &conn->list, &ib_cm_conns );
481 
482  DBGC ( local_id, "CM %08x created for IBDEV %s QPN %#lx\n",
483  local_id, ibdev->name, qp->qpn );
484  DBGC ( local_id, "CM %08x connecting to " IB_GID_FMT " "
486  IB_GUID_ARGS ( service_id ) );
487 
488  return conn;
489 
490  ib_destroy_path ( ibdev, conn->path );
491  err_create_path:
492  free ( conn );
493  err_alloc_conn:
494  return NULL;
495 }
char name[IBDEV_NAME_LEN]
Name of this Infiniband device.
Definition: infiniband.h:408
struct list_head list
List of connections.
Definition: ib_cm.h:50
#define list_add(new, head)
Add a new entry to the head of a list.
Definition: list.h:69
uint8_t private_data[0]
Connection request private data.
Definition: ib_cm.h:60
#define DBGC(...)
Definition: compiler.h:505
size_t private_data_len
Length of connection request private data.
Definition: ib_cm.h:58
#define IB_GUID_ARGS(guid)
Infiniband Globally Unique Identifier debug message arguments.
Definition: ib_packet.h:29
union ib_guid service_id
Target service ID.
Definition: ib_cm.h:45
static __always_inline void ib_path_set_ownerdata(struct ib_path *path, void *priv)
Set Infiniband path owner-private data.
Definition: ib_pathrec.h:52
uint32_t local_id
Local communication ID.
Definition: ib_cm.h:41
void * memcpy(void *dest, const void *src, size_t len) __nonnull
#define IB_GUID_FMT
Infiniband Globally Unique Identifier debug message format.
Definition: ib_packet.h:26
struct ib_path * ib_create_path(struct ib_device *ibdev, struct ib_address_vector *av, struct ib_path_operations *op)
Create path.
Definition: ib_pathrec.c:107
#define IB_GID_ARGS(gid)
Infiniband Global Identifier debug message arguments.
Definition: ib_packet.h:48
static void(* free)(struct refcnt *refcnt))
Definition: refcnt.h:54
void * zalloc(size_t size)
Allocate cleared memory.
Definition: malloc.c:624
struct ib_connection_operations * op
Connection operations.
Definition: ib_cm.h:47
long int random(void)
Generate a pseudo-random number between 0 and 2147483647L or 2147483562?
Definition: random.c:30
unsigned int uint32_t
Definition: stdint.h:12
An Infiniband connection.
Definition: ib_cm.h:35
struct ib_path * path
Path to target.
Definition: ib_cm.h:53
union ib_gid dgid
Definition: ib_mad.h:12
struct arbelprm_qp_db_record qp
Definition: arbel.h:13
static uint16_t struct vmbus_xfer_pages_operations * op
Definition: netvsc.h:327
struct ib_queue_pair * qp
Queue pair.
Definition: ib_cm.h:39
uint8_t private_data[92]
Private data.
Definition: ib_mad.h:44
#define IB_GID_FMT
Infiniband Global Identifier debug message format.
Definition: ib_packet.h:45
struct ib_device * ibdev
Infiniband device.
Definition: ib_cm.h:37
uint32_t local_id
Local communication ID.
Definition: ib_mad.h:12
static struct ib_path_operations ib_cm_path_op
Connection path operations.
Definition: ib_cm.c:434
union ib_guid service_id
Service ID.
Definition: ib_mad.h:16
void ib_destroy_path(struct ib_device *ibdev, struct ib_path *path)
Destroy path.
Definition: ib_pathrec.c:156
#define NULL
NULL pointer (VOID *)
Definition: Base.h:362
void * memset(void *dest, int character, size_t len) __nonnull

References DBGC, dgid, free, ib_cm_path_op, ib_create_path(), ib_destroy_path(), IB_GID_ARGS, IB_GID_FMT, IB_GUID_ARGS, IB_GUID_FMT, ib_path_set_ownerdata(), ib_connection::ibdev, ib_connection::list, list_add, local_id, ib_connection::local_id, memcpy(), memset(), ib_device::name, NULL, ib_connection::op, op, ib_connection::path, private_data, ib_connection::private_data, ib_connection::private_data_len, qp, ib_connection::qp, random(), service_id, ib_connection::service_id, and zalloc().

Referenced by ib_cmrc_xfer_deliver().

◆ ib_destroy_conn()

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

Destroy connection to remote QP.

Parameters
ibdevInfiniband device
qpQueue pair
connConnection

Definition at line 504 of file ib_cm.c.

506  {
507 
508  list_del ( &conn->list );
509  if ( conn->madx )
510  ib_destroy_madx ( ibdev, ibdev->gsi, conn->madx );
511  if ( conn->path )
512  ib_destroy_path ( ibdev, conn->path );
513  free ( conn );
514 }
struct list_head list
List of connections.
Definition: ib_cm.h:50
struct ib_mad_interface * gsi
General services interface.
Definition: infiniband.h:459
#define list_del(list)
Delete an entry from a list.
Definition: list.h:119
static void(* free)(struct refcnt *refcnt))
Definition: refcnt.h:54
struct ib_path * path
Path to target.
Definition: ib_cm.h:53
struct ib_device * ibdev
Infiniband device.
Definition: ib_cm.h:37
struct ib_mad_transaction * madx
Connection request management transaction.
Definition: ib_cm.h:55
void ib_destroy_path(struct ib_device *ibdev, struct ib_path *path)
Destroy path.
Definition: ib_pathrec.c:156
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 free, ib_device::gsi, ib_destroy_madx(), ib_destroy_path(), ib_connection::ibdev, ib_connection::list, list_del, ib_connection::madx, and ib_connection::path.

Referenced by ib_cmrc_shutdown().

Variable Documentation

◆ __ib_mad_agent

struct ib_mad_agent ib_cm_agent [] __ib_mad_agent
Initial value:
= {
{
.mgmt_class = IB_MGMT_CLASS_CM,
.class_version = IB_CM_CLASS_VERSION,
.handle = ib_cm_recv_rep,
},
{
.mgmt_class = IB_MGMT_CLASS_CM,
.class_version = IB_CM_CLASS_VERSION,
.handle = ib_cm_recv_dreq,
},
}
#define IB_CM_CLASS_VERSION
Communication management class version.
Definition: ib_mad.h:311
#define IB_MGMT_CLASS_CM
Definition: ib_mad.h:561
#define IB_CM_ATTR_DISCONNECT_REQUEST
Definition: ib_mad.h:320
static void ib_cm_recv_dreq(struct ib_device *ibdev, struct ib_mad_interface *mi, union ib_mad *mad, struct ib_address_vector *av)
Handle disconnection requests.
Definition: ib_cm.c:184
static void ib_cm_recv_rep(struct ib_device *ibdev, struct ib_mad_interface *mi, union ib_mad *mad, struct ib_address_vector *av)
Handle duplicate connection replies.
Definition: ib_cm.c:114
#define IB_CM_ATTR_CONNECT_REPLY
Definition: ib_mad.h:318
#define htons(value)
Definition: byteswap.h:135

Communication management agents.

Definition at line 214 of file ib_cm.c.

◆ ib_cm_req_op

struct ib_mad_transaction_operations ib_cm_req_op
static
Initial value:
= {
.complete = ib_cm_req_complete,
}
static void ib_cm_req_complete(struct ib_device *ibdev, struct ib_mad_interface *mi, struct ib_mad_transaction *madx, int rc, union ib_mad *mad, struct ib_address_vector *av)
Handle connection request transaction completion.
Definition: ib_cm.c:258

Connection request operations.

Definition at line 342 of file ib_cm.c.

Referenced by ib_cm_path_complete().

◆ ib_cm_path_op

struct ib_path_operations ib_cm_path_op
static
Initial value:
= {
.complete = ib_cm_path_complete,
}
static void ib_cm_path_complete(struct ib_device *ibdev, struct ib_path *path, int rc, struct ib_address_vector *av)
Handle connection path transaction completion.
Definition: ib_cm.c:354

Connection path operations.

Definition at line 434 of file ib_cm.c.

Referenced by ib_create_conn().