This is the mail archive of the ecos-patches@sources.redhat.com mailing list for the eCos project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: FreeBSD TCP retransmissions


Please let me know if this is what you're looking for
...
-- Matt



--- Gary Thomas <gary@mlbassoc.com> wrote:
> Thanks, but could you please redo this as a
> "universal" patch,
> using at least "diff -u"?  The style of patch that
> you've sent
> is very hard to apply or verify.  Also, it looks
> like your email
> tool has wrapped/broken many of the lines making
> this unusable
> as well.  Try sending the patch as an attachment -
> those normally
> make it through unscathed.
> 
> 


__________________________________
Do you Yahoo!?
Exclusive Video Premiere - Britney Spears
http://launch.yahoo.com/promos/britneyspears/
eCos i386-elf:(~/ecos/packages/net/bsd_tcpip)ls
current  CVS
eCos i386-elf:(~/ecos/packages/net/bsd_tcpip)cvs diff -u
cvs diff: Diffing .
cvs diff: Diffing current
Index: current/ChangeLog
===================================================================
RCS file: /ienrcs/cvsintact/ecos/packages/net/bsd_tcpip/current/ChangeLog,v
retrieving revision 1.1
diff -u -r1.1 ChangeLog
--- current/ChangeLog   29 Apr 2003 13:35:52 -0000      1.1
+++ current/ChangeLog   28 Oct 2003 17:30:04 -0000
@@ -1,3 +1,15 @@
+2003-10-28  Matt Jerdonek  <maj1224@yahoo.com>
+
+       * src/sys/netinet/tcp_output.c (tcp_setpersist): Use variable
+       tcp_rexmit_shift_max instead of TCP_MAXRXTSHIFT
+       * src/sys/netinet/tcp_subr.c (tcp_newtcpcb): Add FreeBSD
+       changes to control minimum retransmit time
+       * src/sys/netinet/tcp_timer.c : Use variable tcp_rexmit_shift_max
+       instead of TCP_MAXRXTSHIFT.  Also add FreeBSD changes to control
+       minimum retransmit time
+       * include/netinet/tcp_timer.h : Add external declarations to
+       support above.
+
 2003-04-29  Andrew Lunn  <andrew.lunn@ascom.ch>

        * src/ecos/support.c (cyg_net_malloc): Honour the M_ZERO
cvs diff: Diffing current/cdl
cvs diff: Diffing current/doc
cvs diff: Diffing current/include
cvs diff: Diffing current/include/machine
cvs diff: Diffing current/include/net
cvs diff: Diffing current/include/netinet
Index: current/include/netinet/tcp_timer.h
===================================================================
RCS file: /ienrcs/cvsintact/ecos/packages/net/bsd_tcpip/current/include/netinet/tcp_timer.h,v
retrieving revision 1.1
diff -u -r1.1 tcp_timer.h
--- current/include/netinet/tcp_timer.h 20 May 2002 22:25:01 -0000      1.1
+++ current/include/netinet/tcp_timer.h 28 Oct 2003 16:39:07 -0000
@@ -145,6 +145,8 @@
 extern int tcp_maxidle;                        /* time to drop after starting probes */
 extern int tcp_delacktime;             /* time before sending a delayed ACK */
 extern int tcp_maxpersistidle;
+extern int tcp_rexmit_min;       /* min time between retransmissions */
+extern int tcp_rexmit_shift_max; /* maximum retransmission attempts */
 extern int tcp_msl;
 extern int tcp_ttl;                    /* time to live for TCP segs */
 extern int tcp_backoff[];
cvs diff: Diffing current/include/netinet6
cvs diff: Diffing current/include/netkey
cvs diff: Diffing current/include/sys
cvs diff: Diffing current/src
cvs diff: Diffing current/src/ecos
cvs diff: Diffing current/src/sys
cvs diff: Diffing current/src/sys/kern
cvs diff: Diffing current/src/sys/net
cvs diff: Diffing current/src/sys/netinet
Index: current/src/sys/netinet/tcp_output.c
===================================================================
RCS file: /ienrcs/cvsintact/ecos/packages/net/bsd_tcpip/current/src/sys/netinet/tcp_output.c,v
retrieving revision 1.2
diff -u -r1.2 tcp_output.c
--- current/src/sys/netinet/tcp_output.c        24 Oct 2003 22:54:02 -0000      1.2
+++ current/src/sys/netinet/tcp_output.c        28 Oct 2003 16:39:22 -0000
@@ -943,6 +943,6 @@
        TCPT_RANGESET(tt, t * tcp_backoff[tp->t_rxtshift],
                      TCPTV_PERSMIN, TCPTV_PERSMAX);
        callout_reset(tp->tt_persist, tt, tcp_timer_persist, tp);
-       if (tp->t_rxtshift < TCP_MAXRXTSHIFT)
+       if (tp->t_rxtshift < tcp_rexmit_shift_max)
                tp->t_rxtshift++;
 }
Index: current/src/sys/netinet/tcp_subr.c
===================================================================
RCS file: /ienrcs/cvsintact/ecos/packages/net/bsd_tcpip/current/src/sys/netinet/tcp_subr.c,v
retrieving revision 1.2
diff -u -r1.2 tcp_subr.c
--- current/src/sys/netinet/tcp_subr.c  24 Oct 2003 22:54:02 -0000      1.2
+++ current/src/sys/netinet/tcp_subr.c  28 Oct 2003 16:39:28 -0000
@@ -152,7 +152,7 @@
 static int     tcp_isn_reseed_interval = 0;
 SYSCTL_INT(_net_inet_tcp, OID_AUTO, isn_reseed_interval, CTLFLAG_RW,
     &tcp_isn_reseed_interval, 0, "Seconds between reseeding of ISN secret");
