Linux Kernel  3.7.1
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
Data Structures | Macros | Enumerations | Functions | Variables
cma.c File Reference
#include <linux/completion.h>
#include <linux/in.h>
#include <linux/in6.h>
#include <linux/mutex.h>
#include <linux/random.h>
#include <linux/idr.h>
#include <linux/inetdevice.h>
#include <linux/slab.h>
#include <linux/module.h>
#include <net/route.h>
#include <net/tcp.h>
#include <net/ipv6.h>
#include <rdma/rdma_cm.h>
#include <rdma/rdma_cm_ib.h>
#include <rdma/rdma_netlink.h>
#include <rdma/ib_cache.h>
#include <rdma/ib_cm.h>
#include <rdma/ib_sa.h>
#include <rdma/iw_cm.h>

Go to the source code of this file.

Data Structures

struct  cma_device
 
struct  rdma_bind_list
 
struct  rdma_id_private
 
struct  cma_multicast
 
struct  cma_work
 
struct  cma_ndev_work
 
struct  iboe_mcast_work
 
union  cma_ip_addr
 
struct  cma_hdr
 
struct  sdp_hh
 
struct  sdp_hah
 

Macros

#define CMA_CM_RESPONSE_TIMEOUT   20
 
#define CMA_MAX_CM_RETRIES   15
 
#define CMA_CM_MRA_SETTING   (IB_CM_MRA_FLAG_DELAY | 24)
 
#define CMA_IBOE_PACKET_LIFETIME   18
 
#define CMA_VERSION   0x00
 
#define SDP_MAJ_VERSION   0x2
 

Enumerations

enum  { CMA_OPTION_AFONLY }
 

Functions

 MODULE_AUTHOR ("Sean Hefty")
 
 MODULE_DESCRIPTION ("Generic RDMA CM Agent")
 
 MODULE_LICENSE ("Dual BSD/GPL")
 
struct rdma_cm_idrdma_create_id (rdma_cm_event_handler event_handler, void *context, enum rdma_port_space ps, enum ib_qp_type qp_type)
 
 EXPORT_SYMBOL (rdma_create_id)
 
int rdma_create_qp (struct rdma_cm_id *id, struct ib_pd *pd, struct ib_qp_init_attr *qp_init_attr)
 
 EXPORT_SYMBOL (rdma_create_qp)
 
void rdma_destroy_qp (struct rdma_cm_id *id)
 
 EXPORT_SYMBOL (rdma_destroy_qp)
 
int rdma_init_qp_attr (struct rdma_cm_id *id, struct ib_qp_attr *qp_attr, int *qp_attr_mask)
 
 EXPORT_SYMBOL (rdma_init_qp_attr)
 
void rdma_destroy_id (struct rdma_cm_id *id)
 
 EXPORT_SYMBOL (rdma_destroy_id)
 
void rdma_set_service_type (struct rdma_cm_id *id, int tos)
 
 EXPORT_SYMBOL (rdma_set_service_type)
 
int rdma_set_ib_paths (struct rdma_cm_id *id, struct ib_sa_path_rec *path_rec, int num_paths)
 
 EXPORT_SYMBOL (rdma_set_ib_paths)
 
int rdma_resolve_route (struct rdma_cm_id *id, int timeout_ms)
 
 EXPORT_SYMBOL (rdma_resolve_route)
 
int rdma_resolve_addr (struct rdma_cm_id *id, struct sockaddr *src_addr, struct sockaddr *dst_addr, int timeout_ms)
 
 EXPORT_SYMBOL (rdma_resolve_addr)
 
int rdma_set_reuseaddr (struct rdma_cm_id *id, int reuse)
 
 EXPORT_SYMBOL (rdma_set_reuseaddr)
 
int rdma_set_afonly (struct rdma_cm_id *id, int afonly)
 
 EXPORT_SYMBOL (rdma_set_afonly)
 
int rdma_listen (struct rdma_cm_id *id, int backlog)
 
 EXPORT_SYMBOL (rdma_listen)
 
int rdma_bind_addr (struct rdma_cm_id *id, struct sockaddr *addr)
 
 EXPORT_SYMBOL (rdma_bind_addr)
 
int rdma_connect (struct rdma_cm_id *id, struct rdma_conn_param *conn_param)
 
 EXPORT_SYMBOL (rdma_connect)
 
int rdma_accept (struct rdma_cm_id *id, struct rdma_conn_param *conn_param)
 
 EXPORT_SYMBOL (rdma_accept)
 
int rdma_notify (struct rdma_cm_id *id, enum ib_event_type event)
 
 EXPORT_SYMBOL (rdma_notify)
 
int rdma_reject (struct rdma_cm_id *id, const void *private_data, u8 private_data_len)
 
 EXPORT_SYMBOL (rdma_reject)
 
int rdma_disconnect (struct rdma_cm_id *id)
 
 EXPORT_SYMBOL (rdma_disconnect)
 
