Lines Matching full:ic
72 struct icl_conn ic; member
175 icl_conn_fail(struct icl_conn *ic) in icl_conn_fail() argument
177 if (ic->ic_socket == NULL) in icl_conn_fail()
183 ic->ic_socket->so_error = EDOOFUS; in icl_conn_fail()
184 (ic->ic_error)(ic); in icl_conn_fail()
188 icl_soft_conn_pdu_free(struct icl_conn *ic, struct icl_pdu *ip) in icl_soft_conn_pdu_free() argument
198 refcount_release(&ic->ic_outstanding_pdus); in icl_soft_conn_pdu_free()
246 icl_soft_conn_new_pdu(struct icl_conn *ic, int flags) in icl_soft_conn_new_pdu() argument
252 refcount_acquire(&ic->ic_outstanding_pdus); in icl_soft_conn_new_pdu()
258 refcount_release(&ic->ic_outstanding_pdus); in icl_soft_conn_new_pdu()
263 ip->ip_conn = ic; in icl_soft_conn_new_pdu()
269 icl_soft_conn_pdu_free(ic, ip); in icl_soft_conn_new_pdu()
301 icl_soft_conn_pdu_data_segment_length(struct icl_conn *ic, in icl_soft_conn_pdu_data_segment_length() argument
566 struct icl_conn *ic = &isc->ic; in icl_conn_receive_pdu() local
575 request = icl_soft_conn_new_pdu(ic, M_NOWAIT); in icl_conn_receive_pdu()
579 icl_conn_fail(ic); in icl_conn_receive_pdu()
601 if (len > ic->ic_max_recv_data_segment_length) { in icl_conn_receive_pdu()
617 if (ic->ic_header_crc32c == false) in icl_conn_receive_pdu()
650 if (request->ip_data_len == 0 || ic->ic_data_crc32c == false) in icl_conn_receive_pdu()
683 icl_conn_fail(ic); in icl_conn_receive_pdu()
692 struct icl_conn *ic = &isc->ic; in icl_conn_receive_pdus() local
696 if (ic->ic_disconnecting) in icl_conn_receive_pdus()
719 icl_soft_conn_pdu_free(ic, response); in icl_conn_receive_pdus()
720 icl_conn_fail(ic); in icl_conn_receive_pdus()
724 (ic->ic_receive)(response); in icl_conn_receive_pdus()
732 struct icl_conn *ic = &isc->ic; in icl_receive_thread() local
739 so = ic->ic_socket; in icl_receive_thread()
743 if (ic->ic_disconnecting) { in icl_receive_thread()
767 icl_conn_fail(ic); in icl_receive_thread()
798 ICL_CONN_LOCK(ic); in icl_receive_thread()
801 ICL_CONN_UNLOCK(ic); in icl_receive_thread()
824 struct icl_conn *ic; in icl_pdu_finalize() local
826 ic = request->ip_conn; in icl_pdu_finalize()
832 if (ic->ic_header_crc32c) { in icl_pdu_finalize()
854 if (ic->ic_data_crc32c) { in icl_pdu_finalize()
878 struct icl_conn *ic = &isc->ic; in icl_conn_send_pdus() local
888 ICL_CONN_LOCK_ASSERT_NOT(ic); in icl_conn_send_pdus()
890 so = ic->ic_socket; in icl_conn_send_pdus()
940 icl_conn_fail(ic); in icl_conn_send_pdus()
967 icl_conn_fail(ic); in icl_conn_send_pdus()
993 icl_conn_fail(ic); in icl_conn_send_pdus()
1004 struct icl_conn *ic; in icl_send_thread() local
1008 ic = &isc->ic; in icl_send_thread()
1012 ICL_CONN_LOCK(ic); in icl_send_thread()
1023 ICL_CONN_UNLOCK(ic); in icl_send_thread()
1025 ICL_CONN_LOCK(ic); in icl_send_thread()
1050 if (ic->ic_disconnecting) { in icl_send_thread()
1055 cv_wait(&isc->send_cv, ic->ic_lock); in icl_send_thread()
1066 ICL_CONN_UNLOCK(ic); in icl_send_thread()
1074 struct icl_conn *ic; in icl_soupcall_send() local
1080 ic = &isc->ic; in icl_soupcall_send()
1082 ICL_CONN_LOCK(ic); in icl_soupcall_send()
1084 ICL_CONN_UNLOCK(ic); in icl_soupcall_send()
1110 icl_soft_conn_pdu_append_bio(struct icl_conn *ic, struct icl_pdu *request, in icl_soft_conn_pdu_append_bio() argument
1221 icl_soft_conn_pdu_append_data(struct icl_conn *ic, struct icl_pdu *request, in icl_soft_conn_pdu_append_data() argument
1269 icl_soft_conn_pdu_get_bio(struct icl_conn *ic, struct icl_pdu *ip, in icl_soft_conn_pdu_get_bio() argument
1302 icl_soft_conn_pdu_get_data(struct icl_conn *ic, struct icl_pdu *ip, in icl_soft_conn_pdu_get_data() argument
1310 icl_soft_conn_pdu_queue(struct icl_conn *ic, struct icl_pdu *ip) in icl_soft_conn_pdu_queue() argument
1313 icl_soft_conn_pdu_queue_cb(ic, ip, NULL); in icl_soft_conn_pdu_queue()
1317 icl_soft_conn_pdu_queue_cb(struct icl_conn *ic, struct icl_pdu *ip, in icl_soft_conn_pdu_queue_cb() argument
1320 struct icl_soft_conn *isc = (struct icl_soft_conn *)ic; in icl_soft_conn_pdu_queue_cb()
1323 ICL_CONN_LOCK_ASSERT(ic); in icl_soft_conn_pdu_queue_cb()
1327 if (ic->ic_disconnecting || ic->ic_socket == NULL) { in icl_soft_conn_pdu_queue_cb()
1351 struct icl_conn *ic; in icl_soft_new_conn() local
1362 ic = &isc->ic; in icl_soft_new_conn()
1363 ic->ic_lock = lock; in icl_soft_new_conn()
1365 refcount_init(&ic->ic_outstanding_pdus, 0); in icl_soft_new_conn()
1367 ic->ic_name = name; in icl_soft_new_conn()
1368 ic->ic_offload = "None"; in icl_soft_new_conn()
1369 ic->ic_unmapped = PMAP_HAS_DMAP; in icl_soft_new_conn()
1371 return (ic); in icl_soft_new_conn()
1375 icl_soft_conn_free(struct icl_conn *ic) in icl_soft_conn_free() argument
1377 struct icl_soft_conn *isc = (struct icl_soft_conn *)ic; in icl_soft_conn_free()
1380 KASSERT(ic->ic_outstanding_pdus == 0, in icl_soft_conn_free()
1382 ic->ic_outstanding_pdus)); in icl_soft_conn_free()
1391 icl_conn_start(struct icl_conn *ic) in icl_conn_start() argument
1393 struct icl_soft_conn *isc = (struct icl_soft_conn *)ic; in icl_conn_start()
1398 ICL_CONN_LOCK(ic); in icl_conn_start()
1403 if (ic->ic_socket == NULL) { in icl_conn_start()
1404 ICL_CONN_UNLOCK(ic); in icl_conn_start()
1410 ic->ic_disconnecting = false; in icl_conn_start()
1412 ICL_CONN_UNLOCK(ic); in icl_conn_start()
1420 ic->ic_max_send_data_segment_length + in icl_conn_start()
1428 ic->ic_max_recv_data_segment_length + in icl_conn_start()
1436 error = soreserve(ic->ic_socket, sendspace, recvspace); in icl_conn_start()
1439 icl_soft_conn_close(ic); in icl_conn_start()
1442 ic->ic_socket->so_snd.sb_flags |= SB_AUTOSIZE; in icl_conn_start()
1443 ic->ic_socket->so_rcv.sb_flags |= SB_AUTOSIZE; in icl_conn_start()
1454 error = sosetopt(ic->ic_socket, &opt); in icl_conn_start()
1457 icl_soft_conn_close(ic); in icl_conn_start()
1465 SOCKBUF_LOCK(&ic->ic_socket->so_snd); in icl_conn_start()
1466 soupcall_set(ic->ic_socket, SO_SND, icl_soupcall_send, isc); in icl_conn_start()
1467 SOCKBUF_UNLOCK(&ic->ic_socket->so_snd); in icl_conn_start()
1468 SOCKBUF_LOCK(&ic->ic_socket->so_rcv); in icl_conn_start()
1469 soupcall_set(ic->ic_socket, SO_RCV, icl_soupcall_receive, isc); in icl_conn_start()
1470 SOCKBUF_UNLOCK(&ic->ic_socket->so_rcv); in icl_conn_start()
1475 ICL_CONN_LOCK(ic); in icl_conn_start()
1477 ICL_CONN_UNLOCK(ic); in icl_conn_start()
1478 error = kthread_add(icl_send_thread, ic, NULL, NULL, 0, 0, "%stx", in icl_conn_start()
1479 ic->ic_name); in icl_conn_start()
1482 ICL_CONN_LOCK(ic); in icl_conn_start()
1485 ICL_CONN_UNLOCK(ic); in icl_conn_start()
1486 icl_soft_conn_close(ic); in icl_conn_start()
1489 error = kthread_add(icl_receive_thread, ic, NULL, NULL, 0, 0, "%srx", in icl_conn_start()
1490 ic->ic_name); in icl_conn_start()
1493 ICL_CONN_LOCK(ic); in icl_conn_start()
1496 ICL_CONN_UNLOCK(ic); in icl_conn_start()
1497 icl_soft_conn_close(ic); in icl_conn_start()
1505 icl_soft_conn_handoff(struct icl_conn *ic, int fd) in icl_soft_conn_handoff() argument
1512 ICL_CONN_LOCK_ASSERT_NOT(ic); in icl_soft_conn_handoff()
1520 ICL_CONN_LOCK(ic); in icl_soft_conn_handoff()
1521 if (ic->ic_socket == NULL) { in icl_soft_conn_handoff()
1522 ICL_CONN_UNLOCK(ic); in icl_soft_conn_handoff()
1526 ICL_CONN_UNLOCK(ic); in icl_soft_conn_handoff()
1548 ICL_CONN_LOCK(ic); in icl_soft_conn_handoff()
1550 if (ic->ic_socket != NULL) { in icl_soft_conn_handoff()
1551 ICL_CONN_UNLOCK(ic); in icl_soft_conn_handoff()
1556 ic->ic_socket = fp->f_data; in icl_soft_conn_handoff()
1560 ICL_CONN_UNLOCK(ic); in icl_soft_conn_handoff()
1562 error = icl_conn_start(ic); in icl_soft_conn_handoff()
1568 icl_soft_conn_close(struct icl_conn *ic) in icl_soft_conn_close() argument
1570 struct icl_soft_conn *isc = (struct icl_soft_conn *)ic; in icl_soft_conn_close()
1576 * Receive thread sleeps on so->so_rcv lock, send on ic->ic_lock. in icl_soft_conn_close()
1578 ICL_CONN_LOCK(ic); in icl_soft_conn_close()
1579 if (!ic->ic_disconnecting) { in icl_soft_conn_close()
1580 so = ic->ic_socket; in icl_soft_conn_close()
1583 ic->ic_disconnecting = true; in icl_soft_conn_close()
1590 cv_wait(&isc->send_cv, ic->ic_lock); in icl_soft_conn_close()
1594 so = ic->ic_socket; in icl_soft_conn_close()
1596 ICL_CONN_UNLOCK(ic); in icl_soft_conn_close()
1599 ic->ic_socket = NULL; in icl_soft_conn_close()
1604 ICL_CONN_UNLOCK(ic); in icl_soft_conn_close()
1614 ICL_CONN_LOCK(ic); in icl_soft_conn_close()
1618 icl_soft_conn_pdu_free(ic, isc->receive_pdu); in icl_soft_conn_close()
1633 ICL_CONN_UNLOCK(ic); in icl_soft_conn_close()
1637 icl_soft_conn_task_setup(struct icl_conn *ic, struct icl_pdu *ip, in icl_soft_conn_task_setup() argument
1645 icl_soft_conn_task_done(struct icl_conn *ic, void *prv) in icl_soft_conn_task_done() argument
1650 icl_soft_conn_transfer_setup(struct icl_conn *ic, struct icl_pdu *ip, in icl_soft_conn_transfer_setup() argument
1658 icl_soft_conn_transfer_done(struct icl_conn *ic, void *prv) in icl_soft_conn_transfer_done() argument
1676 icl_soft_conn_connect(struct icl_conn *ic, int domain, int socktype, in icl_soft_conn_connect() argument
1680 return (icl_soft_proxy_connect(ic, domain, socktype, protocol, in icl_soft_conn_connect()
1685 icl_soft_handoff_sock(struct icl_conn *ic, struct socket *so) in icl_soft_handoff_sock() argument
1689 ICL_CONN_LOCK_ASSERT_NOT(ic); in icl_soft_handoff_sock()
1694 ICL_CONN_LOCK(ic); in icl_soft_handoff_sock()
1695 if (ic->ic_socket != NULL) { in icl_soft_handoff_sock()
1696 ICL_CONN_UNLOCK(ic); in icl_soft_handoff_sock()
1699 ic->ic_socket = so; in icl_soft_handoff_sock()
1700 ICL_CONN_UNLOCK(ic); in icl_soft_handoff_sock()
1702 error = icl_conn_start(ic); in icl_soft_handoff_sock()