Subject: Re: ipv6 TSO
To: YAMAMOTO Takashi <yamt@mwd.biglobe.ne.jp>
From: Matthias Scheler <tron@netbsd.org>
List: tech-net
Date: 11/20/2006 16:08:35
--BOKacYhQ+x31HxR3
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline

On Fri, Nov 17, 2006 at 08:51:37PM +0900, YAMAMOTO Takashi wrote:
> the attached patches implement ipv6 TSO for wm(4).
> (partly from Matthias Scheler.)

The patch for "mbuf.h" didn't apply cleanly. I've attached a modified
version which does.

> please review and/or test.

It works fine for me on this network card ...

wm0 at pci3 dev 0 function 0: Intel i82573L Gigabit Ethernet, rev. 0
wm0: interrupting at ioapic0 pin 17 (irq 10)
wm0: PCI-Express bus
wm0: 256 word (8 address bits) SPI EEPROM
wm0: Ethernet address 00:15:f2:xx:xx:xx
makphy0 at wm0 phy 1: Marvell 88E1111 Gigabit PHY, rev. 2

... with these features enabled:

wm0: flags=8843<UP,BROADCAST,RUNNING,SIMPLEX,MULTICAST> mtu 1500
        capabilities=7ff80<TSO4,IP4CSUM_Rx,IP4CSUM_Tx,TCP4CSUM_Rx,TCP4CSUM_Tx,UDP4CSUM_Rx,UDP4CSUM_Tx,TCP6CSUM_Rx,TCP6CSUM_Tx,UDP6CSUM_Rx,UDP6CSUM_Tx,TSO6>
        enabled=6bf80<TSO4,IP4CSUM_Rx,IP4CSUM_Tx,TCP4CSUM_Rx,TCP4CSUM_Tx,UDP4CSUM_Rx,UDP4CSUM_Tx,TCP6CSUM_Tx,UDP6CSUM_Tx,TSO6>
        address: 00:15:f2:xx:xx:xx
        media: Ethernet autoselect (1000baseT full-duplex,flowcontrol,rxpause,txpause)
        status: active
[...]

I've uploaded a 900MB file FTP over TCPv6 (using a kernel producing some
extra debugging output when TSOv6 is used) and compared the SHA512 hashes
of the source and destination file.

	Kind regards

-- 
Matthias Scheler                                  http://zhadum.org.uk/

--BOKacYhQ+x31HxR3
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment; filename="mbuf.h.patch"

Index: mbuf.h
===================================================================
RCS file: /cvsroot/src/sys/sys/mbuf.h,v
retrieving revision 1.132
diff -u -r1.132 mbuf.h
--- mbuf.h	17 Nov 2006 12:33:39 -0000	1.132
+++ mbuf.h	20 Nov 2006 16:03:46 -0000
@@ -176,6 +176,7 @@
 #define	M_CSUM_IPv4		0x00000040	/* IPv4 header */
 #define	M_CSUM_IPv4_BAD		0x00000080	/* IPv4 header checksum bad */
 #define	M_CSUM_TSOv4		0x00000100	/* TCPv4 segmentation offload */
+#define	M_CSUM_TSOv6		0x00000200	/* TCPv6 segmentation offload */
 
 /* Checksum-assist quirks: keep separate from jump-table bits. */
 #define	M_CSUM_NO_PSEUDOHDR	0x80000000	/* Rx csum_data does not include
@@ -185,7 +186,7 @@
 
 #define M_CSUM_BITS \
     "\20\1TCPv4\2UDPv4\3TCP_UDP_BAD\4DATA\5TCPv6\6UDPv6\7IPv4\10IPv4_BAD" \
-    "\11TSOv4\40NO_PSEUDOHDR"
+    "\11TSOv4\12TSOv6\40NO_PSEUDOHDR"
 
 /*
  * Macros for manipulating csum_data on outgoing packets.  These are

--BOKacYhQ+x31HxR3--