Subject: CVS commit: src
To: None <source-changes@NetBSD.org>
From: David Young <dyoung@netbsd.org>
List: source-changes
Date: 10/05/2007 03:28:14
Module Name:	src
Committed By:	dyoung
Date:		Fri Oct  5 03:28:14 UTC 2007

Modified Files:
	src/distrib/sets/lists/comp: mi
	src/sys/net: if_gre.c if_gre.h
	src/sys/netinet: Makefile in_proto.c
Removed Files:
	src/sys/netinet: ip_gre.c ip_gre.h

Log Message:
Work in progress: use a raw socket for GRE in IP encapsulation
instead of adding/subtracting our own IPv4 header.

There are many benefits:  gre(4) needn't grok the outer encapsulation
header any longer, so this simplifies the gre(4) code.  The IP
stack needn't grok GRE, so it is simplified, too.  gre(4) will
benefit from optimizations in the socket code.  Eventually, gre(4)
will gain an IPv6 encapsulation with very few new lines of code.

There is a small performance loss.  A 133 MHz, 486-class AMD Elan
sinks/sources a TCP stream over GRE with about 93% the throughput
of the old code.  TCP throughput on a 266 MHz, 586-class AMD Geode
is about 96% the throughput of the old code.  A 175-MHz ADM5120
(MIPS) only sinks a TCP stream over GRE at about 90% of the old
code; I am still investigating that.

I produced stripped-down versions of sosend() and soreceive() for
gre(4) to use.  They are guaranteed not to block, so they can be
called from a software interrupt and from a socket upcall,
respectively.

A kernel thread is no longer necessary for socket transmit/receive,
but I didn't get around to removing it, yet.

Thanks to Matt Thomas for suggesting the use of stripped-down socket
code and software interrupts, and to Andrew Doran for advice and
answers concerning software interrupts, threads, and performance.


To generate a diff of this commit:
cvs rdiff -r1.1069 -r1.1070 src/distrib/sets/lists/comp/mi
cvs rdiff -r1.110 -r1.111 src/sys/net/if_gre.c
cvs rdiff -r1.26 -r1.27 src/sys/net/if_gre.h
cvs rdiff -r1.18 -r1.19 src/sys/netinet/Makefile
cvs rdiff -r1.90 -r1.91 src/sys/netinet/in_proto.c
cvs rdiff -r1.47 -r0 src/sys/netinet/ip_gre.c
cvs rdiff -r1.8 -r0 src/sys/netinet/ip_gre.h

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.