aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/infiniband/hw/nes/nes_cm.h
diff options
context:
space:
mode:
authorFaisal Latif <faisal.latif@intel.com>2009-03-06 18:15:01 -0500
committerRoland Dreier <rolandd@cisco.com>2009-03-06 18:15:01 -0500
commit9d5ab13325d0bb855cf856946c140a68ceb20e32 (patch)
treec226cba67009db77052aceb1c7bf885da63fa4b8 /drivers/infiniband/hw/nes/nes_cm.h
parent0145f341a951b998d6d0fa38992a42d2a90b5bab (diff)
RDMA/nes: Handle MPA Reject message properly
While doing testing, there are failures as MPA Reject call is not handled. To handle MPA Reject call, following changes are done: *Handle inbound/outbound MPA Reject response message. When nes_reject() is called for pending MPA request reply, send the MPA Reject message to its peer (active side)cm_node. The peer cm_node (active side) will indicate Reject message event for the pending Connect Request. *Handle MPA Reject response message for loopback connections and listener. When MPA Request is rejected, check if it is a loopback connection and if it is then it will send Reject message event to its peer loopback node. Also when destroying listener, check if the cm_nodes for that listener are loopback or not. *Add gracefull connection close with the MPA Reject response message. Send gracefull close (FIN, FIN ACK..) to terminate the cm_nodes. *Some code re-org while making the above changes. Removed recv_list and recv_list_lock from the cm_node structure as there can be only one receive close entry on the timer. Also implemented handle_recv_entry() as receive close entry is processed from both nes_rem_ref_cm_node() as well as nes_cm_timer_tick(). Signed-off-by: Faisal Latif <faisal.latif@intel.com> Signed-off-by: Roland Dreier <rolandd@cisco.com>
Diffstat (limited to 'drivers/infiniband/hw/nes/nes_cm.h')
-rw-r--r--drivers/infiniband/hw/nes/nes_cm.h10
1 files changed, 7 insertions, 3 deletions
diff --git a/drivers/infiniband/hw/nes/nes_cm.h b/drivers/infiniband/hw/nes/nes_cm.h
index 4ab2bebf12ac..d5f778202eb7 100644
--- a/drivers/infiniband/hw/nes/nes_cm.h
+++ b/drivers/infiniband/hw/nes/nes_cm.h
@@ -39,6 +39,9 @@
39#define NES_MANAGE_APBVT_DEL 0 39#define NES_MANAGE_APBVT_DEL 0
40#define NES_MANAGE_APBVT_ADD 1 40#define NES_MANAGE_APBVT_ADD 1
41 41
42#define NES_MPA_REQUEST_ACCEPT 1
43#define NES_MPA_REQUEST_REJECT 2
44
42/* IETF MPA -- defines, enums, structs */ 45/* IETF MPA -- defines, enums, structs */
43#define IEFT_MPA_KEY_REQ "MPA ID Req Frame" 46#define IEFT_MPA_KEY_REQ "MPA ID Req Frame"
44#define IEFT_MPA_KEY_REP "MPA ID Rep Frame" 47#define IEFT_MPA_KEY_REP "MPA ID Rep Frame"
@@ -186,6 +189,7 @@ enum nes_cm_node_state {
186 NES_CM_STATE_ACCEPTING, 189 NES_CM_STATE_ACCEPTING,
187 NES_CM_STATE_MPAREQ_SENT, 190 NES_CM_STATE_MPAREQ_SENT,
188 NES_CM_STATE_MPAREQ_RCVD, 191 NES_CM_STATE_MPAREQ_RCVD,
192 NES_CM_STATE_MPAREJ_RCVD,
189 NES_CM_STATE_TSA, 193 NES_CM_STATE_TSA,
190 NES_CM_STATE_FIN_WAIT1, 194 NES_CM_STATE_FIN_WAIT1,
191 NES_CM_STATE_FIN_WAIT2, 195 NES_CM_STATE_FIN_WAIT2,
@@ -278,13 +282,12 @@ struct nes_cm_node {
278 struct nes_timer_entry *send_entry; 282 struct nes_timer_entry *send_entry;
279 283
280 spinlock_t retrans_list_lock; 284 spinlock_t retrans_list_lock;
281 struct list_head recv_list; 285 struct nes_timer_entry *recv_entry;
282 spinlock_t recv_list_lock;
283 286
284 int send_write0; 287 int send_write0;
285 union { 288 union {
286 struct ietf_mpa_frame mpa_frame; 289 struct ietf_mpa_frame mpa_frame;
287 u8 mpa_frame_buf[NES_CM_DEFAULT_MTU]; 290 u8 mpa_frame_buf[MAX_CM_BUFFER];
288 }; 291 };
289 u16 mpa_frame_size; 292 u16 mpa_frame_size;
290 struct iw_cm_id *cm_id; 293 struct iw_cm_id *cm_id;
@@ -326,6 +329,7 @@ enum nes_cm_event_type {
326 NES_CM_EVENT_MPA_REQ, 329 NES_CM_EVENT_MPA_REQ,
327 NES_CM_EVENT_MPA_CONNECT, 330 NES_CM_EVENT_MPA_CONNECT,
328 NES_CM_EVENT_MPA_ACCEPT, 331 NES_CM_EVENT_MPA_ACCEPT,
332 NES_CM_EVENT_MPA_REJECT,
329 NES_CM_EVENT_MPA_ESTABLISHED, 333 NES_CM_EVENT_MPA_ESTABLISHED,
330 NES_CM_EVENT_CONNECTED, 334 NES_CM_EVENT_CONNECTED,
331 NES_CM_EVENT_CLOSED, 335 NES_CM_EVENT_CLOSED,