Lines Matching refs:xprt

61  *   but it involves locking (master's xprt->xp_thread_lock).
77 * an `xprt-ready' queue and a creator thread (see below). Threads in
123 * If there is none we take a hint from the pool's `xprt-ready' queue.
138 * The `xprt-ready' queue.
141 * this search more efficient each pool has an `xprt-ready' queue.
143 * inserts a pointer to the transport into the `xprt-ready' queue. A
147 * case we try the next hint. The `xprt-ready' queue has fixed size (by
152 * Both the svc_poll() loop and the `xprt-ready' queue are optimized
237 * Size of the `xprt-ready' queue.
268 * A node for the `xprt-ready' queue.
314 #define RELE_PROC(xprt) \
315 ((xprt)->xp_type == T_RDMA ? rdma_rele : \
316 (((xprt)->xp_type == T_CLTS) ? rpc_rele : mir_rele))
324 #define version_keepquiet(xprt) (FALSE)
410 /* Destroy `xprt-ready' queue */
619 /* Allocate and initialize the `xprt-ready' queue */
622 /* Initialize doubly-linked xprt list */
783 svc_xprt_register(SVCMASTERXPRT *xprt, int id)
815 xprt->xp_pool = pool;
822 pool->p_lhead = xprt->xp_prev = xprt->xp_next = xprt;
827 xprt->xp_next = next;
828 xprt->xp_prev = prev;
830 pool->p_lhead = prev->xp_next = next->xp_prev = xprt;
846 svc_xprt_unregister(SVCMASTERXPRT *xprt)
848 SVCPOOL *pool = xprt->xp_pool;
851 * Unlink xprt from the list.
852 * If the list head points to this xprt then move it
853 * to the next xprt or reset to NULL if this is the last
854 * xprt in the list.
858 if (xprt == xprt->xp_next)
861 SVCMASTERXPRT *next = xprt->xp_next;
862 SVCMASTERXPRT *prev = xprt->xp_prev;
867 if (pool->p_lhead == xprt)
871 xprt->xp_next = xprt->xp_prev = NULL;
887 * Initialize an `xprt-ready' queue for a given pool.
911 * - insert a pointer to xprt into the xprt-ready queue (FIFO)
912 * - if the xprt-ready queue is full turn the overflow flag on.
918 svc_xprt_qput(SVCPOOL *pool, SVCMASTERXPRT *xprt)
938 pool->p_qtop->q_xprt = xprt;
945 * `xprt-ready' queue is empty.
955 SVCMASTERXPRT *xprt;
972 xprt = pool->p_qend->q_xprt;
976 } while (xprt == NULL);
979 return (xprt);
984 * is being destroyed from the xprt-ready queue.
988 svc_xprt_qdelete(SVCPOOL *pool, SVCMASTERXPRT *xprt)
994 * Delete all the references to xprt between the current
998 if (q->q_xprt == xprt)
1013 * a) remove references to this transport from the xprt-ready queue
1021 svc_xprt_cleanup(SVCMASTERXPRT *xprt, bool_t detached)
1023 ASSERT(MUTEX_HELD(&xprt->xp_thread_lock));
1024 ASSERT(xprt->xp_wq == NULL);
1030 if (!detached && xprt->xp_threads == 0 && xprt->xp_closeproc) {
1031 (*(xprt->xp_closeproc)) (xprt);
1034 if (xprt->xp_threads + xprt->xp_detached_threads > 0)
1035 mutex_exit(&xprt->xp_thread_lock);
1037 /* Remove references to xprt from the `xprt-ready' queue */
1038 svc_xprt_qdelete(xprt->xp_pool, xprt);
1040 /* Unregister xprt from the pool's transport list */
1041 svc_xprt_unregister(xprt);
1042 svc_callout_free(xprt);
1043 SVC_DESTROY(xprt);
1058 svc_callout_find(SVCXPRT *xprt, rpcprog_t prog, rpcvers_t vers,
1061 SVC_CALLOUT_TABLE *sct = xprt->xp_sct;
1089 svc_callout_free(SVCMASTERXPRT *xprt)
1091 SVC_CALLOUT_TABLE *sct = xprt->xp_sct;
1282 * Note: the xprt's xp_svc_lock is not held while the service's dispatch
1472 svc_clone_link(SVCMASTERXPRT *xprt, SVCXPRT *clone_xprt, SVCXPRT *clone_xprt2)
1483 mutex_enter(&xprt->xp_thread_lock);
1484 xprt->xp_threads++;
1485 mutex_exit(&xprt->xp_thread_lock);
1491 clone_xprt->xp_master = xprt;
1494 clone_xprt->xp_xpc = xprt->xp_xpc;
1515 SVCMASTERXPRT *xprt = clone_xprt->xp_master;
1519 ASSERT(xprt->xp_threads > 0);
1522 mutex_enter(&xprt->xp_thread_lock);
1523 xprt->xp_threads--;
1525 /* svc_xprt_cleanup() unlocks xp_thread_lock or destroys xprt */
1526 if (xprt->xp_wq)
1527 mutex_exit(&xprt->xp_thread_lock);
1529 svc_xprt_cleanup(xprt, FALSE);
1550 SVCMASTERXPRT *xprt = clone_xprt->xp_master;
1554 ASSERT(xprt->xp_detached_threads > 0);
1555 ASSERT(xprt->xp_threads + xprt->xp_detached_threads > 0);
1557 /* Grab xprt->xp_thread_lock and decrement link counts */
1558 mutex_enter(&xprt->xp_thread_lock);
1559 xprt->xp_detached_threads--;
1561 /* svc_xprt_cleanup() unlocks xp_thread_lock or destroys xprt */
1562 if (xprt->xp_wq)
1563 mutex_exit(&xprt->xp_thread_lock);
1565 svc_xprt_cleanup(xprt, TRUE);
1845 svc_poll(SVCPOOL *pool, SVCMASTERXPRT *xprt, SVCXPRT *clone_xprt)
1871 * and then take a hint from the xprt-ready queue or walk
1874 if (xprt && xprt->xp_req_head && (!pool->p_qoverflow ||
1876 mutex_enter(&xprt->xp_req_lock);
1877 if (xprt->xp_req_head) {
1884 return (xprt);
1886 mutex_exit(&xprt->xp_req_lock);
1909 * Get the next transport from the xprt-ready queue.
1939 * If there was no hint in the xprt-ready queue then
1943 * xprt-ready queue; if so, then we need to break
1960 * If there was an overflow in the xprt-ready queue then we
1965 * switch svc_poll() back to taking hints from the xprt-ready
1970 if (xprt == NULL && pool->p_lhead == NULL) {
1980 next = xprt ? xprt->xp_next : pool->p_lhead;
2079 if (xprt && xprt->xp_wq == NULL)
2103 SVCMASTERXPRT *xprt = NULL; /* master transport handle */
2131 next = svc_poll(pool, xprt, clone_xprt);
2148 xprt = NULL;
2186 if (next != xprt) {
2187 if (xprt)
2190 xprt = next;
2254 (*RELE_PROC(xprt)) (clone_xprt->xp_wq, NULL);
2266 SVCMASTERXPRT *xprt = ((void **) q->q_ptr)[0];
2273 mutex_enter(&xprt->xp_req_lock);
2274 pool = xprt->xp_pool;
2275 while ((mp = xprt->xp_req_head) != NULL) {
2277 xprt->xp_req_head = mp->b_next;
2282 (*RELE_PROC(xprt)) (xprt->xp_wq, mp);
2284 mutex_exit(&xprt->xp_req_lock);
2302 SVCMASTERXPRT *xprt = ((void **) q->q_ptr)[0];
2304 if (xprt == NULL) {
2306 * If there is no master xprt associated with this stream,
2314 mutex_enter(&xprt->xp_thread_lock);
2316 ASSERT(xprt->xp_req_head == NULL);
2317 ASSERT(xprt->xp_wq != NULL);
2319 xprt->xp_wq = NULL;
2321 if (xprt->xp_threads == 0) {
2322 SVCPOOL *pool = xprt->xp_pool;
2328 svc_xprt_cleanup(xprt, FALSE);
2346 mutex_enter(&xprt->xp_pool->p_req_lock);
2347 cv_broadcast(&xprt->xp_pool->p_req_cv);
2348 mutex_exit(&xprt->xp_pool->p_req_lock);
2354 mutex_exit(&xprt->xp_thread_lock);
2361 * - insert a hint for svc_poll() into the xprt-ready queue
2369 SVCMASTERXPRT *xprt = ((void **) q->q_ptr)[0];
2370 SVCPOOL *pool = xprt->xp_pool;
2383 * the xprt ready queue and increment the
2386 mutex_enter(&xprt->xp_req_lock);
2388 if (xprt->xp_req_head == NULL)
2389 xprt->xp_req_head = mp;
2391 xprt->xp_req_tail->b_next = mp;
2392 xprt->xp_req_tail = mp;
2396 * Insert a hint into the xprt-ready queue, increment
2401 /* Insert pointer to this transport into the xprt-ready queue */
2402 svc_xprt_qput(pool, xprt);
2431 mutex_exit(&xprt->xp_req_lock);
2538 SVCMASTERXPRT *xprt = clone_xprt->xp_master;
2539 SVCPOOL *pool = xprt->xp_pool;
2546 mutex_enter(&xprt->xp_thread_lock);
2547 xprt->xp_threads--;
2548 xprt->xp_detached_threads++;
2549 mutex_exit(&xprt->xp_thread_lock);
2559 (*RELE_PROC(xprt)) (clone_xprt->xp_wq, NULL);
2575 * to cleanup the pool and destroy the xprt in svc_queueclose()
2580 SVCMASTERXPRT *xprt;
2597 xprt = curr_rec->rtr_xprt_ptr;
2598 q = xprt->xp_wq;
2599 svc_rdma_kstop(xprt);
2601 mutex_enter(&xprt->xp_req_lock);
2602 pool = xprt->xp_pool;
2603 while ((mp = xprt->xp_req_head) != NULL) {
2608 xprt->xp_req_head = mp->b_next;
2621 mutex_exit(&xprt->xp_req_lock);