Lines Matching defs:listener

83  * the listener connection counter if needed.
927 * TH_RST if eager is in the fanout table. The listener wants the
939 tcp_t *listener = eager->tcp_listener;
942 * We could be called because listener is closing. Since
943 * the eager was using listener's queue's, we avoid
960 /* We are here because listener wants this eager gone */
961 if (listener != NULL) {
962 mutex_enter(&listener->tcp_eager_lock);
967 * listener but listener decides to close
970 * sending the conn_ind to listener.
974 mutex_exit(&listener->tcp_eager_lock);
975 CONN_DEC_REF(listener->tcp_connp);
983 * Reset any eager connection hanging off this listener marked
987 tcp_eager_blowoff(tcp_t *listener, t_scalar_t seqnum)
992 eager = listener;
993 mutex_enter(&listener->tcp_eager_lock);
997 mutex_exit(&listener->tcp_eager_lock);
1003 mutex_exit(&listener->tcp_eager_lock);
1009 mutex_exit(&listener->tcp_eager_lock);
1017 * Reset any eager connection hanging off this listener
1021 tcp_eager_cleanup(tcp_t *listener, boolean_t q0_only)
1025 tcp_stack_t *tcps = listener->tcp_tcps;
1027 ASSERT(MUTEX_HELD(&listener->tcp_eager_lock));
1032 eager = listener->tcp_eager_next_q;
1048 eager = listener->tcp_eager_next_q0;
1049 while (eager != listener) {
1064 * If we are an eager connection hanging off a listener that hasn't
1071 tcp_t *listener = tcp->tcp_listener;
1073 ASSERT(listener != NULL);
1074 ASSERT(MUTEX_HELD(&listener->tcp_eager_lock));
1083 ASSERT(listener->tcp_conn_req_cnt_q0 > 0);
1084 listener->tcp_conn_req_cnt_q0--;
1097 ASSERT(listener->tcp_syn_rcvd_timeout > 0);
1098 listener->tcp_syn_rcvd_timeout--;
1101 tcp_t **tcpp = &listener->tcp_eager_next_q;
1106 if (listener->tcp_eager_last_q == tcp) {
1114 if (listener->tcp_eager_last_q ==
1115 listener->tcp_eager_next_q) {
1116 listener->tcp_eager_last_q =
1125 listener->tcp_eager_last_q =
1132 ASSERT(listener->tcp_conn_req_cnt_q > 0);
1133 listener->tcp_conn_req_cnt_q--;
1151 * of conn_ind part is common for both sockfs listener and a TLI/XTI
1152 * listener but a TLI/XTI listener completes the accept processing
1153 * on the listener perimeter.
1158 * incoming SYN (listener perimeter) -> tcp_input_listener()
1161 * send T_CONN_IND (listener perim) -> tcp_send_conn_ind()
1177 * listener (done on listener's perimeter).
1185 * soaccept() sends T_CONN_RES on the listener STREAM.
1193 * listener->tcp_eager_lock protects the listeners->tcp_eager_next_q0 and
1200 * listener and listener adding eager to listeners->tcp_eager_next_q0.
1202 * 2) When a SYN-ACK-ACK arrives, we send the conn_ind to listener. Before
1207 * 3) The ref on listener placed in 1 above is dropped in tcp_accept_finish
1213 * in the listener's squeue, the eager is nascent at this point and the
1216 * Eager getting a Reset or listener closing:
1219 * Once the listener and eager are linked, the listener never does the unlink.
1220 * If the listener needs to close, tcp_eager_cleanup() is called which queues
1222 * any pointers to the listener's queue and drops the reference to the
1223 * listener. The listener waits in tcp_close outside the squeue until its
1224 * refcount has dropped to 1. This ensures that the listener has waited for
1225 * all eagers to clear their association with the listener.
1233 * of the listener->tcp_eager_lock, and then do a refhold
1238 * The only entity that can negate this refhold is a listener close
1241 * Eager's reference on the listener
1245 * reference on the listener at the start of tcp_accept_finish. If the
1247 * the reference is dropped in tcp_closei_local. If the listener closes,
1253 /* Process the SYN packet, mp, directed at the listener 'tcp' */
1257 * tcp_input_data will not see any packets for listeners since the listener
1273 tcp_t *listener = lconnp->conn_tcp;
1274 tcp_stack_t *tcps = listener->tcp_tcps;
1286 __dtrace_tcp_void_ip_t *, mp->b_rptr, tcp_t *, listener,
1295 /* Note this executes in listener's squeue */
1304 if (listener->tcp_state != TCPS_LISTEN)
1309 mutex_enter(&listener->tcp_eager_lock);
1315 * handshake. This means that busy listener will not get too many
1317 * listener is still functioning properly.
1319 if (tcps->tcps_reclaim && (listener->tcp_conn_req_cnt_q > 0 ||
1320 listener->tcp_conn_req_cnt_q0 > 0)) {
1321 mutex_exit(&listener->tcp_eager_lock);
1326 if (listener->tcp_conn_req_cnt_q >= listener->tcp_conn_req_max) {
1327 mutex_exit(&listener->tcp_eager_lock);
1334 listener->tcp_conn_req_max,
1335 listener->tcp_conn_req_cnt_q,
1336 tcp_display(listener, NULL, DISP_PORT_ONLY));
1341 if (listener->tcp_conn_req_cnt_q0 >=
1342 listener->tcp_conn_req_max + tcps->tcps_conn_req_max_q0) {
1352 listener->tcp_last_rcv_lbolt = ddi_get_lbolt64();
1353 if (!tcp_drop_q0(listener)) {
1354 mutex_exit(&listener->tcp_eager_lock);
1361 listener->tcp_conn_req_cnt_q0,
1362 tcp_display(listener, NULL,
1370 * Enforce the limit set on the number of connections per listener.
1374 if (listener->tcp_listen_cnt != NULL) {
1375 tcp_listen_cnt_t *tlc = listener->tcp_listen_cnt;
1379 mutex_exit(&listener->tcp_eager_lock);
1389 ntohs(listener->tcp_connp->conn_lport),
1398 mutex_exit(&listener->tcp_eager_lock);
1447 * the listener.
1449 tcp_init_values(eager, listener);
1500 /* Inherit the listener's non-STREAMS flag */
1522 * Inherit the policy from the listener; use
1536 * to the listener's receive window later in this function.
1624 * The listener's conn_rcvbuf should be the default window size or a
1631 * we should not inherit receive window size from listener.
1652 /* Put a ref on the listener for the eager. */
1654 mutex_enter(&listener->tcp_eager_lock);
1655 listener->tcp_eager_next_q0->tcp_eager_prev_q0 = eager;
1656 eager->tcp_eager_next_q0 = listener->tcp_eager_next_q0;
1657 listener->tcp_eager_next_q0 = eager;
1658 eager->tcp_eager_prev_q0 = listener;
1661 eager->tcp_listener = listener;
1662 eager->tcp_saved_listener = listener;
1668 eager->tcp_listen_cnt = listener->tcp_listen_cnt;
1672 * by our listener client in tcp_accept().
1674 eager->tcp_conn_req_seqnum = listener->tcp_conn_req_seqnum;
1675 listener->tcp_conn_req_cnt_q0++;
1676 if (++listener->tcp_conn_req_seqnum == -1) {
1681 ++listener->tcp_conn_req_seqnum;
1683 mutex_exit(&listener->tcp_eager_lock);
1685 if (listener->tcp_syn_defense) {
1689 addr_cache = (ipaddr_t *)(listener->tcp_ip_addr_cache);
1823 atomic_dec_32(&listener->tcp_listen_cnt->tlc_cnt);
1828 * beneficial to have the listener and all the incoming connections
1831 * CPU for obvious locality reason so this leaves the listener to
1832 * be tied to the same squeue. Our only problem is that when listener
1834 * IP address the listener is binding to is not even known. So
1838 * This is usefull only in case of a listener bound to a specific IP
1874 * the squeue then the listener close which is waiting
1908 * Assume we have picked a good squeue for the listener. Make
2301 * The TH_SYN for the listener directly go to tcp_input_listener via
2408 * global and listener queues which do not really need updating.
2789 * Only a TLI listener can come through this path when a
2790 * acceptor is going back to be a listener and a packet
2792 * listener, this can never happen because a listener
2794 * socket acceptor can not go back to being a listener.
2840 * connection hanging off a listener then new data
3741 tcp_t *listener = tcp->tcp_listener;
3758 * The listener also exists because of the refhold
3763 CONN_INC_REF(listener->tcp_connp);
3764 if (listener->tcp_connp->conn_sqp ==
3768 * on the listener since we know that the
3769 * listener and eager squeues are the same.
3771 * because neither the eager nor the listener
3775 tcp_send_conn_ind(listener->tcp_connp, mp,
3776 listener->tcp_connp->conn_sqp);
3777 CONN_DEC_REF(listener->tcp_connp);
3779 SQUEUE_ENTER_ONE(listener->tcp_connp->conn_sqp,
3781 listener->tcp_connp, NULL, SQ_FILL,
3784 SQUEUE_ENTER_ONE(listener->tcp_connp->conn_sqp,
3786 listener->tcp_connp, NULL, SQ_NODRAIN,