From ae36dbe3f7b9c962e5567109c527269ada6ad341 Mon Sep 17 00:00:00 2001 From: thorpej Date: Thu, 30 Jul 1998 18:14:00 +0000 Subject: [PATCH] Turn on TCP_NODELAY on the remote tape socket, from FreeBSD. Here is the commit message from Bill Fenner: Turn on TCP_NODELAY on the remote socket, to turn off sender silly window syndrome avoidance. The combination of SWS avoidance and ack-every-other causes low throughput if the block size divided by the MSS is odd (which is true with the default block size and MSS). Turning on TCP_NODELAY disables the Nagle algorithm and sender SWS avoidance. The rdump request/response protocol can not invoke Nagle and cannot cause SWS, so this has no negative effects. Also, put back the code that sets the TOS to "throughput", which seems to have been erroneously removed during the Lite-2 merge. --- sbin/dump/dumprmt.c | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) diff --git a/sbin/dump/dumprmt.c b/sbin/dump/dumprmt.c index 485f38ecd57b..ca4a61487bc6 100644 --- a/sbin/dump/dumprmt.c +++ b/sbin/dump/dumprmt.c @@ -1,4 +1,4 @@ -/* $NetBSD: dumprmt.c,v 1.20 1998/03/30 01:54:40 mrg Exp $ */ +/* $NetBSD: dumprmt.c,v 1.21 1998/07/30 18:14:00 thorpej Exp $ */ /*- * Copyright (c) 1980, 1993 @@ -38,7 +38,7 @@ #if 0 static char sccsid[] = "@(#)dumprmt.c 8.3 (Berkeley) 4/28/95"; #else -__RCSID("$NetBSD: dumprmt.c,v 1.20 1998/03/30 01:54:40 mrg Exp $"); +__RCSID("$NetBSD: dumprmt.c,v 1.21 1998/07/30 18:14:00 thorpej Exp $"); #endif #endif /* not lint */ @@ -58,6 +58,7 @@ __RCSID("$NetBSD: dumprmt.c,v 1.20 1998/03/30 01:54:40 mrg Exp $"); #include #include #include +#include #include @@ -132,11 +133,8 @@ rmtgetconn() char *cp; static struct servent *sp = NULL; static struct passwd *pwd = NULL; -#ifdef notdef - static int on = 1; -#endif char *tuser, *name; - int size; + int size, opt; if (sp == NULL) { sp = getservbyname("shell", "tcp"); @@ -172,6 +170,12 @@ rmtgetconn() setsockopt(rmtape, SOL_SOCKET, SO_SNDBUF, &size, sizeof (size)) < 0) size -= TP_BSIZE; (void)setsockopt(rmtape, SOL_SOCKET, SO_RCVBUF, &size, sizeof (size)); + + opt = IPTOS_THROUGHPUT; + (void)setsockopt(rmtape, IPPROTO_IP, IP_TOS, &opt, sizeof (opt)); + + opt = 1; + (void)setsockopt(rmtape, IPPROTO_TCP, TCP_NODELAY, &opt, sizeof (opt)); } static int