[ewg] [PATCH] RDMA/nes: change state to closing after FIN

Faisal Latif faisal.latif at intel.com
Sat Aug 14 14:05:18 PDT 2010


When driver receives an AE for FIN receive indication, it closes the connection
without changing the state of the connection in the hardware to closing. By
changing the state to closing, hardware will do normal close sequence.

Signed-off-by: Faisal Latif <faisal.latif at intel.com>
---
 kernel_patches/fixes/nes_0042_fin.patch |   36 +++++++++++++++++++++++++++++++
 1 files changed, 36 insertions(+), 0 deletions(-)
 create mode 100644 kernel_patches/fixes/nes_0042_fin.patch

diff --git a/kernel_patches/fixes/nes_0042_fin.patch b/kernel_patches/fixes/nes_0042_fin.patch
new file mode 100644
index 0000000..96a20ba
--- /dev/null
+++ b/kernel_patches/fixes/nes_0042_fin.patch
@@ -0,0 +1,36 @@
+diff --git a/drivers/infiniband/hw/nes/nes_hw.c b/drivers/infiniband/hw/nes/nes_hw.c
+index 6b034f0..c4adf70 100644
+--- a/drivers/infiniband/hw/nes/nes_hw.c
++++ b/drivers/infiniband/hw/nes/nes_hw.c
+@@ -3468,8 +3468,19 @@ static void nes_process_iwarp_aeqe(struct nes_device *nesdev,
+ 		case NES_AEQE_AEID_LLP_FIN_RECEIVED:
+ 			if (nesqp->term_flags)
+ 				return; /* Ignore it, wait for close complete */
+-
+ 			if (atomic_inc_return(&nesqp->close_timer_started) == 1) {
++				if ((tcp_state == NES_AEQE_TCP_STATE_CLOSE_WAIT) &&
++					(nesqp->ibqp_state == IB_QPS_RTS)) {
++					spin_lock_irqsave(&nesqp->lock, flags);
++					nesqp->hw_iwarp_state = iwarp_state;
++					nesqp->hw_tcp_state = tcp_state;
++					nesqp->last_aeq = async_event_id;
++					next_iwarp_state = NES_CQP_QP_IWARP_STATE_CLOSING;
++					nesqp->hw_iwarp_state = NES_AEQE_IWARP_STATE_CLOSING;
++					spin_unlock_irqrestore(&nesqp->lock, flags);
++					nes_hw_modify_qp(nesdev, nesqp, next_iwarp_state, 0, 0);
++					nes_cm_disconn(nesqp);
++				}
+ 				nesqp->cm_id->add_ref(nesqp->cm_id);
+ 				schedule_nes_timer(nesqp->cm_node, (struct sk_buff *)nesqp,
+ 						NES_TIMER_TYPE_CLOSE, 1, 0);
+@@ -3479,7 +3490,6 @@ static void nes_process_iwarp_aeqe(struct nes_device *nesdev,
+ 						nesqp->hwqp.qp_id, atomic_read(&nesqp->refcount),
+ 						async_event_id, nesqp->last_aeq, tcp_state);
+ 			}
+-
+ 			break;
+ 		case NES_AEQE_AEID_LLP_CLOSE_COMPLETE:
+ 			if (nesqp->term_flags) {
+--
+1.6.0
+
-- 
1.6.0




More information about the ewg mailing list