Lines Matching refs:conn
418 struct iscsi_conn *conn = tcp_conn->iscsi_conn; in iscsi_tcp_data_recv_done() local
424 rc = iscsi_complete_pdu(conn, tcp_conn->in.hdr, in iscsi_tcp_data_recv_done()
425 conn->data, tcp_conn->in.datalen); in iscsi_tcp_data_recv_done()
436 struct iscsi_conn *conn = tcp_conn->iscsi_conn; in iscsi_tcp_data_recv_prep() local
439 if (conn->datadgst_en && in iscsi_tcp_data_recv_prep()
440 !(conn->session->tt->caps & CAP_DIGEST_OFFLOAD)) in iscsi_tcp_data_recv_prep()
444 conn->data, tcp_conn->in.datalen, in iscsi_tcp_data_recv_prep()
468 ISCSI_DBG_TCP(task->conn, "pending r2t dropped\n"); in iscsi_tcp_cleanup_task()
486 static int iscsi_tcp_data_in(struct iscsi_conn *conn, struct iscsi_task *task) in iscsi_tcp_data_in() argument
488 struct iscsi_tcp_conn *tcp_conn = conn->dd_data; in iscsi_tcp_data_in()
499 iscsi_update_cmdsn(conn->session, (struct iscsi_nopin*)rhdr); in iscsi_tcp_data_in()
505 ISCSI_DBG_TCP(conn, "task->exp_datasn(%d) != rhdr->datasn(%d)" in iscsi_tcp_data_in()
514 ISCSI_DBG_TCP(conn, "data_offset(%d) + data_len(%d) > " in iscsi_tcp_data_in()
520 conn->datain_pdus_cnt++; in iscsi_tcp_data_in()
529 static int iscsi_tcp_r2t_rsp(struct iscsi_conn *conn, struct iscsi_hdr *hdr) in iscsi_tcp_r2t_rsp() argument
531 struct iscsi_session *session = conn->session; in iscsi_tcp_r2t_rsp()
543 task = iscsi_itt_to_ctask(conn, hdr->itt); in iscsi_tcp_r2t_rsp()
563 tcp_conn = conn->dd_data; in iscsi_tcp_r2t_rsp()
570 iscsi_conn_printk(KERN_ERR, conn, in iscsi_tcp_r2t_rsp()
580 ISCSI_DBG_TCP(conn, "task->exp_datasn(%d) != rhdr->r2tsn(%d)\n", in iscsi_tcp_r2t_rsp()
587 iscsi_conn_printk(KERN_INFO, conn, in iscsi_tcp_r2t_rsp()
596 iscsi_conn_printk(KERN_ERR, conn, in iscsi_tcp_r2t_rsp()
603 ISCSI_DBG_TCP(conn, "invalid R2T with data len %u and max " in iscsi_tcp_r2t_rsp()
609 iscsi_conn_printk(KERN_ERR, conn, in iscsi_tcp_r2t_rsp()
620 iscsi_conn_printk(KERN_ERR, conn, "Could not allocate R2T. " in iscsi_tcp_r2t_rsp()
638 conn->r2t_pdus_cnt++; in iscsi_tcp_r2t_rsp()
656 struct iscsi_conn *conn = tcp_conn->iscsi_conn; in iscsi_tcp_process_data_in() local
665 rc = iscsi_complete_pdu(conn, tcp_conn->in.hdr, NULL, 0); in iscsi_tcp_process_data_in()
685 iscsi_tcp_hdr_dissect(struct iscsi_conn *conn, struct iscsi_hdr *hdr) in iscsi_tcp_hdr_dissect() argument
688 struct iscsi_tcp_conn *tcp_conn = conn->dd_data; in iscsi_tcp_hdr_dissect()
693 if (tcp_conn->in.datalen > conn->max_recv_dlength) { in iscsi_tcp_hdr_dissect()
694 iscsi_conn_printk(KERN_ERR, conn, in iscsi_tcp_hdr_dissect()
696 tcp_conn->in.datalen, conn->max_recv_dlength); in iscsi_tcp_hdr_dissect()
707 rc = iscsi_verify_itt(conn, hdr->itt); in iscsi_tcp_hdr_dissect()
711 ISCSI_DBG_TCP(conn, "opcode 0x%x ahslen %d datalen %d\n", in iscsi_tcp_hdr_dissect()
716 spin_lock(&conn->session->back_lock); in iscsi_tcp_hdr_dissect()
717 task = iscsi_itt_to_ctask(conn, hdr->itt); in iscsi_tcp_hdr_dissect()
721 rc = iscsi_tcp_data_in(conn, task); in iscsi_tcp_hdr_dissect()
723 spin_unlock(&conn->session->back_lock); in iscsi_tcp_hdr_dissect()
740 if (conn->datadgst_en && in iscsi_tcp_hdr_dissect()
741 !(conn->session->tt->caps & CAP_DIGEST_OFFLOAD)) in iscsi_tcp_hdr_dissect()
744 ISCSI_DBG_TCP(conn, "iscsi_tcp_begin_data_in( " in iscsi_tcp_hdr_dissect()
756 spin_unlock(&conn->session->back_lock); in iscsi_tcp_hdr_dissect()
759 rc = __iscsi_complete_pdu(conn, hdr, NULL, 0); in iscsi_tcp_hdr_dissect()
760 spin_unlock(&conn->session->back_lock); in iscsi_tcp_hdr_dissect()
767 rc = iscsi_complete_pdu(conn, hdr, NULL, 0); in iscsi_tcp_hdr_dissect()
774 rc = iscsi_tcp_r2t_rsp(conn, hdr); in iscsi_tcp_hdr_dissect()
786 iscsi_conn_printk(KERN_ERR, conn, in iscsi_tcp_hdr_dissect()
807 rc = iscsi_complete_pdu(conn, hdr, NULL, 0); in iscsi_tcp_hdr_dissect()
838 struct iscsi_conn *conn = tcp_conn->iscsi_conn; in iscsi_tcp_hdr_recv_done() local
864 if (conn->hdrdgst_en && in iscsi_tcp_hdr_recv_done()
865 !(conn->session->tt->caps & CAP_DIGEST_OFFLOAD)) { in iscsi_tcp_hdr_recv_done()
886 return iscsi_tcp_hdr_dissect(conn, hdr); in iscsi_tcp_hdr_recv_done()
913 int iscsi_tcp_recv_skb(struct iscsi_conn *conn, struct sk_buff *skb, in iscsi_tcp_recv_skb() argument
916 struct iscsi_tcp_conn *tcp_conn = conn->dd_data; in iscsi_tcp_recv_skb()
922 ISCSI_DBG_TCP(conn, "in %d bytes\n", skb->len - offset); in iscsi_tcp_recv_skb()
928 conn->last_recv = jiffies; in iscsi_tcp_recv_skb()
930 if (unlikely(test_bit(ISCSI_CONN_FLAG_SUSPEND_RX, &conn->flags))) { in iscsi_tcp_recv_skb()
931 ISCSI_DBG_TCP(conn, "Rx suspended!\n"); in iscsi_tcp_recv_skb()
948 ISCSI_DBG_TCP(conn, "no more data avail. Consumed %d\n", in iscsi_tcp_recv_skb()
955 ISCSI_DBG_TCP(conn, "skb %p ptr=%p avail=%u\n", skb, ptr, in iscsi_tcp_recv_skb()
969 ISCSI_DBG_TCP(conn, "segment done\n"); in iscsi_tcp_recv_skb()
973 ISCSI_DBG_TCP(conn, "Error receiving PDU, errno=%d\n", rc); in iscsi_tcp_recv_skb()
974 iscsi_conn_failure(conn, rc); in iscsi_tcp_recv_skb()
980 conn->rxdata_octets += consumed; in iscsi_tcp_recv_skb()
992 struct iscsi_conn *conn = task->conn; in iscsi_tcp_task_init() local
1001 ISCSI_DBG_TCP(conn, "mtask deq [itt 0x%x]\n", task->itt); in iscsi_tcp_task_init()
1003 return conn->session->tt->init_pdu(task, 0, task->data_count); in iscsi_tcp_task_init()
1010 ISCSI_DBG_TCP(conn, "task deq [itt 0x%x imm %d unsol %d]\n", in iscsi_tcp_task_init()
1013 err = conn->session->tt->init_pdu(task, 0, task->imm_count); in iscsi_tcp_task_init()
1034 ISCSI_DBG_TCP(task->conn, in iscsi_tcp_get_curr_r2t()
1067 struct iscsi_conn *conn = task->conn; in iscsi_tcp_task_xmit() local
1068 struct iscsi_session *session = conn->session; in iscsi_tcp_task_xmit()
1092 ISCSI_DBG_TCP(conn, "no R2Ts yet\n"); in iscsi_tcp_task_xmit()
1096 rc = conn->session->tt->alloc_pdu(task, ISCSI_OP_SCSI_DATA_OUT); in iscsi_tcp_task_xmit()
1101 ISCSI_DBG_TCP(conn, "sol dout %p [dsn %d itt 0x%x doff %d dlen %d]\n", in iscsi_tcp_task_xmit()
1105 rc = conn->session->tt->init_pdu(task, r2t->data_offset + r2t->sent, in iscsi_tcp_task_xmit()
1108 iscsi_conn_failure(conn, ISCSI_ERR_XMIT_FAILED); in iscsi_tcp_task_xmit()
1122 struct iscsi_conn *conn; in iscsi_tcp_conn_setup() local
1130 conn = cls_conn->dd_data; in iscsi_tcp_conn_setup()
1135 conn->max_recv_dlength = ISCSI_DEF_MAX_RECV_SEG_LEN; in iscsi_tcp_conn_setup()
1137 tcp_conn = conn->dd_data; in iscsi_tcp_conn_setup()
1138 tcp_conn->iscsi_conn = conn; in iscsi_tcp_conn_setup()
1139 tcp_conn->dd_data = conn->dd_data + sizeof(*tcp_conn); in iscsi_tcp_conn_setup()
1213 int iscsi_tcp_set_max_r2t(struct iscsi_conn *conn, char *buf) in iscsi_tcp_set_max_r2t() argument
1215 struct iscsi_session *session = conn->session; in iscsi_tcp_set_max_r2t()
1234 struct iscsi_conn *conn = cls_conn->dd_data; in iscsi_tcp_conn_get_stats() local
1236 stats->txdata_octets = conn->txdata_octets; in iscsi_tcp_conn_get_stats()
1237 stats->rxdata_octets = conn->rxdata_octets; in iscsi_tcp_conn_get_stats()
1238 stats->scsicmd_pdus = conn->scsicmd_pdus_cnt; in iscsi_tcp_conn_get_stats()
1239 stats->dataout_pdus = conn->dataout_pdus_cnt; in iscsi_tcp_conn_get_stats()
1240 stats->scsirsp_pdus = conn->scsirsp_pdus_cnt; in iscsi_tcp_conn_get_stats()
1241 stats->datain_pdus = conn->datain_pdus_cnt; in iscsi_tcp_conn_get_stats()
1242 stats->r2t_pdus = conn->r2t_pdus_cnt; in iscsi_tcp_conn_get_stats()
1243 stats->tmfcmd_pdus = conn->tmfcmd_pdus_cnt; in iscsi_tcp_conn_get_stats()
1244 stats->tmfrsp_pdus = conn->tmfrsp_pdus_cnt; in iscsi_tcp_conn_get_stats()