Linux Kernel  3.7.1
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
Data Structures | Macros | Enumerations | Functions | Variables
cm.c File Reference
#include <linux/completion.h>
#include <linux/dma-mapping.h>
#include <linux/device.h>
#include <linux/module.h>
#include <linux/err.h>
#include <linux/idr.h>
#include <linux/interrupt.h>
#include <linux/random.h>
#include <linux/rbtree.h>
#include <linux/spinlock.h>
#include <linux/slab.h>
#include <linux/sysfs.h>
#include <linux/workqueue.h>
#include <linux/kdev_t.h>
#include <rdma/ib_cache.h>
#include <rdma/ib_cm.h>
#include "cm_msgs.h"

Go to the source code of this file.

Data Structures

struct  ib_cm
 
struct  cm_counter_group
 
struct  cm_counter_attribute
 
struct  cm_port
 
struct  cm_device
 
struct  cm_av
 
struct  cm_work
 
struct  cm_timewait_info
 
struct  cm_id_private
 

Macros

#define CM_COUNTER_ATTR(_name, _index)
 

Enumerations

enum  {
  CM_REQ_COUNTER, CM_MRA_COUNTER, CM_REJ_COUNTER, CM_REP_COUNTER,
  CM_RTU_COUNTER, CM_DREQ_COUNTER, CM_DREP_COUNTER, CM_SIDR_REQ_COUNTER,
  CM_SIDR_REP_COUNTER, CM_LAP_COUNTER, CM_APR_COUNTER, CM_ATTR_COUNT,
  CM_ATTR_ID_OFFSET = 0x0010
}
 
enum  {
  CM_XMIT, CM_XMIT_RETRIES, CM_RECV, CM_RECV_DUPLICATES,
  CM_COUNTER_GROUPS
}
 

Functions

 MODULE_AUTHOR ("Sean Hefty")
 
 MODULE_DESCRIPTION ("InfiniBand CM")
 
 MODULE_LICENSE ("Dual BSD/GPL")
 
struct ib_cm_idib_create_cm_id (struct ib_device *device, ib_cm_handler cm_handler, void *context)
 
 EXPORT_SYMBOL (ib_create_cm_id)
 
void ib_destroy_cm_id (struct ib_cm_id *cm_id)
 
 EXPORT_SYMBOL (ib_destroy_cm_id)
 
int ib_cm_listen (struct ib_cm_id *cm_id, __be64 service_id, __be64 service_mask, struct ib_cm_compare_data *compare_data)
 
 EXPORT_SYMBOL (ib_cm_listen)
 
int ib_send_cm_req (struct ib_cm_id *cm_id, struct ib_cm_req_param *param)
 
 EXPORT_SYMBOL (ib_send_cm_req)
 
int ib_send_cm_rep (struct ib_cm_id *cm_id, struct ib_cm_rep_param *param)
 
 EXPORT_SYMBOL (ib_send_cm_rep)
 
int ib_send_cm_rtu (struct ib_cm_id *cm_id, const void *private_data, u8 private_data_len)
 
 EXPORT_SYMBOL (ib_send_cm_rtu)
 
int ib_send_cm_dreq (struct ib_cm_id *cm_id, const void *private_data, u8 private_data_len)
 
 EXPORT_SYMBOL (ib_send_cm_dreq)
 
int ib_send_cm_drep (struct ib_cm_id *cm_id, const void *private_data, u8 private_data_len)
 
 EXPORT_SYMBOL (ib_send_cm_drep)
 
int ib_send_cm_rej (struct ib_cm_id *cm_id, enum ib_cm_rej_reason reason, void *ari, u8 ari_length, const void *private_data, u8 private_data_len)
 
 EXPORT_SYMBOL (ib_send_cm_rej)
 
int ib_send_cm_mra (struct ib_cm_id *cm_id, u8 service_timeout, const void *private_data, u8 private_data_len)
 
 EXPORT_SYMBOL (ib_send_cm_mra)
 
