Lines Matching refs:nesqp

79 static void nes_terminate_start_timer(struct nes_qp *nesqp);
3117 static u32 iwarp_opcode(struct nes_qp *nesqp, u32 aeq_info) in iwarp_opcode() argument
3124 pkt = nesqp->hwqp.q2_vbase + BAD_FRAME_OFFSET; in iwarp_opcode()
3133 static int nes_bld_terminate_hdr(struct nes_qp *nesqp, u16 async_event_id, u32 aeq_info) in nes_bld_terminate_hdr() argument
3135 u8 *pkt = nesqp->hwqp.q2_vbase + BAD_FRAME_OFFSET; in nes_bld_terminate_hdr()
3142 termhdr = (struct nes_terminate_hdr *)nesqp->hwqp.q2_vbase; in nes_bld_terminate_hdr()
3177 switch (iwarp_opcode(nesqp, aeq_info)) { in nes_bld_terminate_hdr()
3201 switch (iwarp_opcode(nesqp, aeq_info)) { in nes_bld_terminate_hdr()
3238 switch (iwarp_opcode(nesqp, aeq_info)) { in nes_bld_terminate_hdr()
3336 nesqp->term_sq_flush_code = flush_code; in nes_bld_terminate_hdr()
3338 nesqp->term_rq_flush_code = flush_code; in nes_bld_terminate_hdr()
3344 static void nes_terminate_connection(struct nes_device *nesdev, struct nes_qp *nesqp, in nes_terminate_connection() argument
3358 if (nesqp->term_flags & NES_TERM_SENT) in nes_terminate_connection()
3373 nesqp = (struct nes_qp *)(unsigned long)context; in nes_terminate_connection()
3374 spin_lock_irqsave(&nesqp->lock, flags); in nes_terminate_connection()
3375 nesqp->hw_iwarp_state = iwarp_state; in nes_terminate_connection()
3376 nesqp->hw_tcp_state = tcp_state; in nes_terminate_connection()
3377 nesqp->last_aeq = async_event_id; in nes_terminate_connection()
3378 nesqp->terminate_eventtype = eventtype; in nes_terminate_connection()
3379 spin_unlock_irqrestore(&nesqp->lock, flags); in nes_terminate_connection()
3382 termlen = nes_bld_terminate_hdr(nesqp, async_event_id, aeq_info); in nes_terminate_connection()
3387 nesqp->term_flags = NES_TERM_DONE; in nes_terminate_connection()
3388 nes_hw_modify_qp(nesdev, nesqp, NES_CQP_QP_IWARP_STATE_ERROR, 0, 0); in nes_terminate_connection()
3389 nes_cm_disconn(nesqp); in nes_terminate_connection()
3391 nes_terminate_start_timer(nesqp); in nes_terminate_connection()
3392 nesqp->term_flags |= NES_TERM_SENT; in nes_terminate_connection()
3393 nes_hw_modify_qp(nesdev, nesqp, mod_qp_flags, termlen, 0); in nes_terminate_connection()
3398 struct nes_qp *nesqp, struct nes_hw_aeqe *aeqe) in nes_terminate_send_fin() argument
3411 spin_lock_irqsave(&nesqp->lock, flags); in nes_terminate_send_fin()
3412 nesqp->hw_iwarp_state = iwarp_state; in nes_terminate_send_fin()
3413 nesqp->hw_tcp_state = tcp_state; in nes_terminate_send_fin()
3414 nesqp->last_aeq = async_event_id; in nes_terminate_send_fin()
3415 spin_unlock_irqrestore(&nesqp->lock, flags); in nes_terminate_send_fin()
3418 nes_hw_modify_qp(nesdev, nesqp, NES_CQP_QP_IWARP_STATE_TERMINATE | in nes_terminate_send_fin()
3423 static void nes_terminate_done(struct nes_qp *nesqp, int timeout_occurred) in nes_terminate_done() argument
3427 struct nes_vnic *nesvnic = to_nesvnic(nesqp->ibqp.device); in nes_terminate_done()
3431 spin_lock_irqsave(&nesqp->lock, flags); in nes_terminate_done()
3432 if (nesqp->hte_added) { in nes_terminate_done()
3433 nesqp->hte_added = 0; in nes_terminate_done()
3437 first_time = (nesqp->term_flags & NES_TERM_DONE) == 0; in nes_terminate_done()
3438 nesqp->term_flags |= NES_TERM_DONE; in nes_terminate_done()
3439 spin_unlock_irqrestore(&nesqp->lock, flags); in nes_terminate_done()
3444 del_timer(&nesqp->terminate_timer); in nes_terminate_done()
3448 nes_hw_modify_qp(nesdev, nesqp, next_iwarp_state, 0, 0); in nes_terminate_done()
3449 nes_cm_disconn(nesqp); in nes_terminate_done()
3454 struct nes_qp *nesqp, struct nes_hw_aeqe *aeqe) in nes_terminate_received() argument
3467 pkt = nesqp->hwqp.q2_vbase + BAD_FRAME_OFFSET; in nes_terminate_received()
3488 nes_terminate_connection(nesdev, nesqp, aeqe, IB_EVENT_QP_FATAL); in nes_terminate_received()
3493 nesqp->term_flags |= NES_TERM_RCVD; in nes_terminate_received()
3494 nesqp->terminate_eventtype = IB_EVENT_QP_FATAL; in nes_terminate_received()
3495 nes_terminate_start_timer(nesqp); in nes_terminate_received()
3496 nes_terminate_send_fin(nesdev, nesqp, aeqe); in nes_terminate_received()
3502 struct nes_qp *nesqp = (struct nes_qp *)(unsigned long)context; in nes_terminate_timeout() local
3504 nes_terminate_done(nesqp, 1); in nes_terminate_timeout()
3508 static void nes_terminate_start_timer(struct nes_qp *nesqp) in nes_terminate_start_timer() argument
3510 init_timer(&nesqp->terminate_timer); in nes_terminate_start_timer()
3511 nesqp->terminate_timer.function = nes_terminate_timeout; in nes_terminate_start_timer()
3512 nesqp->terminate_timer.expires = jiffies + HZ; in nes_terminate_start_timer()
3513 nesqp->terminate_timer.data = (unsigned long)nesqp; in nes_terminate_start_timer()
3514 add_timer(&nesqp->terminate_timer); in nes_terminate_start_timer()
3525 struct nes_qp *nesqp; in nes_process_iwarp_aeqe() local
3550 nesqp = (struct nes_qp *)(unsigned long)context; in nes_process_iwarp_aeqe()
3564 (atomic_read(&nesqp->close_timer_started))) in nes_process_iwarp_aeqe()
3570 if (nesqp->term_flags) in nes_process_iwarp_aeqe()
3573 if (atomic_inc_return(&nesqp->close_timer_started) == 1) { in nes_process_iwarp_aeqe()
3575 (nesqp->ibqp_state == IB_QPS_RTS) && in nes_process_iwarp_aeqe()
3577 spin_lock_irqsave(&nesqp->lock, flags); in nes_process_iwarp_aeqe()
3578 nesqp->hw_iwarp_state = iwarp_state; in nes_process_iwarp_aeqe()
3579 nesqp->hw_tcp_state = tcp_state; in nes_process_iwarp_aeqe()
3580 nesqp->last_aeq = async_event_id; in nes_process_iwarp_aeqe()
3582 nesqp->hw_iwarp_state = NES_AEQE_IWARP_STATE_CLOSING; in nes_process_iwarp_aeqe()
3583 spin_unlock_irqrestore(&nesqp->lock, flags); in nes_process_iwarp_aeqe()
3584 nes_hw_modify_qp(nesdev, nesqp, next_iwarp_state, 0, 0); in nes_process_iwarp_aeqe()
3585 nes_cm_disconn(nesqp); in nes_process_iwarp_aeqe()
3587 nesqp->cm_id->add_ref(nesqp->cm_id); in nes_process_iwarp_aeqe()
3588 schedule_nes_timer(nesqp->cm_node, (struct sk_buff *)nesqp, in nes_process_iwarp_aeqe()
3593 nesqp->hwqp.qp_id, atomic_read(&nesqp->refcount), in nes_process_iwarp_aeqe()
3594 async_event_id, nesqp->last_aeq, tcp_state); in nes_process_iwarp_aeqe()
3598 if (nesqp->term_flags) { in nes_process_iwarp_aeqe()
3599 nes_terminate_done(nesqp, 0); in nes_process_iwarp_aeqe()
3602 spin_lock_irqsave(&nesqp->lock, flags); in nes_process_iwarp_aeqe()
3603 nesqp->hw_iwarp_state = NES_AEQE_IWARP_STATE_CLOSING; in nes_process_iwarp_aeqe()
3604 spin_unlock_irqrestore(&nesqp->lock, flags); in nes_process_iwarp_aeqe()
3605 nes_hw_modify_qp(nesdev, nesqp, NES_CQP_QP_IWARP_STATE_CLOSING, 0, 0); in nes_process_iwarp_aeqe()
3606 nes_cm_disconn(nesqp); in nes_process_iwarp_aeqe()
3611 spin_lock_irqsave(&nesqp->lock, flags); in nes_process_iwarp_aeqe()
3612 nesqp->hw_iwarp_state = iwarp_state; in nes_process_iwarp_aeqe()
3613 nesqp->hw_tcp_state = tcp_state; in nes_process_iwarp_aeqe()
3614 nesqp->last_aeq = async_event_id; in nes_process_iwarp_aeqe()
3615 nesqp->hte_added = 0; in nes_process_iwarp_aeqe()
3616 spin_unlock_irqrestore(&nesqp->lock, flags); in nes_process_iwarp_aeqe()
3618 nes_hw_modify_qp(nesdev, nesqp, next_iwarp_state, 0, 0); in nes_process_iwarp_aeqe()
3619 nes_cm_disconn(nesqp); in nes_process_iwarp_aeqe()
3623 if (atomic_read(&nesqp->close_timer_started)) 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 spin_unlock_irqrestore(&nesqp->lock, flags); in nes_process_iwarp_aeqe()
3630 nes_cm_disconn(nesqp); in nes_process_iwarp_aeqe()
3634 nes_terminate_send_fin(nesdev, nesqp, aeqe); in nes_process_iwarp_aeqe()
3638 nes_terminate_received(nesdev, nesqp, aeqe); in nes_process_iwarp_aeqe()
3652 nesqp->hwqp.qp_id, async_event_id); in nes_process_iwarp_aeqe()
3653 nes_terminate_connection(nesdev, nesqp, aeqe, IB_EVENT_QP_ACCESS_ERR); in nes_process_iwarp_aeqe()
3660 if (iwarp_opcode(nesqp, aeq_info) > IWARP_OPCODE_TERM) { in nes_process_iwarp_aeqe()
3702 nesqp->hwqp.qp_id, async_event_id); in nes_process_iwarp_aeqe()
3703 nes_terminate_connection(nesdev, nesqp, aeqe, IB_EVENT_QP_FATAL); in nes_process_iwarp_aeqe()
3865 void flush_wqes(struct nes_device *nesdev, struct nes_qp *nesqp, in flush_wqes() argument
3889 if ((nesqp->term_sq_flush_code) && (which_wq & NES_CQP_FLUSH_SQ)) { in flush_wqes()
3891 sq_code = (CQE_MAJOR_DRV << 16) | nesqp->term_sq_flush_code; in flush_wqes()
3892 nesqp->term_sq_flush_code = 0; in flush_wqes()
3895 if ((nesqp->term_rq_flush_code) && (which_wq & NES_CQP_FLUSH_RQ)) { in flush_wqes()
3897 rq_code = (CQE_MAJOR_DRV << 16) | nesqp->term_rq_flush_code; in flush_wqes()
3898 nesqp->term_rq_flush_code = 0; in flush_wqes()
3908 cqp_wqe->wqe_words[NES_CQP_WQE_ID_IDX] = cpu_to_le32(nesqp->hwqp.qp_id); in flush_wqes()