int rdma_join_multicast (struct rdma_cm_id *id, struct sockaddr *addr, void *context)
 
 EXPORT_SYMBOL (rdma_join_multicast)
 
void rdma_leave_multicast (struct rdma_cm_id *id, struct sockaddr *addr)
 
 EXPORT_SYMBOL (rdma_leave_multicast)
 
 module_init (cma_init)
 
 module_exit (cma_cleanup)
 

Variables

struct cma_device __attribute__
 

Macro Definition Documentation

#define CMA_CM_MRA_SETTING   (IB_CM_MRA_FLAG_DELAY | 24)

Definition at line 64 of file cma.c.

#define CMA_CM_RESPONSE_TIMEOUT   20

Definition at line 62 of file cma.c.

#define CMA_IBOE_PACKET_LIFETIME   18

Definition at line 65 of file cma.c.

#define CMA_MAX_CM_RETRIES   15

Definition at line 63 of file cma.c.

#define CMA_VERSION   0x00

Definition at line 214 of file cma.c.

#define SDP_MAJ_VERSION   0x2

Definition at line 215 of file cma.c.

Enumeration Type Documentation

anonymous enum
Enumerator:
CMA_OPTION_AFONLY 

Definition at line 102 of file cma.c.

Function Documentation

EXPORT_SYMBOL ( rdma_create_id  )
EXPORT_SYMBOL ( rdma_create_qp  )
EXPORT_SYMBOL ( rdma_destroy_qp  )
EXPORT_SYMBOL ( rdma_init_qp_attr  )
EXPORT_SYMBOL ( rdma_destroy_id  )
EXPORT_SYMBOL ( rdma_set_service_type  )
EXPORT_SYMBOL ( rdma_set_ib_paths  )
EXPORT_SYMBOL ( rdma_resolve_route  )
EXPORT_SYMBOL ( rdma_resolve_addr  )
EXPORT_SYMBOL ( rdma_set_reuseaddr  )
EXPORT_SYMBOL ( rdma_set_afonly  )
EXPORT_SYMBOL ( rdma_listen  )
EXPORT_SYMBOL ( rdma_bind_addr  )
EXPORT_SYMBOL ( rdma_connect  )
EXPORT_SYMBOL ( rdma_accept  )
EXPORT_SYMBOL ( rdma_notify  )
EXPORT_SYMBOL ( rdma_reject  )
EXPORT_SYMBOL ( rdma_disconnect  )
EXPORT_SYMBOL ( rdma_join_multicast  )
EXPORT_SYMBOL ( rdma_leave_multicast  )
MODULE_AUTHOR ( "Sean Hefty"  )
MODULE_DESCRIPTION ( "Generic RDMA CM Agent"  )
module_exit ( cma_cleanup  )
module_init ( cma_init  )
MODULE_LICENSE ( "Dual BSD/GPL"  )
int rdma_accept ( struct rdma_cm_id id,
struct rdma_conn_param conn_param 
)

rdma_accept - Called to accept a connection request or response. : Connection identifier associated with the request. : Information needed to establish the connection. This must be provided if accepting a connection request. If accepting a connection response, this parameter must be NULL.

Typically, this routine is only called by the listener to accept a connection request. It must also be called on the active side of a connection if the user is performing their own QP transitions.

In the case of error, a reject message is sent to the remote side and the state of the qp associated with the id is modified to error, such that any previously posted receive buffers would be flushed.

Definition at line 2825 of file cma.c.

int rdma_bind_addr ( struct rdma_cm_id id,
struct sockaddr addr 
)

rdma_bind_addr - Bind an RDMA identifier to a source address and associated RDMA device, if needed.

: RDMA identifier. : Local address information. Wildcard values are permitted.

This associates a source address with the RDMA identifier before calling rdma_listen. If a specific local address is given, the RDMA identifier will be bound to a local RDMA device.

Definition at line 2380 of file cma.c.

int rdma_connect ( struct rdma_cm_id id,
struct rdma_conn_param conn_param 
)

rdma_connect - Initiate an active connection request. : Connection identifier to connect. : Connection information used for connected QPs.

Users must have resolved a route for the rdma_cm_id to connect with by having called rdma_resolve_route before calling this routine.

This call will either connect to a remote QP or obtain remote QP information for unconnected rdma_cm_id's. The actual operation is based on the rdma_cm_id's port space.

Definition at line 2712 of file cma.c.

struct rdma_cm_id* rdma_create_id ( rdma_cm_event_handler  event_handler,
void context,
enum rdma_port_space  ps,
enum ib_qp_type  qp_type 
)
read

rdma_create_id - Create an RDMA identifier.

: User callback invoked to report events associated with the returned rdma_id. : User specified context associated with the id. : RDMA port space. : type of queue pair associated with the id.

Definition at line 422 of file cma.c.

int rdma_create_qp ( struct rdma_cm_id id,
struct ib_pd pd,
struct ib_qp_init_attr qp_init_attr 
)

rdma_create_qp - Allocate a QP and associate it with the specified RDMA identifier.