int ib_send_cm_lap (struct ib_cm_id *cm_id, struct ib_sa_path_rec *alternate_path, const void *private_data, u8 private_data_len)
 
 EXPORT_SYMBOL (ib_send_cm_lap)
 
int ib_send_cm_apr (struct ib_cm_id *cm_id, enum ib_cm_apr_status status, void *info, u8 info_length, const void *private_data, u8 private_data_len)
 
 EXPORT_SYMBOL (ib_send_cm_apr)
 
int ib_send_cm_sidr_req (struct ib_cm_id *cm_id, struct ib_cm_sidr_req_param *param)
 
 EXPORT_SYMBOL (ib_send_cm_sidr_req)
 
int ib_send_cm_sidr_rep (struct ib_cm_id *cm_id, struct ib_cm_sidr_rep_param *param)
 
 EXPORT_SYMBOL (ib_send_cm_sidr_rep)
 
int ib_cm_notify (struct ib_cm_id *cm_id, enum ib_event_type event)
 
 EXPORT_SYMBOL (ib_cm_notify)
 
int ib_cm_init_qp_attr (struct ib_cm_id *cm_id, struct ib_qp_attr *qp_attr, int *qp_attr_mask)
 
 EXPORT_SYMBOL (ib_cm_init_qp_attr)
 
 EXPORT_SYMBOL (cm_class)
 
 module_init (ib_cm_init)
 
 module_exit (ib_cm_cleanup)
 

Variables

struct class cm_class
 

Macro Definition Documentation

#define CM_COUNTER_ATTR (   _name,
  _index 
)
Value:
struct cm_counter_attribute cm_##_name##_counter_attr = { \
.attr = { .name = __stringify(_name), .mode = 0444 }, \
.index = _index \
}

Definition at line 125 of file cm.c.

Enumeration Type Documentation

anonymous enum
Enumerator:
CM_REQ_COUNTER 
CM_MRA_COUNTER 
CM_REJ_COUNTER 
CM_REP_COUNTER 
CM_RTU_COUNTER 
CM_DREQ_COUNTER 
CM_DREP_COUNTER 
CM_SIDR_REQ_COUNTER 
CM_SIDR_REP_COUNTER 
CM_LAP_COUNTER 
CM_APR_COUNTER 
CM_ATTR_COUNT 
CM_ATTR_ID_OFFSET 

Definition at line 85 of file cm.c.

anonymous enum
Enumerator:
CM_XMIT 
CM_XMIT_RETRIES 
CM_RECV 
CM_RECV_DUPLICATES 
CM_COUNTER_GROUPS 

Definition at line 101 of file cm.c.

Function Documentation

EXPORT_SYMBOL ( ib_create_cm_id  )
EXPORT_SYMBOL ( ib_destroy_cm_id  )
EXPORT_SYMBOL ( ib_cm_listen  )
EXPORT_SYMBOL ( ib_send_cm_req  )
EXPORT_SYMBOL ( ib_send_cm_rep  )
EXPORT_SYMBOL ( ib_send_cm_rtu  )
EXPORT_SYMBOL ( ib_send_cm_dreq  )
EXPORT_SYMBOL ( ib_send_cm_drep  )
EXPORT_SYMBOL ( ib_send_cm_rej  )
EXPORT_SYMBOL ( ib_send_cm_mra  )
EXPORT_SYMBOL ( ib_send_cm_lap  )
EXPORT_SYMBOL ( ib_send_cm_apr  )
EXPORT_SYMBOL ( ib_send_cm_sidr_req  )
EXPORT_SYMBOL ( ib_send_cm_sidr_rep  )
EXPORT_SYMBOL ( ib_cm_notify  )
EXPORT_SYMBOL ( ib_cm_init_qp_attr  )
EXPORT_SYMBOL ( cm_class  )
int ib_cm_init_qp_attr ( struct ib_cm_id cm_id,
struct ib_qp_attr qp_attr,
int qp_attr_mask 
)

