Lines Matching +full:static +full:- +full:beta
3 /*-
4 * SPDX-License-Identifier: BSD-3-Clause
11 * - Redistributions of source code must retain the above copyright notice,
13 * - Redistributions in binary form must reproduce the above copyright notice,
16 * - Neither the name of Sun Microsystems, Inc. nor the names of its
33 * Copyright (c) 1986-1991 by Sun Microsystems Inc.
62 * Disable RPC exponential back-off for FreeBSD.org systems.
69 static bool_t time_not_ok(struct timeval *);
70 static enum clnt_stat clnt_dg_call(CLIENT *, struct rpc_callextra *,
72 static void clnt_dg_geterr(CLIENT *, struct rpc_err *);
73 static bool_t clnt_dg_freeres(CLIENT *, xdrproc_t, void *);
74 static void clnt_dg_abort(CLIENT *);
75 static bool_t clnt_dg_control(CLIENT *, u_int, void *);
76 static void clnt_dg_close(CLIENT *);
77 static void clnt_dg_destroy(CLIENT *);
78 static int clnt_dg_soupcall(struct socket *so, void *arg, int waitflag);
80 static const struct clnt_ops clnt_dg_ops = {
90 static volatile uint32_t rpc_xid = 0;
125 static void clnt_dg_upcallsdone(struct socket *, struct cu_socket *);
152 int cu_sent; /* number of in-flight RPCs */
163 * NB: The rpch->cl_auth is initialized to null authentication.
223 cu->cu_threads = 0; in clnt_dg_create()
224 cu->cu_closing = FALSE; in clnt_dg_create()
225 cu->cu_closed = FALSE; in clnt_dg_create()
226 (void) memcpy(&cu->cu_raddr, svcaddr, (size_t)svcaddr->sa_len); in clnt_dg_create()
227 cu->cu_rlen = svcaddr->sa_len; in clnt_dg_create()
229 cu->cu_wait.tv_sec = 3; /* heuristically chosen */ in clnt_dg_create()
230 cu->cu_wait.tv_usec = 0; in clnt_dg_create()
231 cu->cu_total.tv_sec = -1; in clnt_dg_create()
232 cu->cu_total.tv_usec = -1; in clnt_dg_create()
233 cu->cu_sendsz = sendsz; in clnt_dg_create()
234 cu->cu_recvsz = recvsz; in clnt_dg_create()
235 cu->cu_async = FALSE; in clnt_dg_create()
236 cu->cu_connect = FALSE; in clnt_dg_create()
237 cu->cu_connected = FALSE; in clnt_dg_create()
238 cu->cu_waitchan = "rpcrecv"; in clnt_dg_create()
239 cu->cu_waitflag = 0; in clnt_dg_create()
240 cu->cu_cwnd = MAXCWND / 2; in clnt_dg_create()
241 cu->cu_sent = 0; in clnt_dg_create()
242 cu->cu_cwnd_wait = FALSE; in clnt_dg_create()
250 xdrmem_create(&xdrs, cu->cu_mcallc, MCALL_MSG_SIZE, XDR_ENCODE); in clnt_dg_create()
256 cu->cu_mcalllen = XDR_GETPOS(&xdrs); in clnt_dg_create()
263 cu->cu_closeit = FALSE; in clnt_dg_create()
264 cu->cu_socket = so; in clnt_dg_create()
272 sb = &so->so_rcv; in clnt_dg_create()
275 if (sb->sb_upcall) { in clnt_dg_create()
276 if (sb->sb_upcall != clnt_dg_soupcall) { in clnt_dg_create()
281 cs = (struct cu_socket *) sb->sb_upcallarg; in clnt_dg_create()
282 mtx_lock(&cs->cs_lock); in clnt_dg_create()
283 cs->cs_refs++; in clnt_dg_create()
284 mtx_unlock(&cs->cs_lock); in clnt_dg_create()
287 * We are the first on this socket - allocate the in clnt_dg_create()
293 if (sb->sb_upcall) { in clnt_dg_create()
300 mtx_init(&cs->cs_lock, "cs->cs_lock", NULL, MTX_DEF); in clnt_dg_create()
301 cs->cs_refs = 1; in clnt_dg_create()
302 cs->cs_upcallrefs = 0; in clnt_dg_create()
303 TAILQ_INIT(&cs->cs_pending); in clnt_dg_create()
308 cl->cl_refs = 1; in clnt_dg_create()
309 cl->cl_ops = &clnt_dg_ops; in clnt_dg_create()
310 cl->cl_private = (caddr_t)(void *)cu; in clnt_dg_create()
311 cl->cl_auth = authnone_create(); in clnt_dg_create()
312 cl->cl_tp = NULL; in clnt_dg_create()
313 cl->cl_netid = NULL; in clnt_dg_create()
322 static enum clnt_stat
331 struct cu_data *cu = (struct cu_data *)cl->cl_private; in clnt_dg_call()
340 int retrans; /* number of re-transmits so far */ in clnt_dg_call()
352 cs = cu->cu_socket->so_rcv.sb_upcallarg; in clnt_dg_call()
355 mtx_lock(&cs->cs_lock); in clnt_dg_call()
357 if (cu->cu_closing || cu->cu_closed) { in clnt_dg_call()
358 mtx_unlock(&cs->cs_lock); in clnt_dg_call()
362 cu->cu_threads++; in clnt_dg_call()
365 auth = ext->rc_auth; in clnt_dg_call()
366 errp = &ext->rc_err; in clnt_dg_call()
368 auth = cl->cl_auth; in clnt_dg_call()
369 errp = &cu->cu_error; in clnt_dg_call()
372 cr->cr_client = cl; in clnt_dg_call()
373 cr->cr_mrep = NULL; in clnt_dg_call()
374 cr->cr_error = 0; in clnt_dg_call()
376 if (cu->cu_total.tv_usec == -1) { in clnt_dg_call()
379 tvp = &cu->cu_total; /* use default timeout */ in clnt_dg_call()
381 if (tvp->tv_sec || tvp->tv_usec) in clnt_dg_call()
386 if (cu->cu_connect && !cu->cu_connected) { in clnt_dg_call()
387 mtx_unlock(&cs->cs_lock); in clnt_dg_call()
388 error = soconnect(cu->cu_socket, in clnt_dg_call()
389 (struct sockaddr *)&cu->cu_raddr, curthread); in clnt_dg_call()
390 mtx_lock(&cs->cs_lock); in clnt_dg_call()
392 errp->re_errno = error; in clnt_dg_call()
393 errp->re_status = stat = RPC_CANTSEND; in clnt_dg_call()
396 cu->cu_connected = 1; in clnt_dg_call()
398 if (cu->cu_connected) in clnt_dg_call()
401 sa = (struct sockaddr *)&cu->cu_raddr; in clnt_dg_call()
404 if (ext && ext->rc_timers) { in clnt_dg_call()
405 rt = ext->rc_timers; in clnt_dg_call()
406 if (!rt->rt_rtxcur) in clnt_dg_call()
407 rt->rt_rtxcur = tvtohz(&cu->cu_wait); in clnt_dg_call()
408 retransmit_time = next_sendtime = rt->rt_rtxcur; in clnt_dg_call()
411 retransmit_time = next_sendtime = tvtohz(&cu->cu_wait); in clnt_dg_call()
417 mtx_assert(&cs->cs_lock, MA_OWNED); in clnt_dg_call()
422 mtx_unlock(&cs->cs_lock); in clnt_dg_call()
425 KASSERT(cu->cu_mcalllen <= MHLEN, ("RPC header too big")); in clnt_dg_call()
426 bcopy(cu->cu_mcallc, mreq->m_data, cu->cu_mcalllen); in clnt_dg_call()
427 mreq->m_len = cu->cu_mcalllen; in clnt_dg_call()
436 if (cu->cu_async == TRUE && args == NULL) in clnt_dg_call()
442 errp->re_status = stat = RPC_CANTENCODEARGS; in clnt_dg_call()
443 mtx_lock(&cs->cs_lock); in clnt_dg_call()
446 mreq->m_pkthdr.len = m_length(mreq, NULL); in clnt_dg_call()
448 cr->cr_xid = xid; in clnt_dg_call()
449 mtx_lock(&cs->cs_lock); in clnt_dg_call()
454 while (cu->cu_sent >= cu->cu_cwnd) { in clnt_dg_call()
455 cu->cu_cwnd_wait = TRUE; in clnt_dg_call()
456 error = msleep(&cu->cu_cwnd_wait, &cs->cs_lock, in clnt_dg_call()
457 cu->cu_waitflag, "rpccwnd", 0); in clnt_dg_call()
459 errp->re_errno = error; in clnt_dg_call()
461 errp->re_status = stat = RPC_INTR; in clnt_dg_call()
463 errp->re_status = stat = RPC_CANTSEND; in clnt_dg_call()
467 cu->cu_sent += CWNDSCALE; in clnt_dg_call()
469 TAILQ_INSERT_TAIL(&cs->cs_pending, cr, cr_link); in clnt_dg_call()
470 mtx_unlock(&cs->cs_lock); in clnt_dg_call()
475 error = sosend(cu->cu_socket, sa, NULL, mreq, NULL, 0, curthread); in clnt_dg_call()
479 * sub-optimal code appears here because we have in clnt_dg_call()
484 reply_msg.acpted_rply.ar_verf.oa_base = cr->cr_verf; in clnt_dg_call()
489 mtx_lock(&cs->cs_lock); in clnt_dg_call()
491 TAILQ_REMOVE(&cs->cs_pending, cr, cr_link); in clnt_dg_call()
492 errp->re_errno = error; in clnt_dg_call()
493 errp->re_status = stat = RPC_CANTSEND; in clnt_dg_call()
494 cu->cu_sent -= CWNDSCALE; in clnt_dg_call()
495 if (cu->cu_cwnd_wait) { in clnt_dg_call()
496 cu->cu_cwnd_wait = FALSE; in clnt_dg_call()
497 wakeup(&cu->cu_cwnd_wait); in clnt_dg_call()
506 if (cr->cr_error) { in clnt_dg_call()
507 TAILQ_REMOVE(&cs->cs_pending, cr, cr_link); in clnt_dg_call()
508 errp->re_errno = cr->cr_error; in clnt_dg_call()
509 errp->re_status = stat = RPC_CANTRECV; in clnt_dg_call()
510 cu->cu_sent -= CWNDSCALE; in clnt_dg_call()
511 if (cu->cu_cwnd_wait) { in clnt_dg_call()
512 cu->cu_cwnd_wait = FALSE; in clnt_dg_call()
513 wakeup(&cu->cu_cwnd_wait); in clnt_dg_call()
517 if (cr->cr_mrep) { in clnt_dg_call()
518 TAILQ_REMOVE(&cs->cs_pending, cr, cr_link); in clnt_dg_call()
519 cu->cu_sent -= CWNDSCALE; in clnt_dg_call()
520 if (cu->cu_cwnd_wait) { in clnt_dg_call()
521 cu->cu_cwnd_wait = FALSE; in clnt_dg_call()
522 wakeup(&cu->cu_cwnd_wait); in clnt_dg_call()
528 * Hack to provide rpc-based message passing in clnt_dg_call()
531 TAILQ_REMOVE(&cs->cs_pending, cr, cr_link); in clnt_dg_call()
532 errp->re_status = stat = RPC_TIMEDOUT; in clnt_dg_call()
533 cu->cu_sent -= CWNDSCALE; in clnt_dg_call()
534 if (cu->cu_cwnd_wait) { in clnt_dg_call()
535 cu->cu_cwnd_wait = FALSE; in clnt_dg_call()
536 wakeup(&cu->cu_cwnd_wait); in clnt_dg_call()
548 tv -= time_waited; in clnt_dg_call()
551 if (cu->cu_closing || cu->cu_closed) { in clnt_dg_call()
553 cr->cr_error = ESHUTDOWN; in clnt_dg_call()
555 error = msleep(cr, &cs->cs_lock, in clnt_dg_call()
556 cu->cu_waitflag, cu->cu_waitchan, tv); in clnt_dg_call()
562 TAILQ_REMOVE(&cs->cs_pending, cr, cr_link); in clnt_dg_call()
563 cu->cu_sent -= CWNDSCALE; in clnt_dg_call()
564 if (cu->cu_cwnd_wait) { in clnt_dg_call()
565 cu->cu_cwnd_wait = FALSE; in clnt_dg_call()
566 wakeup(&cu->cu_cwnd_wait); in clnt_dg_call()
575 if (cr->cr_error) { in clnt_dg_call()
576 errp->re_errno = cr->cr_error; in clnt_dg_call()
577 errp->re_status = stat = RPC_CANTRECV; in clnt_dg_call()
581 cu->cu_cwnd += (CWNDSCALE * CWNDSCALE in clnt_dg_call()
582 + cu->cu_cwnd / 2) / cu->cu_cwnd; in clnt_dg_call()
583 if (cu->cu_cwnd > MAXCWND) in clnt_dg_call()
584 cu->cu_cwnd = MAXCWND; in clnt_dg_call()
593 rtt = ticks - starttime + 1; in clnt_dg_call()
601 * RTTVAR = (1-beta) * RTTVAR + beta * |SRTT-R| in clnt_dg_call()
602 * SRTT = (1-alpha) * SRTT + alpha * R in clnt_dg_call()
604 * where alpha = 0.125 and beta = 0.25. in clnt_dg_call()
610 if (rt->rt_srtt == 0) { in clnt_dg_call()
611 rt->rt_srtt = rtt; in clnt_dg_call()
612 rt->rt_deviate = rtt / 2; in clnt_dg_call()
614 int32_t error = rtt - rt->rt_srtt; in clnt_dg_call()
615 rt->rt_srtt += error / 8; in clnt_dg_call()
616 error = abs(error) - rt->rt_deviate; in clnt_dg_call()
617 rt->rt_deviate += error / 4; in clnt_dg_call()
619 rt->rt_rtxcur = rt->rt_srtt + 4*rt->rt_deviate; in clnt_dg_call()
628 * re-send the request. in clnt_dg_call()
631 errp->re_errno = error; in clnt_dg_call()
633 errp->re_status = stat = RPC_INTR; in clnt_dg_call()
635 errp->re_status = stat = RPC_CANTRECV; in clnt_dg_call()
639 time_waited = ticks - starttime; in clnt_dg_call()
643 errp->re_errno = EWOULDBLOCK; in clnt_dg_call()
644 errp->re_status = stat = RPC_TIMEDOUT; in clnt_dg_call()
650 cu->cu_cwnd /= 2; in clnt_dg_call()
651 if (cu->cu_cwnd < CWNDSCALE) in clnt_dg_call()
652 cu->cu_cwnd = CWNDSCALE; in clnt_dg_call()
653 if (ext && ext->rc_feedback) { in clnt_dg_call()
654 mtx_unlock(&cs->cs_lock); in clnt_dg_call()
656 ext->rc_feedback(FEEDBACK_REXMIT1, in clnt_dg_call()
657 proc, ext->rc_feedback_arg); in clnt_dg_call()
659 ext->rc_feedback(FEEDBACK_REXMIT2, in clnt_dg_call()
660 proc, ext->rc_feedback_arg); in clnt_dg_call()
661 mtx_lock(&cs->cs_lock); in clnt_dg_call()
663 if (cu->cu_closing || cu->cu_closed) { in clnt_dg_call()
664 errp->re_errno = ESHUTDOWN; in clnt_dg_call()
665 errp->re_status = stat = RPC_CANTRECV; in clnt_dg_call()
675 cu->cu_sent += CWNDSCALE; in clnt_dg_call()
676 TAILQ_INSERT_TAIL(&cs->cs_pending, cr, cr_link); in clnt_dg_call()
684 mtx_unlock(&cs->cs_lock); in clnt_dg_call()
686 if (ext && ext->rc_feedback) in clnt_dg_call()
687 ext->rc_feedback(FEEDBACK_OK, proc, ext->rc_feedback_arg); in clnt_dg_call()
689 xdrmbuf_create(&xdrs, cr->cr_mrep, XDR_DECODE); in clnt_dg_call()
691 cr->cr_mrep = NULL; in clnt_dg_call()
696 errp->re_status = stat = RPC_SUCCESS; in clnt_dg_call()
698 stat = _seterr_reply(&reply_msg, &(cu->cu_error)); in clnt_dg_call()
700 if (errp->re_status == RPC_SUCCESS) { in clnt_dg_call()
705 errp->re_status = stat = RPC_AUTHERROR; in clnt_dg_call()
706 errp->re_why = AUTH_INVALIDRESP; in clnt_dg_call()
708 auth->ah_cred.oa_flavor == RPCSEC_GSS) { in clnt_dg_call()
726 mtx_lock(&cs->cs_lock); in clnt_dg_call()
727 cu->cu_sent += CWNDSCALE; in clnt_dg_call()
728 TAILQ_INSERT_TAIL(&cs->cs_pending, in clnt_dg_call()
730 cr->cr_mrep = NULL; in clnt_dg_call()
745 nrefreshes--; in clnt_dg_call()
747 mtx_lock(&cs->cs_lock); in clnt_dg_call()
753 errp->re_status = stat = RPC_CANTDECODERES; in clnt_dg_call()
757 mtx_lock(&cs->cs_lock); in clnt_dg_call()
759 mtx_assert(&cs->cs_lock, MA_OWNED); in clnt_dg_call()
763 if (cr->cr_mrep) in clnt_dg_call()
764 m_freem(cr->cr_mrep); in clnt_dg_call()
766 cu->cu_threads--; in clnt_dg_call()
767 if (cu->cu_closing) in clnt_dg_call()
770 mtx_unlock(&cs->cs_lock); in clnt_dg_call()
780 static void
783 struct cu_data *cu = (struct cu_data *)cl->cl_private; in clnt_dg_geterr()
785 *errp = cu->cu_error; in clnt_dg_geterr()
788 static bool_t
801 static void
806 static bool_t
809 struct cu_data *cu = (struct cu_data *)cl->cl_private; in clnt_dg_control()
813 cs = cu->cu_socket->so_rcv.sb_upcallarg; in clnt_dg_control()
814 mtx_lock(&cs->cs_lock); in clnt_dg_control()
818 cu->cu_closeit = TRUE; in clnt_dg_control()
819 mtx_unlock(&cs->cs_lock); in clnt_dg_control()
822 cu->cu_closeit = FALSE; in clnt_dg_control()
823 mtx_unlock(&cs->cs_lock); in clnt_dg_control()
829 mtx_unlock(&cs->cs_lock); in clnt_dg_control()
835 mtx_unlock(&cs->cs_lock); in clnt_dg_control()
838 cu->cu_total = *(struct timeval *)info; in clnt_dg_control()
841 *(struct timeval *)info = cu->cu_total; in clnt_dg_control()
845 mtx_unlock(&cs->cs_lock); in clnt_dg_control()
848 cu->cu_wait = *(struct timeval *)info; in clnt_dg_control()
851 *(struct timeval *)info = cu->cu_wait; in clnt_dg_control()
855 * Slightly different semantics to userland - we use in clnt_dg_control()
858 memcpy(info, &cu->cu_raddr, cu->cu_raddr.ss_len); in clnt_dg_control()
862 (void) memcpy(&cu->cu_raddr, addr, addr->sa_len); in clnt_dg_control()
871 atomic_store_32(&rpc_xid, *(uint32_t *)info - 1); in clnt_dg_control()
882 ntohl(*(uint32_t *)(void *)(cu->cu_mcallc + in clnt_dg_control()
887 *(uint32_t *)(void *)(cu->cu_mcallc + 4 * BYTES_PER_XDR_UNIT) in clnt_dg_control()
899 ntohl(*(uint32_t *)(void *)(cu->cu_mcallc + in clnt_dg_control()
904 *(uint32_t *)(void *)(cu->cu_mcallc + 3 * BYTES_PER_XDR_UNIT) in clnt_dg_control()
908 cu->cu_async = *(int *)info; in clnt_dg_control()
911 cu->cu_connect = *(int *)info; in clnt_dg_control()
914 cu->cu_waitchan = (const char *)info; in clnt_dg_control()
917 *(const char **) info = cu->cu_waitchan; in clnt_dg_control()
921 cu->cu_waitflag = PCATCH; in clnt_dg_control()
923 cu->cu_waitflag = 0; in clnt_dg_control()
926 if (cu->cu_waitflag) in clnt_dg_control()
932 mtx_unlock(&cs->cs_lock); in clnt_dg_control()
935 mtx_unlock(&cs->cs_lock); in clnt_dg_control()
939 static void
942 struct cu_data *cu = (struct cu_data *)cl->cl_private; in clnt_dg_close()
946 cs = cu->cu_socket->so_rcv.sb_upcallarg; in clnt_dg_close()
947 mtx_lock(&cs->cs_lock); in clnt_dg_close()
949 if (cu->cu_closed) { in clnt_dg_close()
950 mtx_unlock(&cs->cs_lock); in clnt_dg_close()
954 if (cu->cu_closing) { in clnt_dg_close()
955 while (cu->cu_closing) in clnt_dg_close()
956 msleep(cu, &cs->cs_lock, 0, "rpcclose", 0); in clnt_dg_close()
957 KASSERT(cu->cu_closed, ("client should be closed")); in clnt_dg_close()
958 mtx_unlock(&cs->cs_lock); in clnt_dg_close()
966 cu->cu_closing = TRUE; in clnt_dg_close()
967 TAILQ_FOREACH(cr, &cs->cs_pending, cr_link) { in clnt_dg_close()
968 if (cr->cr_client == cl) { in clnt_dg_close()
969 cr->cr_xid = 0; in clnt_dg_close()
970 cr->cr_error = ESHUTDOWN; in clnt_dg_close()
975 while (cu->cu_threads) in clnt_dg_close()
976 msleep(cu, &cs->cs_lock, 0, "rpcclose", 0); in clnt_dg_close()
978 cu->cu_closing = FALSE; in clnt_dg_close()
979 cu->cu_closed = TRUE; in clnt_dg_close()
981 mtx_unlock(&cs->cs_lock); in clnt_dg_close()
985 static void
988 struct cu_data *cu = (struct cu_data *)cl->cl_private; in clnt_dg_destroy()
993 cs = cu->cu_socket->so_rcv.sb_upcallarg; in clnt_dg_destroy()
996 SOCK_RECVBUF_LOCK(cu->cu_socket); in clnt_dg_destroy()
997 mtx_lock(&cs->cs_lock); in clnt_dg_destroy()
999 cs->cs_refs--; in clnt_dg_destroy()
1000 if (cs->cs_refs == 0) { in clnt_dg_destroy()
1001 mtx_unlock(&cs->cs_lock); in clnt_dg_destroy()
1002 soupcall_clear(cu->cu_socket, SO_RCV); in clnt_dg_destroy()
1003 clnt_dg_upcallsdone(cu->cu_socket, cs); in clnt_dg_destroy()
1004 SOCK_RECVBUF_UNLOCK(cu->cu_socket); in clnt_dg_destroy()
1005 mtx_destroy(&cs->cs_lock); in clnt_dg_destroy()
1009 mtx_unlock(&cs->cs_lock); in clnt_dg_destroy()
1010 SOCK_RECVBUF_UNLOCK(cu->cu_socket); in clnt_dg_destroy()
1014 if (cu->cu_closeit && lastsocketref) { in clnt_dg_destroy()
1015 so = cu->cu_socket; in clnt_dg_destroy()
1016 cu->cu_socket = NULL; in clnt_dg_destroy()
1022 if (cl->cl_netid && cl->cl_netid[0]) in clnt_dg_destroy()
1023 mem_free(cl->cl_netid, strlen(cl->cl_netid) +1); in clnt_dg_destroy()
1024 if (cl->cl_tp && cl->cl_tp[0]) in clnt_dg_destroy()
1025 mem_free(cl->cl_tp, strlen(cl->cl_tp) +1); in clnt_dg_destroy()
1031 * Make sure that the time is not garbage. -1 value is allowed.
1033 static bool_t
1036 return (t->tv_sec < -1 || t->tv_sec > 100000000 || in time_not_ok()
1037 t->tv_usec < -1 || t->tv_usec > 1000000); in time_not_ok()
1051 cs->cs_upcallrefs++; in clnt_dg_soupcall()
1072 mtx_lock(&cs->cs_lock); in clnt_dg_soupcall()
1073 TAILQ_FOREACH(cr, &cs->cs_pending, cr_link) { in clnt_dg_soupcall()
1074 cr->cr_xid = 0; in clnt_dg_soupcall()
1075 cr->cr_error = error; in clnt_dg_soupcall()
1078 mtx_unlock(&cs->cs_lock); in clnt_dg_soupcall()
1085 if (m->m_len < sizeof(xid) && m_length(m, NULL) < sizeof(xid)) { in clnt_dg_soupcall()
1099 mtx_lock(&cs->cs_lock); in clnt_dg_soupcall()
1101 TAILQ_FOREACH(cr, &cs->cs_pending, cr_link) { in clnt_dg_soupcall()
1102 if (cr->cr_xid == xid) { in clnt_dg_soupcall()
1105 * reply mbuf in cr->cr_mrep. Set the in clnt_dg_soupcall()
1111 cr->cr_xid = 0; in clnt_dg_soupcall()
1112 cr->cr_mrep = m; in clnt_dg_soupcall()
1113 cr->cr_error = 0; in clnt_dg_soupcall()
1119 mtx_unlock(&cs->cs_lock); in clnt_dg_soupcall()
1123 * it - its probably a repeated reply. in clnt_dg_soupcall()
1128 cs->cs_upcallrefs--; in clnt_dg_soupcall()
1129 if (cs->cs_upcallrefs < 0) in clnt_dg_soupcall()
1131 if (cs->cs_upcallrefs == 0) in clnt_dg_soupcall()
1132 wakeup(&cs->cs_upcallrefs); in clnt_dg_soupcall()
1139 static void
1145 while (cs->cs_upcallrefs > 0) in clnt_dg_upcallsdone()
1146 (void) msleep(&cs->cs_upcallrefs, SOCKBUF_MTX(&so->so_rcv), 0, in clnt_dg_upcallsdone()