Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 9d5ab133 authored by Faisal Latif's avatar Faisal Latif Committed by Roland Dreier
Browse files

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: default avatarFaisal Latif <faisal.latif@intel.com>
Signed-off-by: default avatarRoland Dreier <rolandd@cisco.com>
parent 0145f341
Loading
Loading
Loading
Loading
+392 −188

File changed.

Preview size limit exceeded, changes collapsed.

+7 −3
Original line number Diff line number Diff line
@@ -39,6 +39,9 @@
#define NES_MANAGE_APBVT_DEL 0
#define NES_MANAGE_APBVT_ADD 1

#define NES_MPA_REQUEST_ACCEPT  1
#define NES_MPA_REQUEST_REJECT  2

/* IETF MPA -- defines, enums, structs */
#define IEFT_MPA_KEY_REQ  "MPA ID Req Frame"
#define IEFT_MPA_KEY_REP  "MPA ID Rep Frame"
@@ -186,6 +189,7 @@ enum nes_cm_node_state {
	NES_CM_STATE_ACCEPTING,
	NES_CM_STATE_MPAREQ_SENT,
	NES_CM_STATE_MPAREQ_RCVD,
	NES_CM_STATE_MPAREJ_RCVD,
	NES_CM_STATE_TSA,
	NES_CM_STATE_FIN_WAIT1,
	NES_CM_STATE_FIN_WAIT2,
@@ -278,13 +282,12 @@ struct nes_cm_node {
	struct nes_timer_entry	*send_entry;

	spinlock_t                retrans_list_lock;
	struct list_head          recv_list;
	spinlock_t                recv_list_lock;
	struct nes_timer_entry  *recv_entry;

	int                       send_write0;
	union {
		struct ietf_mpa_frame mpa_frame;
		u8                    mpa_frame_buf[NES_CM_DEFAULT_MTU];
		u8                    mpa_frame_buf[MAX_CM_BUFFER];
	};
	u16                       mpa_frame_size;
	struct iw_cm_id           *cm_id;
@@ -326,6 +329,7 @@ enum nes_cm_event_type {
	NES_CM_EVENT_MPA_REQ,
	NES_CM_EVENT_MPA_CONNECT,
	NES_CM_EVENT_MPA_ACCEPT,
	NES_CM_EVENT_MPA_REJECT,
	NES_CM_EVENT_MPA_ESTABLISHED,
	NES_CM_EVENT_CONNECTED,
	NES_CM_EVENT_CLOSED,