LOCAL_CREDIT macro.
SCCS-vsn: sys/netiso/tp_param.h 7.9
SCCS-vsn: sys/netiso/tp_subr.c 7.12
SCCS-vsn: sys/netiso/tp_subr2.c 7.13
*
* %sccs.include.redist.c%
*
- * @(#)tp_param.h 7.8 (Berkeley) %G%
+ * @(#)tp_param.h 7.9 (Berkeley) %G%
*/
/***********************************************************
#if defined(ARGO_DEBUG)&&!defined(LOCAL_CREDIT_EXPAND)
#define LOCAL_CREDIT(tpcb) tp_local_credit(tpcb)
#else
-#define LOCAL_CREDIT( tpcb ) {\
+#define LOCAL_CREDIT(tpcb) {\
register struct sockbuf *xxsb = &((tpcb)->tp_sock->so_rcv);\
- register int xxi = ((xxsb)->sb_hiwat-(xxsb)->sb_cc);\
- register int maxcredit = ((tpcb)->tp_xtd_format?0xffff:0xf);\
- xxi = (xxi<0) ? 0 : ((xxi)>>(tpcb)->tp_tpdusize);\
- xxi = MIN(xxi, maxcredit); \
+ register int xxi = sbspace(xxsb);\
+ xxi = (xxi<0) ? 0 : ((xxi) / (tpcb)->tp_l_tpdusize);\
+ xxi = min(xxi, (tpcb)->tp_maxlcredit); \
if (!(tpcb->tp_cebit_off)) { \
(tpcb)->tp_lcredit = ROUND((tpcb)->tp_win_recv); \
if (xxi < (tpcb)->tp_lcredit) { \
#endif ARGO_DEBUG
#ifdef KERNEL
+#ifdef ARGO_DEBUG
+#include "syslog.h"
+#define printf logpri(LOG_DEBUG),addlog
+#endif
#ifndef tp_NSTATES
*
* %sccs.include.redist.c%
*
- * @(#)tp_subr.c 7.11 (Berkeley) %G%
+ * @(#)tp_subr.c 7.12 (Berkeley) %G%
*/
/***********************************************************
E.e_seq, tpcb->tp_rcvnxt, tpcb->tp_lcredit, 0);
ENDTRACE
- if (tpcb->tp_rsyq == 0 ||
- (tpcb->tp_rsycnt == 0 &&
- (tpcb->tp_sbmax != tpcb->tp_sock->so_rcv.sb_hiwat)))
- tp_rsyset(tpcb);
+ if (tpcb->tp_rsyq == 0)
+ tp_rsyset(tpcb);
uwe = SEQ(tpcb, tpcb->tp_rcvnxt + tpcb->tp_maxlcredit);
if (tpcb->tp_rsyq == 0 ||
!IN_RWINDOW(tpcb, E.e_seq, tpcb->tp_rcvnxt, uwe)) {
{
register struct socket *so = tpcb->tp_sock;
int maxcredit = tpcb->tp_xtd_format ? 0xffff : 0xf;
- caddr_t rsyq;
+ int old_credit = tpcb->tp_maxlcredit;
+ caddr_t rsyq;
- tpcb->tp_sbmax = so->so_rcv.sb_hiwat;
tpcb->tp_maxlcredit = maxcredit = min(maxcredit,
(so->so_rcv.sb_hiwat + tpcb->tp_l_tpdusize)/ tpcb->tp_l_tpdusize);
+ if (old_credit == tpcb->tp_maxlcredit && tpcb->tp_rsyq != 0)
+ return;
maxcredit *= sizeof(struct mbuf *);
if (tpcb->tp_rsyq)
tp_rsyflush(tpcb);
*
* %sccs.include.redist.c%
*
- * @(#)tp_subr2.c 7.12 (Berkeley) %G%
+ * @(#)tp_subr2.c 7.13 (Berkeley) %G%
*/
/***********************************************************
tpcb->tp_seqhalf = tpcb->tp_seqbit >> 1;
tpcb->tp_dt_ticks =
MAX(tpcb->tp_dt_ticks, (tpcb->tp_peer_acktime + 2));
-
+ (void) tp_rsyset(tpcb);
+
}
/*