QPs allocated to an rdma_cm_id will automatically be transitioned by the CMA through their states.

Definition at line 490 of file cma.c.

void rdma_destroy_id ( struct rdma_cm_id id)

rdma_destroy_id - Destroys an RDMA identifier.

: RDMA identifier.

Note: calling this function has the effect of canceling in-flight asynchronous operations associated with the id.

Definition at line 912 of file cma.c.

void rdma_destroy_qp ( struct rdma_cm_id id)

rdma_destroy_qp - Deallocate the QP associated with the specified RDMA identifier.

Users must destroy any QP associated with an RDMA identifier before destroying the RDMA ID.

Definition at line 522 of file cma.c.

int rdma_disconnect ( struct rdma_cm_id id)

rdma_disconnect - This function disconnects the associated QP and transitions it into the error state.

Definition at line 2931 of file cma.c.

int rdma_init_qp_attr ( struct rdma_cm_id id,
struct ib_qp_attr qp_attr,
int qp_attr_mask 
)

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

Users that wish to have their QP automatically transitioned through its states can associate a QP with the rdma_cm_id by calling rdma_create_qp().

Definition at line 647 of file cma.c.

int rdma_join_multicast ( struct rdma_cm_id id,
struct sockaddr addr,
void context 
)

rdma_join_multicast - Join the multicast group specified by the given address. : Communication identifier associated with the request. : Multicast address identifying the group to join. : User-defined context associated with the join request, returned to the user through the private_data pointer in multicast events.

Definition at line 3169 of file cma.c.

void rdma_leave_multicast ( struct rdma_cm_id id,
struct sockaddr addr 
)

rdma_leave_multicast - Leave the multicast group specified by the given address.

Definition at line 3222 of file cma.c.

int rdma_listen ( struct rdma_cm_id id,
int  backlog 
)

rdma_listen - This function is called by the passive side to listen for incoming connection requests.

Users must have bound the rdma_cm_id to a local address by calling rdma_bind_addr before calling this routine.

Definition at line 2330 of file cma.c.

int rdma_notify ( struct rdma_cm_id id,
enum ib_event_type  event 
)

rdma_notify - Notifies the RDMA CM of an asynchronous event that has occurred on the connection. : Connection identifier to transition to established. : Asynchronous 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.

Definition at line 2878 of file cma.c.

int rdma_reject ( struct rdma_cm_id id,
const void private_data,
u8  private_data_len 
)

rdma_reject - Called to reject a connection request or response.

Definition at line 2899 of file cma.c.

int rdma_resolve_addr ( struct rdma_cm_id id,
struct sockaddr src_addr,
struct sockaddr dst_addr,
int  timeout_ms 
)

rdma_resolve_addr - Resolve destination and optional source addresses from IP addresses to an RDMA address. If successful, the specified rdma_cm_id will be bound to a local device.

: RDMA identifier. : Source address information. This parameter may be NULL. : Destination address information. : Time to wait for resolution to complete.

Definition at line 2058 of file cma.c.

int rdma_resolve_route ( struct rdma_cm_id id,
int  timeout_ms 
)

rdma_resolve_route - Resolve the RDMA address bound to the RDMA identifier into route information needed to establish a connection.

This is called on the client side of a connection. Users must have first called rdma_resolve_addr to resolve a dst_addr into an RDMA address before calling this routine.

Definition at line 1876 of file cma.c.

int rdma_set_afonly ( struct rdma_cm_id id,
int  afonly 
)

rdma_set_afonly - Specify that listens are restricted to the bound address family only. : Communication identifer to configure. : Value indicating if listens are restricted.

Must be set before identifier is in the listening state.

Definition at line 2112 of file cma.c.

int rdma_set_ib_paths ( struct rdma_cm_id id,
struct ib_sa_path_rec path_rec,
int  num_paths 
)

rdma_set_ib_paths - Manually sets the path records used to establish a connection. : Connection identifier associated with the request. : Reference to the path record

This call permits a user to specify routing information for rdma_cm_id's bound to Infiniband devices. It is called on the client side of a connection and replaces the call to rdma_resolve_route.

Definition at line 1755 of file cma.c.

int rdma_set_reuseaddr ( struct rdma_cm_id id,
int  reuse 
)

rdma_set_reuseaddr - Allow the reuse of local addresses when binding the rdma_cm_id. : Communication identifier to configure. : Value indicating if the bound address is reusable.

Reuse must be set before an address is bound to the id.

Definition at line 2093 of file cma.c.

void rdma_set_service_type ( struct rdma_cm_id id,
int  tos 
)

rdma_set_service_type - Set the type of service associated with a connection identifier. : Communication identifier to associated with service type. : Type of service.

The type of service is interpretted as a differentiated service field (RFC 2474). The service type should be specified before performing route resolution, as existing communication on the connection identifier may be unaffected. The type of service requested may not be supported by the network to all destinations.

Definition at line 1605 of file cma.c.

Variable Documentation