Lines Matching refs:nesqp
78 static void nes_terminate_start_timer(struct nes_qp *nesqp);
3139 static u32 iwarp_opcode(struct nes_qp *nesqp, u32 aeq_info) in iwarp_opcode() argument
3146 pkt = nesqp->hwqp.q2_vbase + BAD_FRAME_OFFSET; in iwarp_opcode()
3155 static int nes_bld_terminate_hdr(struct nes_qp *nesqp, u16 async_event_id, u32 aeq_info) in nes_bld_terminate_hdr() argument
3157 u8 *pkt = nesqp->hwqp.q2_vbase + BAD_FRAME_OFFSET; in nes_bld_terminate_hdr()
3164 termhdr = (struct nes_terminate_hdr *)nesqp->hwqp.q2_vbase; in nes_bld_terminate_hdr()
3199 switch (iwarp_opcode(nesqp, aeq_info)) { in nes_bld_terminate_hdr()
3223 switch (iwarp_opcode(nesqp, aeq_info)) { in nes_bld_terminate_hdr()
3260 switch (iwarp_opcode(nesqp, aeq_info)) { in nes_bld_terminate_hdr()
3358 nesqp->term_sq_flush_code = flush_code; in nes_bld_terminate_hdr()
3360 nesqp->term_rq_flush_code = flush_code; in nes_bld_terminate_hdr()
3366 static void nes_terminate_connection(struct nes_device *nesdev, struct nes_qp *nesqp, in nes_terminate_connection() argument
3380 if (nesqp->term_flags & NES_TERM_SENT) in nes_terminate_connection()
3395 nesqp = (struct nes_qp *)(unsigned long)context; in nes_terminate_connection()
3396 spin_lock_irqsave(&nesqp->lock, flags); in nes_terminate_connection()
3397 nesqp->hw_iwarp_state = iwarp_state; in nes_terminate_connection()
3398 nesqp->hw_tcp_state = tcp_state; in nes_terminate_connection()
3399 nesqp->last_aeq = async_event_id; in nes_terminate_connection()
3400 nesqp->terminate_eventtype = eventtype; in nes_terminate_connection()
3401 spin_unlock_irqrestore(&nesqp->lock, flags); in nes_terminate_connection()
3404 termlen = nes_bld_terminate_hdr(nesqp, async_event_id, aeq_info); in nes_terminate_connection()
3409 nesqp->term_flags = NES_TERM_DONE; in nes_terminate_connection()
3410 nes_hw_modify_qp(nesdev, nesqp, NES_CQP_QP_IWARP_STATE_ERROR, 0, 0); in nes_terminate_connection()
3411 nes_cm_disconn(nesqp); in nes_terminate_connection()
3413 nes_terminate_start_timer(nesqp); in nes_terminate_connection()
3414 nesqp->term_flags |= NES_TERM_SENT; in nes_terminate_connection()
3415 nes_hw_modify_qp(nesdev, nesqp, mod_qp_flags, termlen, 0); in nes_terminate_connection()
3420 struct nes_qp *nesqp, struct nes_hw_aeqe *aeqe) in nes_terminate_send_fin() argument
3433 spin_lock_irqsave(&nesqp->lock, flags); in nes_terminate_send_fin()
3434 nesqp->hw_iwarp_state = iwarp_state; in nes_terminate_send_fin()
3435 nesqp->hw_tcp_state = tcp_state; in nes_terminate_send_fin()
3436 nesqp->last_aeq = async_event_id; in nes_terminate_send_fin()
3437 spin_unlock_irqrestore(&nesqp->lock, flags); in nes_terminate_send_fin()
3440 nes_hw_modify_qp(nesdev, nesqp, NES_CQP_QP_IWARP_STATE_TERMINATE | in nes_terminate_send_fin()
3445 static void nes_terminate_done(struct nes_qp *nesqp, int timeout_occurred) in nes_terminate_done() argument
3449 struct nes_vnic *nesvnic = to_nesvnic(nesqp->ibqp.device); in nes_terminate_done()
3453 spin_lock_irqsave(&nesqp->lock, flags); in nes_terminate_done()
3454 if (nesqp->hte_added) { in nes_terminate_done()
3455 nesqp->hte_added = 0; in nes_terminate_done()
3459 first_time = (nesqp->term_flags & NES_TERM_DONE) == 0; in nes_terminate_done()
3460 nesqp->term_flags |= NES_TERM_DONE; in nes_terminate_done()
3461 spin_unlock_irqrestore(&nesqp->lock, flags); in nes_terminate_done()
3466 del_timer(&nesqp->terminate_timer); in nes_terminate_done()
3470 nes_hw_modify_qp(nesdev, nesqp, next_iwarp_state, 0, 0); in nes_terminate_done()
3471 nes_cm_disconn(nesqp); in nes_terminate_done()
3476 struct nes_qp *nesqp, struct nes_hw_aeqe *aeqe) in nes_terminate_received() argument
3489 pkt = nesqp->hwqp.q2_vbase + BAD_FRAME_OFFSET; in nes_terminate_received()
3510 nes_terminate_connection(nesdev, nesqp, aeqe, IB_EVENT_QP_FATAL); in nes_terminate_received()
3515 nesqp->term_flags |= NES_TERM_RCVD; in nes_terminate_received()
3516 nesqp->terminate_eventtype = IB_EVENT_QP_FATAL; in nes_terminate_received()
3517 nes_terminate_start_timer(nesqp); in nes_terminate_received()
3518 nes_terminate_send_fin(nesdev, nesqp, aeqe); in nes_terminate_received()
3524 struct nes_qp *nesqp = (struct nes_qp *)(unsigned long)context; in nes_terminate_timeout() local
3526 nes_terminate_done(nesqp, 1); in nes_terminate_timeout()
3530 static void nes_terminate_start_timer(struct nes_qp *nesqp) in nes_terminate_start_timer() argument
3532 mod_timer(&nesqp->terminate_timer, (jiffies + HZ)); in nes_terminate_start_timer()
3543 struct nes_qp *nesqp; in nes_process_iwarp_aeqe() local
3568 nesqp = (struct nes_qp *)(unsigned long)context; in nes_process_iwarp_aeqe()
3588 if (nesqp->term_flags) in nes_process_iwarp_aeqe()
3591 if (atomic_inc_return(&nesqp->close_timer_started) == 1) { in nes_process_iwarp_aeqe()
3593 (nesqp->ibqp_state == IB_QPS_RTS)) { in nes_process_iwarp_aeqe()
3594 spin_lock_irqsave(&nesqp->lock, flags); in nes_process_iwarp_aeqe()
3595 nesqp->hw_iwarp_state = iwarp_state; in nes_process_iwarp_aeqe()
3596 nesqp->hw_tcp_state = tcp_state; in nes_process_iwarp_aeqe()
3597 nesqp->last_aeq = async_event_id; in nes_process_iwarp_aeqe()
3599 nesqp->hw_iwarp_state = NES_AEQE_IWARP_STATE_CLOSING; in nes_process_iwarp_aeqe()
3600 spin_unlock_irqrestore(&nesqp->lock, flags); in nes_process_iwarp_aeqe()
3601 nes_hw_modify_qp(nesdev, nesqp, next_iwarp_state, 0, 0); in nes_process_iwarp_aeqe()
3602 nes_cm_disconn(nesqp); in nes_process_iwarp_aeqe()
3604 nesqp->cm_id->add_ref(nesqp->cm_id); in nes_process_iwarp_aeqe()
3605 schedule_nes_timer(nesqp->cm_node, (struct sk_buff *)nesqp, in nes_process_iwarp_aeqe()
3610 nesqp->hwqp.qp_id, atomic_read(&nesqp->refcount), in nes_process_iwarp_aeqe()
3611 async_event_id, nesqp->last_aeq, tcp_state); in nes_process_iwarp_aeqe()
3615 spin_lock_irqsave(&nesqp->lock, flags); in nes_process_iwarp_aeqe()
3616 nesqp->hw_iwarp_state = iwarp_state; in nes_process_iwarp_aeqe()
3617 nesqp->hw_tcp_state = tcp_state; in nes_process_iwarp_aeqe()
3618 nesqp->last_aeq = async_event_id; in nes_process_iwarp_aeqe()
3619 spin_unlock_irqrestore(&nesqp->lock, flags); in nes_process_iwarp_aeqe()
3620 nes_cm_disconn(nesqp); in nes_process_iwarp_aeqe()
3625 spin_lock_irqsave(&nesqp->lock, flags); in nes_process_iwarp_aeqe()
3626 nesqp->hw_iwarp_state = iwarp_state; in nes_process_iwarp_aeqe()
3627 nesqp->hw_tcp_state = tcp_state; in nes_process_iwarp_aeqe()
3628 nesqp->last_aeq = async_event_id; in nes_process_iwarp_aeqe()
3629 nesqp->hte_added = 0; in nes_process_iwarp_aeqe()
3630 spin_unlock_irqrestore(&nesqp->lock, flags); in nes_process_iwarp_aeqe()
3632 nes_hw_modify_qp(nesdev, nesqp, next_iwarp_state, 0, 0); in nes_process_iwarp_aeqe()
3633 nes_cm_disconn(nesqp); in nes_process_iwarp_aeqe()
3637 if (atomic_read(&nesqp->close_timer_started)) in nes_process_iwarp_aeqe()
3639 spin_lock_irqsave(&nesqp->lock, flags); in nes_process_iwarp_aeqe()
3640 nesqp->hw_iwarp_state = iwarp_state; in nes_process_iwarp_aeqe()
3641 nesqp->hw_tcp_state = tcp_state; in nes_process_iwarp_aeqe()
3642 nesqp->last_aeq = async_event_id; in nes_process_iwarp_aeqe()
3643 spin_unlock_irqrestore(&nesqp->lock, flags); in nes_process_iwarp_aeqe()
3644 nes_cm_disconn(nesqp); in nes_process_iwarp_aeqe()
3648 nes_terminate_send_fin(nesdev, nesqp, aeqe); in nes_process_iwarp_aeqe()
3652 nes_terminate_received(nesdev, nesqp, aeqe); in nes_process_iwarp_aeqe()
3666 nesqp->hwqp.qp_id, async_event_id); in nes_process_iwarp_aeqe()
3667 nes_terminate_connection(nesdev, nesqp, aeqe, IB_EVENT_QP_ACCESS_ERR); in nes_process_iwarp_aeqe()
3674 if (iwarp_opcode(nesqp, aeq_info) > IWARP_OPCODE_TERM) { in nes_process_iwarp_aeqe()
3716 nesqp->hwqp.qp_id, async_event_id); in nes_process_iwarp_aeqe()
3717 print_ip(nesqp->cm_node); in nes_process_iwarp_aeqe()
3718 if (!atomic_read(&nesqp->close_timer_started)) in nes_process_iwarp_aeqe()
3719 nes_terminate_connection(nesdev, nesqp, aeqe, IB_EVENT_QP_FATAL); in nes_process_iwarp_aeqe()
3881 void flush_wqes(struct nes_device *nesdev, struct nes_qp *nesqp, in flush_wqes() argument
3905 if ((nesqp->term_sq_flush_code) && (which_wq & NES_CQP_FLUSH_SQ)) { in flush_wqes()
3907 sq_code = (CQE_MAJOR_DRV << 16) | nesqp->term_sq_flush_code; in flush_wqes()
3908 nesqp->term_sq_flush_code = 0; in flush_wqes()
3911 if ((nesqp->term_rq_flush_code) && (which_wq & NES_CQP_FLUSH_RQ)) { in flush_wqes()
3913 rq_code = (CQE_MAJOR_DRV << 16) | nesqp->term_rq_flush_code; in flush_wqes()
3914 nesqp->term_rq_flush_code = 0; in flush_wqes()
3924 cqp_wqe->wqe_words[NES_CQP_WQE_ID_IDX] = cpu_to_le32(nesqp->hwqp.qp_id); in flush_wqes()