ib_cm_init_qp_attr - Initializes the QP attributes for use in transitioning to a specified QP state. : Communication identifier associated with the QP attributes to initialize. : On input, specifies the desired QP state. On output, the mandatory and desired optional attributes will be set in order to modify the QP to the specified state. : The QP attribute mask that may be used to transition the QP to the specified state.

Users must set the ->qp_state to the desired QP state. This call will set all required attributes for the given transition, along with known optional attributes. Users may override the attributes returned from this call before calling ib_modify_qp.

Definition at line 3592 of file cm.c.

int ib_cm_listen ( struct ib_cm_id cm_id,
__be64  service_id,
__be64  service_mask,
struct ib_cm_compare_data compare_data 
)

ib_cm_listen - Initiates listening on the specified service ID for connection and service ID resolution requests. : Connection identifier associated with the listen request. : Service identifier matched against incoming connection and service ID resolution requests. The service ID should be specified network-byte order. If set to IB_CM_ASSIGN_SERVICE_ID, the CM will assign a service ID to the caller. : Mask applied to service ID used to listen across a range of service IDs. If set to 0, the service ID is matched exactly. This parameter is ignored if service_id is set to IB_CM_ASSIGN_SERVICE_ID. : This parameter is optional. It specifies data that must appear in the private data of a connection request for the specified listen request.

Definition at line 927 of file cm.c.

int ib_cm_notify ( struct ib_cm_id cm_id,
enum ib_event_type  event 
)

ib_cm_notify - Notifies the CM of an event reported to the consumer. : Connection identifier to transition to established. : Type of event.

This routine should be invoked by users to notify the CM of relevant communication events. Events that should be reported to the CM and when to report them are:

IB_EVENT_COMM_EST - Used when a message is received on a connected QP before an RTU has been received. IB_EVENT_PATH_MIG - Notifies the CM that the connection has failed over to the alternate path.

Definition at line 3363 of file cm.c.

struct ib_cm_id* ib_create_cm_id ( struct ib_device device,
ib_cm_handler  cm_handler,
void context 
)
read

ib_create_cm_id - Allocate a communication identifier. : Device associated with the cm_id. All related communication will be associated with the specified device. : Callback invoked to notify the user of CM events. : User specified context associated with the communication identifier.

Communication identifiers are used to track connection states, service ID resolution requests, and listen requests.

Definition at line 695 of file cm.c.

void ib_destroy_cm_id ( struct ib_cm_id cm_id)

ib_destroy_cm_id - Destroy a connection identifier. : Connection identifier to destroy.

This call blocks until the connection identifier is destroyed.

Definition at line 921 of file cm.c.

int ib_send_cm_apr ( struct ib_cm_id cm_id,
enum ib_cm_apr_status  status,
void info,
u8  info_length,
const void private_data,
u8  private_data_len 
)

ib_send_cm_apr - Sends an alternate path response message in response to a load alternate path request. : Connection identifier associated with the alternate path response. : Reply status sent with the alternate path response. : Optional additional information sent with the alternate path response. : Size of the additional information, in bytes. : Optional user-defined private data sent with the alternate path response message. : Size of the private data buffer, in bytes.

Definition at line 2775 of file cm.c.

int ib_send_cm_drep ( struct ib_cm_id cm_id,
const void private_data,
u8  private_data_len 
)

ib_send_cm_drep - Sends a disconnection reply to a disconnection request. : Connection identifier associated with the connection being released. : Optional user-defined private data sent with the disconnection reply message. : Size of the private data buffer, in bytes.

If the cm_id is in the correct state, the CM will transition the connection to the timewait state, even if an error occurs sending the DREP message.

Definition at line 2047 of file cm.c.

int ib_send_cm_dreq ( struct ib_cm_id cm_id,
const void private_data,
u8  private_data_len 
)

