From owner-freebsd-hackers Thu Feb 6 14:21:32 1997 Return-Path: Received: (from root@localhost) by freefall.freebsd.org (8.8.5/8.8.5) id OAA10550 for hackers-outgoing; Thu, 6 Feb 1997 14:21:32 -0800 (PST) Received: from mailgate.wasantara.net.id ([202.159.65.166]) by freefall.freebsd.org (8.8.5/8.8.5) with SMTP id OAA10506; Thu, 6 Feb 1997 14:21:18 -0800 (PST) Received: from bandung.wasantara.net.id (bandung.wasantara.net.id [202.159.69.35]) by mailgate.wasantara.net.id (8.6.11/8.6.9) with ESMTP id FAA14083; Fri, 7 Feb 1997 05:28:25 +0700 Date: Fri, 7 Feb 1997 05:28:25 +0700 Received: from BANDUNG/SpoolDir by bandung.wasantara.net.id (Mercury 1.21); 7 Feb 97 06:11:53 GMT+0700 Received: from SpoolDir by BANDUNG (Mercury 1.21); 7 Feb 97 06:11:35 GMT+0700 Received: from MurdaniDesktop by bandung.wasantara.net.id (Mercury 1.21); 7 Feb 97 06:11:21 GMT+0700 X-Sender: eka@werty.wasantara.net.id (Unverified) X-Mailer: Windows Eudora Light Version 1.5.2 Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" To: freebsd-hackers@FreeBSD.org From: Eka Kelana Subject: Need quick answer Cc: freebsd-bugs@FreeBSD.org, dg@root.com Message-ID: <1522A71DB9@bandung.wasantara.net.id> Sender: owner-hackers@FreeBSD.org X-Loop: FreeBSD.org Precedence: bulk Hi.. I need a good explanation about this code in in_rmx.c: ... if (!rt->rt_rmx.rmx_sendpipe && !(rt->rt_rmx.rmx_locks & RTV_SPIPE)) rt->rt_rmx.rmx_sendpipe = tcp_sendspace; if (!rt->rt_rmx.rmx_recvpipe && !(rt->rt_rmx.rmx_locks & RTV_RPIPE)) rt->rt_rmx.rmx_recvpipe = tcp_recvspace; ... because this code affect the socket buffer size (sb_hiwat) in tcp_mss() function. I experienced that it wouldn't allow user program to set the socket buffer size. The code in tcp_mss() function is: ... #ifdef RTV_RPIPE if ((bufsize = rt->rt_rmx.rmx_recvpipe) == 0) #endif bufsize = so->so_rcv.sb_hiwat; ... (void)sbreserve(&so->so_rcv, bufsize); ... Since rt->rt_rmx.rmx_recvpipe is never zeroed (by default, it equals tcp_sendspace), the line bufsize = so->so_rcv.sb_hiwat is always jumped over, and tcp_mss() will set the sb_hiwat value to bufsize. And further, I've done a performance test. Before I commented out the four lines in in_rmx.c above, the TCP/IP implementations showed a throughput around 8.56 Mbps, and after I commented them out and rebuilt the kernel, it showed a throughput around 8.61 Mbps. Well, not a significant degradation, but the reason is still not clear to me... -Eka Kelana- STTTelkom