I believe this will solve the previously reported problems.

    With the original patch if I set net.inet.tcp.sendspace=63 and tried 
    to run xterm from that machine to my local workstation, I got an X error.
    If I set sendspace=31 the xterm process just locked up and did nothing
    until I ^C'd it.

        machine A                       machine B
        w/modified kernel               w/unmodified kernel
        (sysctl's on this machine)

        xterm run on A          -->     display is on B

    With this patch I can set net.inet.tcp.sendspace to anything (63, 31, 1,
    whatever I want) and the xterm will still run.  And yes, the xterm is
    amazingly slow when I set net.inet.tcp.sendspace to 1 :-)

    This patch is relative to -CURRENT but should also work with -STABLE.
        
                                                -Matt

Index: uipc_socket.c
===================================================================
RCS file: /home/ncvs/src/sys/kern/uipc_socket.c,v
retrieving revision 1.60
diff -u -r1.60 uipc_socket.c
--- uipc_socket.c       1999/06/17 23:54:47     1.60
+++ uipc_socket.c       1999/07/22 23:08:38
@@ -413,7 +413,8 @@
        register struct mbuf *m;
        register long space, len, resid;
        int clen = 0, error, s, dontroute, mlen;
-       int atomic = sosendallatonce(so) || top;
+       int atomic = sosendallatonce(so) || top;        /* required atomicy */
+       int try_atomic = atomic;                        /* requested atomicy */
 
        if (uio)
                resid = uio->uio_resid;
@@ -518,6 +519,7 @@
                                mlen = MCLBYTES;
                                len = min(min(mlen, resid), space);
                        } else {
+                               try_atomic = 1;         /* try to optimize */
 nopages:
                                len = min(min(mlen, resid), space);
                                /*
@@ -541,7 +543,7 @@
                                        top->m_flags |= M_EOR;
                                break;
                        }
-                   } while (space > 0 && atomic);
+                   } while (space > 0 && try_atomic);
                    if (dontroute)
                            so->so_options |= SO_DONTROUTE;
                    s = splnet();                               /* XXX */


To Unsubscribe: send mail to majord...@freebsd.org
with "unsubscribe freebsd-hackers" in the body of the message

Reply via email to