ib_send_cm_dreq - Sends a disconnection request for an existing connection. : Connection identifier associated with the connection being released. : Optional user-defined private data sent with the disconnection request message. : Size of the private data buffer, in bytes.

Definition at line 1985 of file cm.c.

int ib_send_cm_lap ( struct ib_cm_id cm_id,
struct ib_sa_path_rec alternate_path,
const void private_data,
u8  private_data_len 
)

ib_send_cm_lap - Sends a load alternate path request. : Connection identifier associated with the load alternate path message. : A path record that identifies the alternate path to load. : Optional user-defined private data sent with the load alternate path message. : Size of the private data buffer, in bytes.

Definition at line 2602 of file cm.c.

int ib_send_cm_mra ( struct ib_cm_id cm_id,
u8  service_timeout,
const void private_data,
u8  private_data_len 
)

ib_send_cm_mra - Sends a message receipt acknowledgement to a connection message. : Connection identifier associated with the connection message. : The lower 5-bits specify the maximum time required for the sender to reply to the connection message. The upper 3-bits specify additional control flags. : Optional user-defined private data sent with the message receipt acknowledgement. : Size of the private data buffer, in bytes.

Definition at line 2406 of file cm.c.

int ib_send_cm_rej ( struct ib_cm_id cm_id,
enum ib_cm_rej_reason  reason,
void ari,
u8  ari_length,
const void private_data,
u8  private_data_len 
)

ib_send_cm_rej - Sends a connection rejection message to the remote node. : Connection identifier associated with the connection being rejected. : Reason for the connection request rejection. : Optional additional rejection information. : Size of the additional rejection information, in bytes. : Optional user-defined private data sent with the rejection message. : Size of the private data buffer, in bytes.

Definition at line 2232 of file cm.c.

int ib_send_cm_rep ( struct ib_cm_id cm_id,
struct ib_cm_rep_param param 
)

ib_send_cm_rep - Sends a connection reply in response to a connection request. : Connection identifier that will be associated with the connection request.

Parameters
Connection reply information needed to establish the connection.

Definition at line 1634 of file cm.c.

int ib_send_cm_req ( struct ib_cm_id cm_id,
struct ib_cm_req_param param 
)

ib_send_cm_req - Sends a connection request to the remote node. : Connection identifier that will be associated with the connection request.

Parameters
Connection request information needed to establish the connection.

Definition at line 1105 of file cm.c.

int ib_send_cm_rtu ( struct ib_cm_id cm_id,
const void private_data,
u8  private_data_len 
)

ib_send_cm_rtu - Sends a connection ready to use message in response to a connection reply message. : Connection identifier associated with the connection request. : Optional user-defined private data sent with the ready to use message. : Size of the private data buffer, in bytes.

Definition at line 1696 of file cm.c.

int ib_send_cm_sidr_rep ( struct ib_cm_id cm_id,
struct ib_cm_sidr_rep_param param 
)

ib_send_cm_sidr_rep - Sends a service ID resolution reply to the remote node. : Communication identifier associated with the received service ID resolution request.

Parameters
Service ID resolution reply information.

Definition at line 3059 of file cm.c.

int ib_send_cm_sidr_req ( struct ib_cm_id cm_id,
struct ib_cm_sidr_req_param param 
)

ib_send_cm_sidr_req - Sends a service ID resolution request to the remote node. : Communication identifier that will be associated with the service ID resolution request.

Parameters
Service ID resolution request information.

Definition at line 2915 of file cm.c.

MODULE_AUTHOR ( "Sean Hefty"  )
MODULE_DESCRIPTION ( "InfiniBand CM"  )
module_exit ( ib_cm_cleanup  )
module_init ( ib_cm_init  )
MODULE_LICENSE ( "Dual BSD/GPL"  )

Variable Documentation

struct class cm_class
Initial value:
= {
.owner = THIS_MODULE,
.name = "infiniband_cm",
.devnode = cm_devnode,
}

Definition at line 3669 of file cm.c.