Lines Matching refs:nesqp

105 static int nes_disconnect(struct nes_qp *nesqp, int abrupt);
529 struct nes_qp *nesqp; in handle_recv_entry() local
534 nesqp = (struct nes_qp *)recv_entry->skb; in handle_recv_entry()
535 if (nesqp) { in handle_recv_entry()
536 spin_lock_irqsave(&nesqp->lock, qplockflags); in handle_recv_entry()
537 if (nesqp->cm_id) { in handle_recv_entry()
541 "to do!!!\n", nesqp->hwqp.qp_id, cm_id, in handle_recv_entry()
542 atomic_read(&nesqp->refcount)); in handle_recv_entry()
543 nesqp->hw_tcp_state = NES_AEQE_TCP_STATE_CLOSED; in handle_recv_entry()
544 nesqp->last_aeq = NES_AEQE_AEID_RESET_SENT; in handle_recv_entry()
545 nesqp->ibqp_state = IB_QPS_ERR; in handle_recv_entry()
546 spin_unlock_irqrestore(&nesqp->lock, qplockflags); in handle_recv_entry()
547 nes_cm_disconn(nesqp); in handle_recv_entry()
549 spin_unlock_irqrestore(&nesqp->lock, qplockflags); in handle_recv_entry()
553 "to do!!!\n", nesqp->hwqp.qp_id, cm_id, in handle_recv_entry()
554 atomic_read(&nesqp->refcount)); in handle_recv_entry()
1266 struct nes_qp *nesqp; in rem_ref_cm_node() local
1302 nesqp = cm_node->nesqp; in rem_ref_cm_node()
1303 if (nesqp) { in rem_ref_cm_node()
1304 nesqp->cm_node = NULL; in rem_ref_cm_node()
1305 nes_rem_ref(&nesqp->ibqp); in rem_ref_cm_node()
1306 cm_node->nesqp = NULL; in rem_ref_cm_node()
2453 static int nes_cm_init_tsa_conn(struct nes_qp *nesqp, struct nes_cm_node *cm_node) in nes_cm_init_tsa_conn() argument
2457 if (!nesqp) in nes_cm_init_tsa_conn()
2460 nesqp->nesqp_context->misc |= cpu_to_le32(NES_QPCONTEXT_MISC_IPV4 | in nes_cm_init_tsa_conn()
2465 nesqp->nesqp_context->misc |= cpu_to_le32(NES_QPCONTEXT_MISC_WSCALE); in nes_cm_init_tsa_conn()
2467 nesqp->nesqp_context->misc2 |= cpu_to_le32(64 << NES_QPCONTEXT_MISC2_TTL_SHIFT); in nes_cm_init_tsa_conn()
2469 nesqp->nesqp_context->mss |= cpu_to_le32(((u32)cm_node->tcp_cntxt.mss) << 16); in nes_cm_init_tsa_conn()
2471 nesqp->nesqp_context->tcp_state_flow_label |= cpu_to_le32( in nes_cm_init_tsa_conn()
2474 nesqp->nesqp_context->pd_index_wscale |= cpu_to_le32( in nes_cm_init_tsa_conn()
2478 nesqp->nesqp_context->pd_index_wscale |= cpu_to_le32( in nes_cm_init_tsa_conn()
2482 nesqp->nesqp_context->keepalive = cpu_to_le32(0x80); in nes_cm_init_tsa_conn()
2483 nesqp->nesqp_context->ts_recent = 0; in nes_cm_init_tsa_conn()
2484 nesqp->nesqp_context->ts_age = 0; in nes_cm_init_tsa_conn()
2485 nesqp->nesqp_context->snd_nxt = cpu_to_le32(cm_node->tcp_cntxt.loc_seq_num); in nes_cm_init_tsa_conn()
2486 nesqp->nesqp_context->snd_wnd = cpu_to_le32(cm_node->tcp_cntxt.snd_wnd); in nes_cm_init_tsa_conn()
2487 nesqp->nesqp_context->rcv_nxt = cpu_to_le32(cm_node->tcp_cntxt.rcv_nxt); in nes_cm_init_tsa_conn()
2488 nesqp->nesqp_context->rcv_wnd = cpu_to_le32(cm_node->tcp_cntxt.rcv_wnd << in nes_cm_init_tsa_conn()
2490 nesqp->nesqp_context->snd_max = cpu_to_le32(cm_node->tcp_cntxt.loc_seq_num); in nes_cm_init_tsa_conn()
2491 nesqp->nesqp_context->snd_una = cpu_to_le32(cm_node->tcp_cntxt.loc_seq_num); in nes_cm_init_tsa_conn()
2492 nesqp->nesqp_context->srtt = 0; in nes_cm_init_tsa_conn()
2493 nesqp->nesqp_context->rttvar = cpu_to_le32(0x6); in nes_cm_init_tsa_conn()
2494 nesqp->nesqp_context->ssthresh = cpu_to_le32(0x3FFFC000); in nes_cm_init_tsa_conn()
2495 nesqp->nesqp_context->cwnd = cpu_to_le32(2*cm_node->tcp_cntxt.mss); in nes_cm_init_tsa_conn()
2496 nesqp->nesqp_context->snd_wl1 = cpu_to_le32(cm_node->tcp_cntxt.rcv_nxt); in nes_cm_init_tsa_conn()
2497 nesqp->nesqp_context->snd_wl2 = cpu_to_le32(cm_node->tcp_cntxt.loc_seq_num); in nes_cm_init_tsa_conn()
2498 nesqp->nesqp_context->max_snd_wnd = cpu_to_le32(cm_node->tcp_cntxt.max_snd_wnd); in nes_cm_init_tsa_conn()
2502 nesqp->hwqp.qp_id, le32_to_cpu(nesqp->nesqp_context->rcv_nxt), in nes_cm_init_tsa_conn()
2503 le32_to_cpu(nesqp->nesqp_context->snd_nxt), in nes_cm_init_tsa_conn()
2504 cm_node->tcp_cntxt.mss, le32_to_cpu(nesqp->nesqp_context->pd_index_wscale), in nes_cm_init_tsa_conn()
2505 le32_to_cpu(nesqp->nesqp_context->rcv_wnd), in nes_cm_init_tsa_conn()
2506 le32_to_cpu(nesqp->nesqp_context->misc)); in nes_cm_init_tsa_conn()
2507 nes_debug(NES_DBG_CM, " snd_wnd = 0x%08X.\n", le32_to_cpu(nesqp->nesqp_context->snd_wnd)); in nes_cm_init_tsa_conn()
2508 nes_debug(NES_DBG_CM, " snd_cwnd = 0x%08X.\n", le32_to_cpu(nesqp->nesqp_context->cwnd)); in nes_cm_init_tsa_conn()
2509 nes_debug(NES_DBG_CM, " max_swnd = 0x%08X.\n", le32_to_cpu(nesqp->nesqp_context->max_snd_wnd)); in nes_cm_init_tsa_conn()
2521 int nes_cm_disconn(struct nes_qp *nesqp) in nes_cm_disconn() argument
2529 nes_add_ref(&nesqp->ibqp); in nes_cm_disconn()
2530 work->nesqp = nesqp; in nes_cm_disconn()
2543 struct nes_qp *nesqp = dwork->nesqp; in nes_disconnect_worker() local
2547 nesqp->last_aeq, nesqp->hwqp.qp_id); in nes_disconnect_worker()
2548 nes_cm_disconn_true(nesqp); in nes_disconnect_worker()
2549 nes_rem_ref(&nesqp->ibqp); in nes_disconnect_worker()
2556 static int nes_cm_disconn_true(struct nes_qp *nesqp) in nes_cm_disconn_true() argument
2573 if (!nesqp) { in nes_cm_disconn_true()
2578 spin_lock_irqsave(&nesqp->lock, flags); in nes_cm_disconn_true()
2579 cm_id = nesqp->cm_id; in nes_cm_disconn_true()
2583 nesqp->hwqp.qp_id); in nes_cm_disconn_true()
2584 spin_unlock_irqrestore(&nesqp->lock, flags); in nes_cm_disconn_true()
2588 nesvnic = to_nesvnic(nesqp->ibqp.device); in nes_cm_disconn_true()
2589 nes_debug(NES_DBG_CM, "Disconnecting QP%u\n", nesqp->hwqp.qp_id); in nes_cm_disconn_true()
2591 original_hw_tcp_state = nesqp->hw_tcp_state; in nes_cm_disconn_true()
2592 original_ibqp_state = nesqp->ibqp_state; in nes_cm_disconn_true()
2593 last_ae = nesqp->last_aeq; in nes_cm_disconn_true()
2595 if (nesqp->term_flags) { in nes_cm_disconn_true()
2598 nesqp->cm_id = NULL; in nes_cm_disconn_true()
2599 if (nesqp->flush_issued == 0) { in nes_cm_disconn_true()
2600 nesqp->flush_issued = 1; in nes_cm_disconn_true()
2616 nesqp->cm_id = NULL; in nes_cm_disconn_true()
2617 if (nesqp->flush_issued == 0) { in nes_cm_disconn_true()
2618 nesqp->flush_issued = 1; in nes_cm_disconn_true()
2623 spin_unlock_irqrestore(&nesqp->lock, flags); in nes_cm_disconn_true()
2625 if ((issue_flush) && (nesqp->destroyed == 0)) { in nes_cm_disconn_true()
2627 if (nesqp->hw_iwarp_state >= NES_AEQE_IWARP_STATE_TERMINATE) in nes_cm_disconn_true()
2629 flush_wqes(nesvnic->nesdev, nesqp, flush_q, 1); in nes_cm_disconn_true()
2631 if (nesqp->term_flags) { in nes_cm_disconn_true()
2632 ibevent.device = nesqp->ibqp.device; in nes_cm_disconn_true()
2633 ibevent.event = nesqp->terminate_eventtype; in nes_cm_disconn_true()
2634 ibevent.element.qp = &nesqp->ibqp; in nes_cm_disconn_true()
2635 nesqp->ibqp.event_handler(&ibevent, nesqp->ibqp.qp_context); in nes_cm_disconn_true()
2652 nesqp->hwqp.qp_id, nesqp->hwqp.sq_head, in nes_cm_disconn_true()
2653 nesqp->hwqp.sq_tail, cm_id, in nes_cm_disconn_true()
2654 atomic_read(&nesqp->refcount)); in nes_cm_disconn_true()
2664 nes_disconnect(nesqp, 1); in nes_cm_disconn_true()
2666 cm_id->provider_data = nesqp; in nes_cm_disconn_true()
2692 static int nes_disconnect(struct nes_qp *nesqp, int abrupt) in nes_disconnect() argument
2699 nesvnic = to_nesvnic(nesqp->ibqp.device); in nes_disconnect()
2709 if (nesqp->active_conn) { in nes_disconnect()
2712 nesqp->active_conn = 0; in nes_disconnect()
2715 if (nesqp->ietf_frame) { in nes_disconnect()
2716 if (nesqp->lsmm_mr) in nes_disconnect()
2717 nesibdev->ibdev.dereg_mr(nesqp->lsmm_mr); in nes_disconnect()
2719 nesqp->private_data_len+sizeof(struct ietf_mpa_frame), in nes_disconnect()
2720 nesqp->ietf_frame, nesqp->ietf_frame_pbase); in nes_disconnect()
2725 if (nesqp->cm_node) { in nes_disconnect()
2728 g_cm_core->api->close(g_cm_core, nesqp->cm_node); in nes_disconnect()
2742 struct nes_qp *nesqp; in nes_accept() local
2765 nesqp = to_nesqp(ibqp); in nes_accept()
2766 nesvnic = to_nesvnic(nesqp->ibqp.device); in nes_accept()
2789 nesqp->cm_node = (void *)cm_node; in nes_accept()
2790 cm_node->nesqp = nesqp; in nes_accept()
2793 nesqp->hwqp.qp_id, cm_node, jiffies, cm_node->listener); in nes_accept()
2800 nesqp->ietf_frame = pci_alloc_consistent(nesdev->pcidev, in nes_accept()
2802 &nesqp->ietf_frame_pbase); in nes_accept()
2804 if (!nesqp->ietf_frame) { in nes_accept()
2812 nesqp->private_data_len = conn_param->private_data_len; in nes_accept()
2813 memcpy(nesqp->ietf_frame->key, IEFT_MPA_KEY_REP, IETF_MPA_KEY_SIZE); in nes_accept()
2815 memcpy(nesqp->ietf_frame->priv_data, conn_param->private_data, in nes_accept()
2818 nesqp->ietf_frame->priv_data_len = in nes_accept()
2820 nesqp->ietf_frame->rev = mpa_version; in nes_accept()
2821 nesqp->ietf_frame->flags = IETF_MPA_FLAGS_CRC; in nes_accept()
2824 wqe = &nesqp->hwqp.sq_vbase[0]; in nes_accept()
2828 u64temp = (unsigned long)nesqp; in nes_accept()
2830 nespd = nesqp->nespd; in nes_accept()
2831 ibphysbuf.addr = nesqp->ietf_frame_pbase; in nes_accept()
2834 tagged_offset = (u64)(unsigned long)nesqp->ietf_frame; in nes_accept()
2844 nesqp->private_data_len+sizeof(struct ietf_mpa_frame), in nes_accept()
2845 nesqp->ietf_frame, nesqp->ietf_frame_pbase); in nes_accept()
2851 nesqp->lsmm_mr = ibmr; in nes_accept()
2865 (u64)(unsigned long)nesqp->ietf_frame); in nes_accept()
2870 if (nesqp->sq_kmapped) { in nes_accept()
2871 nesqp->sq_kmapped = 0; in nes_accept()
2872 kunmap(nesqp->page); in nes_accept()
2875 nesqp->nesqp_context->ird_ord_sizes |= in nes_accept()
2879 nesqp->nesqp_context->ird_ord_sizes |= in nes_accept()
2882 nesqp->skip_lsmm = 1; in nes_accept()
2886 nesqp->cm_id = cm_id; in nes_accept()
2890 cm_id->provider_data = nesqp; in nes_accept()
2891 nesqp->active_conn = 0; in nes_accept()
2897 nes_cm_init_tsa_conn(nesqp, cm_node); in nes_accept()
2899 nesqp->nesqp_context->tcpPorts[0] = in nes_accept()
2901 nesqp->nesqp_context->tcpPorts[1] = in nes_accept()
2905 nesqp->nesqp_context->ip0 = in nes_accept()
2908 nesqp->nesqp_context->ip0 = in nes_accept()
2911 nesqp->nesqp_context->misc2 |= cpu_to_le32( in nes_accept()
2915 nesqp->nesqp_context->arp_index_vlan |= in nes_accept()
2917 le32_to_cpu(nesqp->nesqp_context->ip0), NULL, in nes_accept()
2920 nesqp->nesqp_context->ts_val_delta = cpu_to_le32( in nes_accept()
2923 nesqp->nesqp_context->ird_index = cpu_to_le32(nesqp->hwqp.qp_id); in nes_accept()
2925 nesqp->nesqp_context->ird_ord_sizes |= cpu_to_le32( in nes_accept()
2927 nesqp->nesqp_context->ird_ord_sizes |= in nes_accept()
2942 nesqp->hte_index = cpu_to_be32(crc_value ^ 0xffffffff); in nes_accept()
2944 nesqp->hte_index, nesqp->hte_index & adapter->hte_index_mask); in nes_accept()
2946 nesqp->hte_index &= adapter->hte_index_mask; in nes_accept()
2947 nesqp->nesqp_context->hte_index = cpu_to_le32(nesqp->hte_index); in nes_accept()
2953 "private data length=%zu.\n", nesqp->hwqp.qp_id, in nes_accept()
2958 le32_to_cpu(nesqp->nesqp_context->rcv_nxt), in nes_accept()
2959 le32_to_cpu(nesqp->nesqp_context->snd_nxt), in nes_accept()
2966 nes_add_ref(&nesqp->ibqp); in nes_accept()
2970 cm_event.provider_data = (void *)nesqp; in nes_accept()
2977 nes_modify_qp(&nesqp->ibqp, &attr, IB_QP_STATE, NULL); in nes_accept()
2980 nesqp->private_data_len; in nes_accept()
2983 nesqp->ietf_frame->priv_data, nesqp->private_data_len); in nes_accept()
3039 struct nes_qp *nesqp; in nes_connect() local
3049 nesqp = to_nesqp(ibqp); in nes_connect()
3050 if (!nesqp) in nes_connect()
3052 nesvnic = to_nesvnic(nesqp->ibqp.device); in nes_connect()
3063 "0x%08X:0x%04X, local = 0x%08X:0x%04X.\n", nesqp->hwqp.qp_id, in nes_connect()
3071 nesqp->active_conn = 1; in nes_connect()
3074 nesqp->cm_id = cm_id; in nes_connect()
3076 cm_id->provider_data = nesqp; in nes_connect()
3078 nesqp->private_data_len = conn_param->private_data_len; in nes_connect()
3079 nesqp->nesqp_context->ird_ord_sizes |= cpu_to_le32((u32)conn_param->ord); in nes_connect()
3116 nesqp->cm_node = cm_node; in nes_connect()
3117 cm_node->nesqp = nesqp; in nes_connect()
3118 nes_add_ref(&nesqp->ibqp); in nes_connect()
3256 struct nes_qp *nesqp; in cm_event_connected() local
3273 nesqp = (struct nes_qp *)cm_id->provider_data; in cm_event_connected()
3274 nesvnic = to_nesvnic(nesqp->ibqp.device); in cm_event_connected()
3278 if (nesqp->destroyed) { in cm_event_connected()
3284 nesqp->hwqp.qp_id, in cm_event_connected()
3290 nes_cm_init_tsa_conn(nesqp, cm_node); in cm_event_connected()
3293 nesqp->nesqp_context->tcpPorts[0] = in cm_event_connected()
3295 nesqp->nesqp_context->tcpPorts[1] = in cm_event_connected()
3298 nesqp->nesqp_context->ip0 = in cm_event_connected()
3301 nesqp->nesqp_context->ip0 = in cm_event_connected()
3304 nesqp->nesqp_context->misc2 |= cpu_to_le32( in cm_event_connected()
3307 nesqp->nesqp_context->arp_index_vlan |= cpu_to_le32( in cm_event_connected()
3309 le32_to_cpu(nesqp->nesqp_context->ip0), in cm_event_connected()
3311 nesqp->nesqp_context->ts_val_delta = cpu_to_le32( in cm_event_connected()
3313 nesqp->nesqp_context->ird_index = cpu_to_le32(nesqp->hwqp.qp_id); in cm_event_connected()
3314 nesqp->nesqp_context->ird_ord_sizes |= in cm_event_connected()
3319 nesqp->hwqp.sq_tail = 1; in cm_event_connected()
3324 wqe = &nesqp->hwqp.sq_vbase[0]; in cm_event_connected()
3325 u64temp = (unsigned long)nesqp; in cm_event_connected()
3337 if (nesqp->sq_kmapped) { in cm_event_connected()
3338 nesqp->sq_kmapped = 0; in cm_event_connected()
3339 kunmap(nesqp->page); in cm_event_connected()
3343 nesqp->nesqp_context->ird_ord_sizes &= in cm_event_connected()
3347 nesqp->skip_lsmm = 1; in cm_event_connected()
3348 nesqp->hwqp.sq_tail = 0; in cm_event_connected()
3350 (1 << 24) | 0x00800000 | nesqp->hwqp.qp_id); in cm_event_connected()
3367 nesqp->hte_index = cpu_to_be32(crc_value ^ 0xffffffff); in cm_event_connected()
3369 nesqp->hte_index, nesqp->hte_index & nesadapter->hte_index_mask); in cm_event_connected()
3371 nesqp->hte_index &= nesadapter->hte_index_mask; in cm_event_connected()
3372 nesqp->nesqp_context->hte_index = cpu_to_le32(nesqp->hte_index); in cm_event_connected()
3374 nesqp->ietf_frame = &cm_node->mpa_frame; in cm_event_connected()
3375 nesqp->private_data_len = (u8) cm_node->mpa_frame_size; in cm_event_connected()
3397 nes_modify_qp(&nesqp->ibqp, &attr, IB_QP_STATE, NULL); in cm_event_connected()
3400 "%lu\n", nesqp->hwqp.qp_id, jiffies); in cm_event_connected()
3411 struct nes_qp *nesqp; in cm_event_connect_error() local
3426 nesqp = cm_id->provider_data; in cm_event_connect_error()
3428 if (!nesqp) { in cm_event_connect_error()
3434 nesqp->cm_id = NULL; in cm_event_connect_error()
3465 struct nes_qp *nesqp; in cm_event_reset() local
3480 nesqp = cm_id->provider_data; in cm_event_reset()
3481 if (!nesqp) in cm_event_reset()
3484 nesqp->cm_id = NULL; in cm_event_reset()