Lines Matching refs:csk
78 struct cxgbi_sock *csk; in cxgbi_device_portmap_cleanup() local
83 csk = pmap->port_csk[i]; in cxgbi_device_portmap_cleanup()
87 csk, cdev); in cxgbi_device_portmap_cleanup()
88 spin_lock_bh(&csk->lock); in cxgbi_device_portmap_cleanup()
89 cxgbi_sock_set_flag(csk, CTPF_OFFLOAD_DOWN); in cxgbi_device_portmap_cleanup()
90 cxgbi_sock_closed(csk); in cxgbi_device_portmap_cleanup()
91 spin_unlock_bh(&csk->lock); in cxgbi_device_portmap_cleanup()
92 cxgbi_sock_put(csk); in cxgbi_device_portmap_cleanup()
316 static int sock_get_port(struct cxgbi_sock *csk) in sock_get_port() argument
318 struct cxgbi_device *cdev = csk->cdev; in sock_get_port()
325 cdev, csk->port_id, cdev->ports[csk->port_id]->name); in sock_get_port()
329 if (csk->saddr.sin_port) { in sock_get_port()
331 ntohs(csk->saddr.sin_port)); in sock_get_port()
339 cdev, csk->port_id, cdev->ports[csk->port_id]->name); in sock_get_port()
349 csk->saddr.sin_port = in sock_get_port()
352 pmap->port_csk[idx] = csk; in sock_get_port()
354 cxgbi_sock_get(csk); in sock_get_port()
357 cdev, csk->port_id, in sock_get_port()
358 cdev->ports[csk->port_id]->name, in sock_get_port()
367 cdev, csk->port_id, cdev->ports[csk->port_id]->name, in sock_get_port()
372 static void sock_put_port(struct cxgbi_sock *csk) in sock_put_port() argument
374 struct cxgbi_device *cdev = csk->cdev; in sock_put_port()
377 if (csk->saddr.sin_port) { in sock_put_port()
378 int idx = ntohs(csk->saddr.sin_port) - pmap->sport_base; in sock_put_port()
380 csk->saddr.sin_port = 0; in sock_put_port()
383 cdev, csk->port_id, in sock_put_port()
384 cdev->ports[csk->port_id]->name, in sock_put_port()
385 ntohs(csk->saddr.sin_port)); in sock_put_port()
396 cdev, csk->port_id, cdev->ports[csk->port_id]->name, in sock_put_port()
399 cxgbi_sock_put(csk); in sock_put_port()
406 void cxgbi_sock_free_cpl_skbs(struct cxgbi_sock *csk) in cxgbi_sock_free_cpl_skbs() argument
408 if (csk->cpl_close) { in cxgbi_sock_free_cpl_skbs()
409 kfree_skb(csk->cpl_close); in cxgbi_sock_free_cpl_skbs()
410 csk->cpl_close = NULL; in cxgbi_sock_free_cpl_skbs()
412 if (csk->cpl_abort_req) { in cxgbi_sock_free_cpl_skbs()
413 kfree_skb(csk->cpl_abort_req); in cxgbi_sock_free_cpl_skbs()
414 csk->cpl_abort_req = NULL; in cxgbi_sock_free_cpl_skbs()
416 if (csk->cpl_abort_rpl) { in cxgbi_sock_free_cpl_skbs()
417 kfree_skb(csk->cpl_abort_rpl); in cxgbi_sock_free_cpl_skbs()
418 csk->cpl_abort_rpl = NULL; in cxgbi_sock_free_cpl_skbs()
425 struct cxgbi_sock *csk = kzalloc(sizeof(*csk), GFP_NOIO); in cxgbi_sock_create() local
427 if (!csk) { in cxgbi_sock_create()
428 pr_info("alloc csk %zu failed.\n", sizeof(*csk)); in cxgbi_sock_create()
432 if (cdev->csk_alloc_cpls(csk) < 0) { in cxgbi_sock_create()
433 pr_info("csk 0x%p, alloc cpls failed.\n", csk); in cxgbi_sock_create()
434 kfree(csk); in cxgbi_sock_create()
438 spin_lock_init(&csk->lock); in cxgbi_sock_create()
439 kref_init(&csk->refcnt); in cxgbi_sock_create()
440 skb_queue_head_init(&csk->receive_queue); in cxgbi_sock_create()
441 skb_queue_head_init(&csk->write_queue); in cxgbi_sock_create()
442 setup_timer(&csk->retry_timer, NULL, (unsigned long)csk); in cxgbi_sock_create()
443 rwlock_init(&csk->callback_lock); in cxgbi_sock_create()
444 csk->cdev = cdev; in cxgbi_sock_create()
445 csk->flags = 0; in cxgbi_sock_create()
446 cxgbi_sock_set_state(csk, CTP_CLOSED); in cxgbi_sock_create()
448 log_debug(1 << CXGBI_DBG_SOCK, "cdev 0x%p, new csk 0x%p.\n", cdev, csk); in cxgbi_sock_create()
450 return csk; in cxgbi_sock_create()
473 struct cxgbi_sock *csk = NULL; in cxgbi_check_route() local
522 csk = cxgbi_sock_create(cdev); in cxgbi_check_route()
523 if (!csk) { in cxgbi_check_route()
527 csk->cdev = cdev; in cxgbi_check_route()
528 csk->port_id = port; in cxgbi_check_route()
529 csk->mtu = mtu; in cxgbi_check_route()
530 csk->dst = dst; in cxgbi_check_route()
531 csk->daddr.sin_addr.s_addr = daddr->sin_addr.s_addr; in cxgbi_check_route()
532 csk->daddr.sin_port = daddr->sin_port; in cxgbi_check_route()
533 csk->daddr.sin_family = daddr->sin_family; in cxgbi_check_route()
534 csk->saddr.sin_addr.s_addr = rt->rt_src; in cxgbi_check_route()
536 return csk; in cxgbi_check_route()
540 if (csk) in cxgbi_check_route()
541 cxgbi_sock_closed(csk); in cxgbi_check_route()
546 void cxgbi_sock_established(struct cxgbi_sock *csk, unsigned int snd_isn, in cxgbi_sock_established() argument
549 csk->write_seq = csk->snd_nxt = csk->snd_una = snd_isn; in cxgbi_sock_established()
550 dst_confirm(csk->dst); in cxgbi_sock_established()
552 cxgbi_sock_set_state(csk, CTP_ESTABLISHED); in cxgbi_sock_established()
556 static void cxgbi_inform_iscsi_conn_closing(struct cxgbi_sock *csk) in cxgbi_inform_iscsi_conn_closing() argument
560 csk, csk->state, csk->flags, csk->user_data); in cxgbi_inform_iscsi_conn_closing()
562 if (csk->state != CTP_ESTABLISHED) { in cxgbi_inform_iscsi_conn_closing()
563 read_lock_bh(&csk->callback_lock); in cxgbi_inform_iscsi_conn_closing()
564 if (csk->user_data) in cxgbi_inform_iscsi_conn_closing()
565 iscsi_conn_failure(csk->user_data, in cxgbi_inform_iscsi_conn_closing()
567 read_unlock_bh(&csk->callback_lock); in cxgbi_inform_iscsi_conn_closing()
571 void cxgbi_sock_closed(struct cxgbi_sock *csk) in cxgbi_sock_closed() argument
574 csk, (csk)->state, (csk)->flags, (csk)->tid); in cxgbi_sock_closed()
575 cxgbi_sock_set_flag(csk, CTPF_ACTIVE_CLOSE_NEEDED); in cxgbi_sock_closed()
576 if (csk->state == CTP_ACTIVE_OPEN || csk->state == CTP_CLOSED) in cxgbi_sock_closed()
578 if (csk->saddr.sin_port) in cxgbi_sock_closed()
579 sock_put_port(csk); in cxgbi_sock_closed()
580 if (csk->dst) in cxgbi_sock_closed()
581 dst_release(csk->dst); in cxgbi_sock_closed()
582 csk->cdev->csk_release_offload_resources(csk); in cxgbi_sock_closed()
583 cxgbi_sock_set_state(csk, CTP_CLOSED); in cxgbi_sock_closed()
584 cxgbi_inform_iscsi_conn_closing(csk); in cxgbi_sock_closed()
585 cxgbi_sock_put(csk); in cxgbi_sock_closed()
589 static void need_active_close(struct cxgbi_sock *csk) in need_active_close() argument
595 csk, (csk)->state, (csk)->flags, (csk)->tid); in need_active_close()
596 spin_lock_bh(&csk->lock); in need_active_close()
597 dst_confirm(csk->dst); in need_active_close()
598 data_lost = skb_queue_len(&csk->receive_queue); in need_active_close()
599 __skb_queue_purge(&csk->receive_queue); in need_active_close()
601 if (csk->state == CTP_ACTIVE_OPEN) in need_active_close()
602 cxgbi_sock_set_flag(csk, CTPF_ACTIVE_CLOSE_NEEDED); in need_active_close()
603 else if (csk->state == CTP_ESTABLISHED) { in need_active_close()
605 cxgbi_sock_set_state(csk, CTP_ACTIVE_CLOSE); in need_active_close()
606 } else if (csk->state == CTP_PASSIVE_CLOSE) { in need_active_close()
608 cxgbi_sock_set_state(csk, CTP_CLOSE_WAIT_2); in need_active_close()
613 csk->cdev->csk_send_abort_req(csk); in need_active_close()
615 csk->cdev->csk_send_close_req(csk); in need_active_close()
618 spin_unlock_bh(&csk->lock); in need_active_close()
621 void cxgbi_sock_fail_act_open(struct cxgbi_sock *csk, int errno) in cxgbi_sock_fail_act_open() argument
624 csk, csk->state, csk->flags, in cxgbi_sock_fail_act_open()
625 &csk->saddr.sin_addr.s_addr, csk->saddr.sin_port, in cxgbi_sock_fail_act_open()
626 &csk->daddr.sin_addr.s_addr, csk->daddr.sin_port, in cxgbi_sock_fail_act_open()
629 cxgbi_sock_set_state(csk, CTP_CONNECTING); in cxgbi_sock_fail_act_open()
630 csk->err = errno; in cxgbi_sock_fail_act_open()
631 cxgbi_sock_closed(csk); in cxgbi_sock_fail_act_open()
637 struct cxgbi_sock *csk = (struct cxgbi_sock *)skb->sk; in cxgbi_sock_act_open_req_arp_failure() local
640 csk, (csk)->state, (csk)->flags, (csk)->tid); in cxgbi_sock_act_open_req_arp_failure()
641 cxgbi_sock_get(csk); in cxgbi_sock_act_open_req_arp_failure()
642 spin_lock_bh(&csk->lock); in cxgbi_sock_act_open_req_arp_failure()
643 if (csk->state == CTP_ACTIVE_OPEN) in cxgbi_sock_act_open_req_arp_failure()
644 cxgbi_sock_fail_act_open(csk, -EHOSTUNREACH); in cxgbi_sock_act_open_req_arp_failure()
645 spin_unlock_bh(&csk->lock); in cxgbi_sock_act_open_req_arp_failure()
646 cxgbi_sock_put(csk); in cxgbi_sock_act_open_req_arp_failure()
651 void cxgbi_sock_rcv_abort_rpl(struct cxgbi_sock *csk) in cxgbi_sock_rcv_abort_rpl() argument
653 cxgbi_sock_get(csk); in cxgbi_sock_rcv_abort_rpl()
654 spin_lock_bh(&csk->lock); in cxgbi_sock_rcv_abort_rpl()
655 if (cxgbi_sock_flag(csk, CTPF_ABORT_RPL_PENDING)) { in cxgbi_sock_rcv_abort_rpl()
656 if (!cxgbi_sock_flag(csk, CTPF_ABORT_RPL_RCVD)) in cxgbi_sock_rcv_abort_rpl()
657 cxgbi_sock_set_flag(csk, CTPF_ABORT_RPL_RCVD); in cxgbi_sock_rcv_abort_rpl()
659 cxgbi_sock_clear_flag(csk, CTPF_ABORT_RPL_RCVD); in cxgbi_sock_rcv_abort_rpl()
660 cxgbi_sock_clear_flag(csk, CTPF_ABORT_RPL_PENDING); in cxgbi_sock_rcv_abort_rpl()
661 if (cxgbi_sock_flag(csk, CTPF_ABORT_REQ_RCVD)) in cxgbi_sock_rcv_abort_rpl()
663 csk, csk->state, csk->flags, csk->tid); in cxgbi_sock_rcv_abort_rpl()
664 cxgbi_sock_closed(csk); in cxgbi_sock_rcv_abort_rpl()
667 spin_unlock_bh(&csk->lock); in cxgbi_sock_rcv_abort_rpl()
668 cxgbi_sock_put(csk); in cxgbi_sock_rcv_abort_rpl()
672 void cxgbi_sock_rcv_peer_close(struct cxgbi_sock *csk) in cxgbi_sock_rcv_peer_close() argument
675 csk, (csk)->state, (csk)->flags, (csk)->tid); in cxgbi_sock_rcv_peer_close()
676 cxgbi_sock_get(csk); in cxgbi_sock_rcv_peer_close()
677 spin_lock_bh(&csk->lock); in cxgbi_sock_rcv_peer_close()
679 if (cxgbi_sock_flag(csk, CTPF_ABORT_RPL_PENDING)) in cxgbi_sock_rcv_peer_close()
682 switch (csk->state) { in cxgbi_sock_rcv_peer_close()
684 cxgbi_sock_set_state(csk, CTP_PASSIVE_CLOSE); in cxgbi_sock_rcv_peer_close()
687 cxgbi_sock_set_state(csk, CTP_CLOSE_WAIT_2); in cxgbi_sock_rcv_peer_close()
690 cxgbi_sock_closed(csk); in cxgbi_sock_rcv_peer_close()
696 csk, csk->state, csk->flags, csk->tid); in cxgbi_sock_rcv_peer_close()
698 cxgbi_inform_iscsi_conn_closing(csk); in cxgbi_sock_rcv_peer_close()
700 spin_unlock_bh(&csk->lock); in cxgbi_sock_rcv_peer_close()
701 cxgbi_sock_put(csk); in cxgbi_sock_rcv_peer_close()
705 void cxgbi_sock_rcv_close_conn_rpl(struct cxgbi_sock *csk, u32 snd_nxt) in cxgbi_sock_rcv_close_conn_rpl() argument
708 csk, (csk)->state, (csk)->flags, (csk)->tid); in cxgbi_sock_rcv_close_conn_rpl()
709 cxgbi_sock_get(csk); in cxgbi_sock_rcv_close_conn_rpl()
710 spin_lock_bh(&csk->lock); in cxgbi_sock_rcv_close_conn_rpl()
712 csk->snd_una = snd_nxt - 1; in cxgbi_sock_rcv_close_conn_rpl()
713 if (cxgbi_sock_flag(csk, CTPF_ABORT_RPL_PENDING)) in cxgbi_sock_rcv_close_conn_rpl()
716 switch (csk->state) { in cxgbi_sock_rcv_close_conn_rpl()
718 cxgbi_sock_set_state(csk, CTP_CLOSE_WAIT_1); in cxgbi_sock_rcv_close_conn_rpl()
722 cxgbi_sock_closed(csk); in cxgbi_sock_rcv_close_conn_rpl()
728 csk, csk->state, csk->flags, csk->tid); in cxgbi_sock_rcv_close_conn_rpl()
731 spin_unlock_bh(&csk->lock); in cxgbi_sock_rcv_close_conn_rpl()
732 cxgbi_sock_put(csk); in cxgbi_sock_rcv_close_conn_rpl()
736 void cxgbi_sock_rcv_wr_ack(struct cxgbi_sock *csk, unsigned int credits, in cxgbi_sock_rcv_wr_ack() argument
741 csk, csk->state, csk->flags, csk->tid, credits, in cxgbi_sock_rcv_wr_ack()
742 csk->wr_cred, csk->wr_una_cred, snd_una, seq_chk); in cxgbi_sock_rcv_wr_ack()
744 spin_lock_bh(&csk->lock); in cxgbi_sock_rcv_wr_ack()
746 csk->wr_cred += credits; in cxgbi_sock_rcv_wr_ack()
747 if (csk->wr_una_cred > csk->wr_max_cred - csk->wr_cred) in cxgbi_sock_rcv_wr_ack()
748 csk->wr_una_cred = csk->wr_max_cred - csk->wr_cred; in cxgbi_sock_rcv_wr_ack()
751 struct sk_buff *p = cxgbi_sock_peek_wr(csk); in cxgbi_sock_rcv_wr_ack()
755 csk, csk->state, csk->flags, csk->tid, credits, in cxgbi_sock_rcv_wr_ack()
756 csk->wr_cred, csk->wr_una_cred); in cxgbi_sock_rcv_wr_ack()
762 csk, csk->state, csk->flags, csk->tid, in cxgbi_sock_rcv_wr_ack()
763 credits, csk->wr_cred, csk->wr_una_cred, in cxgbi_sock_rcv_wr_ack()
768 cxgbi_sock_dequeue_wr(csk); in cxgbi_sock_rcv_wr_ack()
774 cxgbi_sock_check_wr_invariants(csk); in cxgbi_sock_rcv_wr_ack()
777 if (unlikely(before(snd_una, csk->snd_una))) { in cxgbi_sock_rcv_wr_ack()
779 csk, csk->state, csk->flags, csk->tid, snd_una, in cxgbi_sock_rcv_wr_ack()
780 csk->snd_una); in cxgbi_sock_rcv_wr_ack()
784 if (csk->snd_una != snd_una) { in cxgbi_sock_rcv_wr_ack()
785 csk->snd_una = snd_una; in cxgbi_sock_rcv_wr_ack()
786 dst_confirm(csk->dst); in cxgbi_sock_rcv_wr_ack()
790 if (skb_queue_len(&csk->write_queue)) { in cxgbi_sock_rcv_wr_ack()
791 if (csk->cdev->csk_push_tx_frames(csk, 0)) in cxgbi_sock_rcv_wr_ack()
792 cxgbi_conn_tx_open(csk); in cxgbi_sock_rcv_wr_ack()
794 cxgbi_conn_tx_open(csk); in cxgbi_sock_rcv_wr_ack()
796 spin_unlock_bh(&csk->lock); in cxgbi_sock_rcv_wr_ack()
800 static unsigned int cxgbi_sock_find_best_mtu(struct cxgbi_sock *csk, in cxgbi_sock_find_best_mtu() argument
805 while (i < csk->cdev->nmtus - 1 && csk->cdev->mtus[i + 1] <= mtu) in cxgbi_sock_find_best_mtu()
811 unsigned int cxgbi_sock_select_mss(struct cxgbi_sock *csk, unsigned int pmtu) in cxgbi_sock_select_mss() argument
814 struct dst_entry *dst = csk->dst; in cxgbi_sock_select_mss()
816 csk->advmss = dst_metric_advmss(dst); in cxgbi_sock_select_mss()
818 if (csk->advmss > pmtu - 40) in cxgbi_sock_select_mss()
819 csk->advmss = pmtu - 40; in cxgbi_sock_select_mss()
820 if (csk->advmss < csk->cdev->mtus[0] - 40) in cxgbi_sock_select_mss()
821 csk->advmss = csk->cdev->mtus[0] - 40; in cxgbi_sock_select_mss()
822 idx = cxgbi_sock_find_best_mtu(csk, csk->advmss + 40); in cxgbi_sock_select_mss()
828 void cxgbi_sock_skb_entail(struct cxgbi_sock *csk, struct sk_buff *skb) in cxgbi_sock_skb_entail() argument
830 cxgbi_skcb_tcp_seq(skb) = csk->write_seq; in cxgbi_sock_skb_entail()
831 __skb_queue_tail(&csk->write_queue, skb); in cxgbi_sock_skb_entail()
835 void cxgbi_sock_purge_wr_queue(struct cxgbi_sock *csk) in cxgbi_sock_purge_wr_queue() argument
839 while ((skb = cxgbi_sock_dequeue_wr(csk)) != NULL) in cxgbi_sock_purge_wr_queue()
844 void cxgbi_sock_check_wr_invariants(const struct cxgbi_sock *csk) in cxgbi_sock_check_wr_invariants() argument
846 int pending = cxgbi_sock_count_pending_wrs(csk); in cxgbi_sock_check_wr_invariants()
848 if (unlikely(csk->wr_cred + pending != csk->wr_max_cred)) in cxgbi_sock_check_wr_invariants()
850 csk, csk->tid, csk->wr_cred, pending, csk->wr_max_cred); in cxgbi_sock_check_wr_invariants()
854 static int cxgbi_sock_send_pdus(struct cxgbi_sock *csk, struct sk_buff *skb) in cxgbi_sock_send_pdus() argument
856 struct cxgbi_device *cdev = csk->cdev; in cxgbi_sock_send_pdus()
860 spin_lock_bh(&csk->lock); in cxgbi_sock_send_pdus()
862 if (csk->state != CTP_ESTABLISHED) { in cxgbi_sock_send_pdus()
865 csk, csk->state, csk->flags, csk->tid); in cxgbi_sock_send_pdus()
870 if (csk->err) { in cxgbi_sock_send_pdus()
873 csk, csk->state, csk->flags, csk->tid, csk->err); in cxgbi_sock_send_pdus()
878 if (csk->write_seq - csk->snd_una >= cdev->snd_win) { in cxgbi_sock_send_pdus()
881 csk, csk->state, csk->flags, csk->tid, csk->write_seq, in cxgbi_sock_send_pdus()
882 csk->snd_una, cdev->snd_win); in cxgbi_sock_send_pdus()
893 csk, skb_headroom(skb), cdev->skb_tx_rsvd); in cxgbi_sock_send_pdus()
900 csk, skb_shinfo(skb)->nr_frags, skb->len, in cxgbi_sock_send_pdus()
909 cxgbi_sock_skb_entail(csk, skb); in cxgbi_sock_send_pdus()
911 csk->write_seq += skb->len + in cxgbi_sock_send_pdus()
916 if (likely(skb_queue_len(&csk->write_queue))) in cxgbi_sock_send_pdus()
917 cdev->csk_push_tx_frames(csk, 1); in cxgbi_sock_send_pdus()
918 spin_unlock_bh(&csk->lock); in cxgbi_sock_send_pdus()
923 copied = csk->err ? csk->err : -EPIPE; in cxgbi_sock_send_pdus()
1234 static int ddp_tag_reserve(struct cxgbi_sock *csk, unsigned int tid, in ddp_tag_reserve() argument
1238 struct cxgbi_device *cdev = csk->cdev; in ddp_tag_reserve()
1277 err = cdev->csk_ddp_set(csk, &hdr, idx, npods, gl); in ddp_tag_reserve()
1294 int cxgbi_ddp_reserve(struct cxgbi_sock *csk, unsigned int *tagp, in cxgbi_ddp_reserve() argument
1298 struct cxgbi_device *cdev = csk->cdev; in cxgbi_ddp_reserve()
1320 err = ddp_tag_reserve(csk, csk->tid, sw_tag, tagp, gl, gfp); in cxgbi_ddp_reserve()
1465 err = cxgbi_ddp_reserve(cconn->cep->csk, &tag, sw_tag, in task_reserve_itt()
1473 cconn->cep->csk, task, scsi_in(sc)->length, in task_reserve_itt()
1509 void cxgbi_conn_tx_open(struct cxgbi_sock *csk) in cxgbi_conn_tx_open() argument
1511 struct iscsi_conn *conn = csk->user_data; in cxgbi_conn_tx_open()
1515 "csk 0x%p, cid %d.\n", csk, conn->id); in cxgbi_conn_tx_open()
1627 static void csk_return_rx_credits(struct cxgbi_sock *csk, int copied) in csk_return_rx_credits() argument
1629 struct cxgbi_device *cdev = csk->cdev; in csk_return_rx_credits()
1635 csk, csk->state, csk->flags, csk->tid, csk->copied_seq, in csk_return_rx_credits()
1636 csk->rcv_wup, cdev->rx_credit_thres, in csk_return_rx_credits()
1639 if (csk->state != CTP_ESTABLISHED) in csk_return_rx_credits()
1642 credits = csk->copied_seq - csk->rcv_wup; in csk_return_rx_credits()
1650 csk->rcv_wup += cdev->csk_send_rx_credits(csk, credits); in csk_return_rx_credits()
1653 void cxgbi_conn_pdu_ready(struct cxgbi_sock *csk) in cxgbi_conn_pdu_ready() argument
1655 struct cxgbi_device *cdev = csk->cdev; in cxgbi_conn_pdu_ready()
1656 struct iscsi_conn *conn = csk->user_data; in cxgbi_conn_pdu_ready()
1662 "csk 0x%p, conn 0x%p.\n", csk, conn); in cxgbi_conn_pdu_ready()
1667 csk, conn, conn ? conn->id : 0xFF, in cxgbi_conn_pdu_ready()
1673 skb = skb_peek(&csk->receive_queue); in cxgbi_conn_pdu_ready()
1682 __skb_unlink(skb, &csk->receive_queue); in cxgbi_conn_pdu_ready()
1687 csk, skb, skb->len, cxgbi_skcb_flags(skb), in cxgbi_conn_pdu_ready()
1695 csk, skb, skb->len, in cxgbi_conn_pdu_ready()
1705 csk, skb, skb->len, in cxgbi_conn_pdu_ready()
1713 csk, skb, skb->len, in cxgbi_conn_pdu_ready()
1722 dskb = skb_peek(&csk->receive_queue); in cxgbi_conn_pdu_ready()
1726 csk, skb, skb->len, in cxgbi_conn_pdu_ready()
1732 __skb_unlink(dskb, &csk->receive_queue); in cxgbi_conn_pdu_ready()
1739 csk, skb, skb->len, in cxgbi_conn_pdu_ready()
1754 log_debug(1 << CXGBI_DBG_PDU_RX, "csk 0x%p, read %u.\n", csk, read); in cxgbi_conn_pdu_ready()
1756 csk->copied_seq += read; in cxgbi_conn_pdu_ready()
1757 csk_return_rx_credits(csk, read); in cxgbi_conn_pdu_ready()
1763 csk, conn, err, read); in cxgbi_conn_pdu_ready()
2017 err = cxgbi_sock_send_pdus(cconn->cep->csk, skb); in cxgbi_conn_xmit_pdu()
2142 struct cxgbi_sock *csk = cconn->cep->csk; in cxgbi_set_conn_param() local
2153 err = csk->cdev->csk_ddp_setup_digest(csk, csk->tid, in cxgbi_set_conn_param()
2160 err = csk->cdev->csk_ddp_setup_digest(csk, csk->tid, in cxgbi_set_conn_param()
2195 struct cxgbi_sock *csk; in cxgbi_get_ep_param() local
2207 csk = cep->csk; in cxgbi_get_ep_param()
2208 if (!csk) in cxgbi_get_ep_param()
2212 &csk->daddr, param, buf); in cxgbi_get_ep_param()
2254 struct cxgbi_sock *csk; in cxgbi_bind_conn() local
2263 csk = cep->csk; in cxgbi_bind_conn()
2264 err = csk->cdev->csk_ddp_setup_pgidx(csk, csk->tid, page_idx, 0); in cxgbi_bind_conn()
2275 write_lock_bh(&csk->callback_lock); in cxgbi_bind_conn()
2276 csk->user_data = conn; in cxgbi_bind_conn()
2280 write_unlock_bh(&csk->callback_lock); in cxgbi_bind_conn()
2287 cls_session, cls_conn, ep, cconn, csk); in cxgbi_bind_conn()
2429 struct cxgbi_sock *csk; in cxgbi_ep_connect() local
2444 csk = cxgbi_check_route(dst_addr); in cxgbi_ep_connect()
2445 if (IS_ERR(csk)) in cxgbi_ep_connect()
2446 return (struct iscsi_endpoint *)csk; in cxgbi_ep_connect()
2447 cxgbi_sock_get(csk); in cxgbi_ep_connect()
2450 hba = csk->cdev->hbas[csk->port_id]; in cxgbi_ep_connect()
2451 else if (hba != csk->cdev->hbas[csk->port_id]) { in cxgbi_ep_connect()
2455 csk->cdev->hbas[csk->port_id], csk->port_id); in cxgbi_ep_connect()
2460 err = sock_get_port(csk); in cxgbi_ep_connect()
2464 cxgbi_sock_set_state(csk, CTP_CONNECTING); in cxgbi_ep_connect()
2465 err = csk->cdev->csk_init_act_open(csk); in cxgbi_ep_connect()
2469 if (cxgbi_sock_is_closing(csk)) { in cxgbi_ep_connect()
2471 pr_info("csk 0x%p is closing.\n", csk); in cxgbi_ep_connect()
2483 cep->csk = csk; in cxgbi_ep_connect()
2488 ep, cep, csk, hba, hba->ndev->name); in cxgbi_ep_connect()
2492 cxgbi_sock_put(csk); in cxgbi_ep_connect()
2493 cxgbi_sock_closed(csk); in cxgbi_ep_connect()
2502 struct cxgbi_sock *csk = cep->csk; in cxgbi_ep_poll() local
2504 if (!cxgbi_sock_is_established(csk)) in cxgbi_ep_poll()
2514 struct cxgbi_sock *csk = cep->csk; in cxgbi_ep_disconnect() local
2518 ep, cep, cconn, csk, csk->state, csk->flags); in cxgbi_ep_disconnect()
2522 write_lock_bh(&csk->callback_lock); in cxgbi_ep_disconnect()
2523 cep->csk->user_data = NULL; in cxgbi_ep_disconnect()
2525 write_unlock_bh(&csk->callback_lock); in cxgbi_ep_disconnect()
2529 if (likely(csk->state >= CTP_ESTABLISHED)) in cxgbi_ep_disconnect()
2530 need_active_close(csk); in cxgbi_ep_disconnect()
2532 cxgbi_sock_closed(csk); in cxgbi_ep_disconnect()
2534 cxgbi_sock_put(csk); in cxgbi_ep_disconnect()