-
+
 static void    tcp_cleartaocache __P((void));
 static void    tcp_notify __P((struct inpcb *, int));

@@ -205,6 +205,7 @@
        tcp_keepintvl = TCPTV_KEEPINTVL;
        tcp_maxpersistidle = TCPTV_KEEP_IDLE;
        tcp_msl = TCPTV_MSL;
+       tcp_rexmit_min = TCPTV_MIN;

        LIST_INIT(&tcb);
        tcbinfo.listhead = &tcb;
@@ -544,7 +545,7 @@
         */
        tp->t_srtt = TCPTV_SRTTBASE;
        tp->t_rttvar = ((TCPTV_RTOBASE - TCPTV_SRTTBASE) << TCP_RTTVAR_SHIFT) / 4;
-       tp->t_rttmin = TCPTV_MIN;
+       tp->t_rttmin = tcp_rexmit_min;
        tp->t_rxtcur = TCPTV_RTOBASE;
        tp->snd_cwnd = TCP_MAXWIN << TCP_MAX_WINSHIFT;
        tp->snd_ssthresh = TCP_MAXWIN << TCP_MAX_WINSHIFT;
Index: current/src/sys/netinet/tcp_timer.c
===================================================================
RCS file: /ienrcs/cvsintact/ecos/packages/net/bsd_tcpip/current/src/sys/netinet/tcp_timer.c,v
retrieving revision 1.2
diff -u -r1.2 tcp_timer.c
--- current/src/sys/netinet/tcp_timer.c 24 Oct 2003 22:54:02 -0000      1.2
+++ current/src/sys/netinet/tcp_timer.c 28 Oct 2003 16:39:34 -0000
@@ -101,6 +101,26 @@
        *(int *)oidp->oid_arg1 = tt;
         return (0);
 }
+static int
+sysctl_rexmitmax_rangecheck(SYSCTL_HANDLER_ARGS)
+{
+       int error, tt;
+
+       tt = *(int *)oidp->oid_arg1;
+
+       error = sysctl_handle_int(oidp, &tt, 0, req);
+       if (error || !req->newptr)
+               return (error);
+
+       if (tt > TCP_MAXRXTSHIFT)
+               return (EINVAL);
+
+       if (tt < 2)
+               return (EINVAL);
+
+       *(int *)oidp->oid_arg1 = tt;
+        return (0);
+}
 #endif
 int    tcp_keepinit;
 SYSCTL_PROC(_net_inet_tcp, TCPCTL_KEEPINIT, keepinit, CTLTYPE_INT|CTLFLAG_RW,
@@ -126,6 +146,14 @@
 static int     always_keepalive = 0;
 SYSCTL_INT(_net_inet_tcp, OID_AUTO, always_keepalive, CTLFLAG_RW,
     &always_keepalive , 0, "Assume SO_KEEPALIVE on all TCP connections");
+
+int    tcp_rexmit_min;
+SYSCTL_PROC(_net_inet_tcp, OID_AUTO, rexmit_min, CTLTYPE_INT|CTLFLAG_RW,
+    &tcp_rexmit_min, 0, sysctl_msec_to_ticks, "I", "Minimum retransmission timeout");
+
+int    tcp_rexmit_shift_max = TCP_MAXRXTSHIFT;
+SYSCTL_PROC(_net_inet_tcp, OID_AUTO, rexmit_shift_max, CTLTYPE_INT|CTLFLAG_RW,
+    &tcp_rexmit_shift_max, 0, sysctl_rexmitmax_rangecheck, "I", "Maximum TCP retransmissions");

 static int     tcp_keepcnt = TCPTV_KEEPCNT;
        /* max idle probes */
@@ -337,7 +365,7 @@
         * (no responses to probes) reaches the maximum
         * backoff that we would use if retransmitting.
         */
-       if (tp->t_rxtshift == TCP_MAXRXTSHIFT &&
+       if (tp->t_rxtshift == tcp_rexmit_shift_max &&
            ((ticks - tp->t_rcvtime) >= tcp_maxpersistidle ||
             (ticks - tp->t_rcvtime) >= TCP_REXMTVAL(tp) * tcp_totbackoff)) {
                tcpstat.tcps_persistdrop++;
@@ -381,8 +409,8 @@
         * been acked within retransmit interval.  Back off
         * to a longer retransmit interval and retransmit one segment.
         */
-       if (++tp->t_rxtshift > TCP_MAXRXTSHIFT) {
-               tp->t_rxtshift = TCP_MAXRXTSHIFT;
+       if (++tp->t_rxtshift > tcp_rexmit_shift_max) {
+               tp->t_rxtshift = tcp_rexmit_shift_max;
                tcpstat.tcps_timeoutdrop++;
                tp = tcp_drop(tp, tp->t_softerror ?
                              tp->t_softerror : ETIMEDOUT);
@@ -426,7 +454,7 @@
         * move the current srtt into rttvar to keep the current
         * retransmit times until then.
         */
-       if (tp->t_rxtshift > TCP_MAXRXTSHIFT / 4) {
+       if (tp->t_rxtshift > tcp_rexmit_shift_max / 4) {
 #ifdef INET6
                if ((tp->t_inpcb->inp_vflag & INP_IPV6) != 0)
                        in6_losing(tp->t_inpcb);
cvs diff: Diffing current/src/sys/netinet6
cvs diff: Diffing current/tests
eCos i386-elf:(~/ecos/packages/net/bsd_tcpip)

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]