Date: Wed, 17 Aug 2011 08:18:46 GMT From: Catalin Nicutar <cnicutar@FreeBSD.org> To: Perforce Change Reviews <perforce@freebsd.org> Subject: PERFORCE change 197759 for review Message-ID: <201108170818.p7H8Ik5f003921@skunkworks.freebsd.org>
index | next in thread | raw e-mail
http://p4web.freebsd.org/@@197759?ac=10 Change 197759 by cnicutar@cnicutar_cronos on 2011/08/17 08:18:09 Change the behavior of TCP_RCVUTO_TIMEOUT to allow the application to impose a per-connection maximum timeout. Affected files ... .. //depot/projects/soc2011/cnicutar_tcputo_9/src/sys/netinet/tcp_syncache.c#5 edit .. //depot/projects/soc2011/cnicutar_tcputo_9/src/sys/netinet/tcp_syncache.h#4 edit .. //depot/projects/soc2011/cnicutar_tcputo_9/src/sys/netinet/tcp_timer.c#4 edit .. //depot/projects/soc2011/cnicutar_tcputo_9/src/sys/netinet/tcp_usrreq.c#3 edit .. //depot/projects/soc2011/cnicutar_tcputo_9/src/sys/netinet/tcp_var.h#5 edit Differences ... ==== //depot/projects/soc2011/cnicutar_tcputo_9/src/sys/netinet/tcp_syncache.c#5 (text+ko) ==== @@ -835,6 +835,7 @@ tp->t_flags |= TF_RCV_UTO; /* Regardless of SCF_RCV_UTO. */ tp->rcv_uto = sc->sc_rcv_uto; + tp->max_uto = sc->sc_max_uto; } if (sc->sc_flags & SCF_ECN) @@ -1053,7 +1054,7 @@ * socket accept suggestions?). */ uint16_t rcv_uto_tf; - uint32_t rcv_uto = 0; + uint32_t rcv_uto = 0, max_uto = 0; INP_INFO_WLOCK_ASSERT(&V_tcbinfo); INP_WLOCK_ASSERT(inp); /* listen socket */ @@ -1089,6 +1090,7 @@ /* Remember received UTO regardless of disposition and clear it. */ rcv_uto_tf = (tp->t_flags & TF_RCV_UTO) ? SCF_RCV_UTO : 0; rcv_uto = tp->rcv_uto; + max_uto = tp->max_uto; tp->rcv_uto = 0; /* By the time we drop the lock these should no longer be used. */ @@ -1307,6 +1309,7 @@ /* Inherit received UTO, regardless of disposition. */ sc->sc_flags |= rcv_uto_tf; sc->sc_rcv_uto = rcv_uto; + sc->sc_max_uto = max_uto; if (V_tcp_syncookies) { syncookie_generate(sch, sc, &flowtmp); ==== //depot/projects/soc2011/cnicutar_tcputo_9/src/sys/netinet/tcp_syncache.h#4 (text+ko) ==== @@ -84,6 +84,7 @@ u_int32_t sc_snd_uto; /* Sent UTO (seconds) */ u_int32_t sc_rcv_uto; /* Received UTO (seconds) */ + u_int32_t sc_max_uto; /* Maximum UTO (seconds) */ }; /* ==== //depot/projects/soc2011/cnicutar_tcputo_9/src/sys/netinet/tcp_timer.c#4 (text+ko) ==== @@ -504,9 +504,9 @@ * compute how much time we've got left. */ uto_left = 0; - if (tp->t_flags & TF_RCV_UTO) + if (tp->t_flags & TF_RCV_UTO && tp->rcv_uto) /* Clamping the received value. */ - uto_left = min(V_uto_max_timeout, + uto_left = min(tp->max_uto, max(V_uto_min_timeout, tp->rcv_uto)); /* Taking the longer timeout. */ ==== //depot/projects/soc2011/cnicutar_tcputo_9/src/sys/netinet/tcp_usrreq.c#3 (text+ko) ==== @@ -1356,8 +1356,15 @@ if (optval <= 0) /* This connection will ignore suggestions. */ tp->t_flags &= ~TF_RCV_UTO; - else + else { tp->t_flags |= TF_RCV_UTO; + /* + * If optval > 1, we'll use it as the max + * acceptable suggestion. + */ + tp->max_uto = (optval > 1) ? + optval : V_uto_max_timeout; + } INP_WUNLOCK(inp); break; case TCP_NODELAY: ==== //depot/projects/soc2011/cnicutar_tcputo_9/src/sys/netinet/tcp_var.h#5 (text+ko) ==== @@ -203,12 +203,13 @@ struct cc_var *ccv; /* congestion control specific vars */ struct osd *osd; /* storage for Khelp module data */ - uint32_t t_ispare[9]; /* 4 keep timers, 2 UTO, 3 TBD */ + uint32_t t_ispare[8]; /* 4 keep timers, 1 UTO, 3 TBD */ void *t_pspare2[4]; /* 4 TBD */ uint64_t _pad[6]; /* 6 TBD (1-2 CC/RTT?) */ uint32_t snd_uto; /* sent timeout (seconds) */ uint32_t rcv_uto; /* received suggestion (seconds) */ + uint32_t max_uto; /* max received uto (seconds) */ int t_suto; /* uto starting time (ticks) */ };help
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201108170818.p7H8Ik5f003921>
