git: tcp: Add TSO support for IPv4

Sepherosa Ziehau sephe at crater.dragonflybsd.org
Sun Jul 29 23:27:08 PDT 2012


commit 5f60906c244f426e05c09979f8555e604be13865
Author: Sepherosa Ziehau <sephe at dragonflybsd.org>
Date:   Fri Jul 27 14:07:27 2012 +0800

    tcp: Add TSO support for IPv4
    
    It is implemented mainly according to NetBSD's TSO implementation.
    
    Following stuffs are only in DragonFly
    - Add comment about devices' expected behaviour upon PUSH and FIN flags
      Obtained-from: Microsoft's LSO online document
    - Don't use TSO, if there are SACK or DSACK blocks to report
    - Don't use TSO, if congestion window needs validation
    - Don't use TSO, if URG flag is to be set
    - Take IP and TCP header sizes into consideration when calculate the
      large TCP segment size
    - Pseudo checksum for the large TCP segment is calculated using only
      source address, destination address and IPPROTO_TCP according to
      Microsoft's LSO online document.  This fashion of pseudo checksum
      calculation seems to be adopted by several NIC chips.
    
    Several driver helper functions are added:
    - tcp_tso_pullup(), which extracts IPv4 and TCP header's location and
      length.  And make sure that IPv4 and TCP headers are in contiguous
      memory.
    - ether_tso_pullup(), in addition to what tcp_tso_pullup() does, it
      also extracts ethernet header's length and make sure that ethernet,
      IPv4 and TCP headers are in contiguous memory.
    
    Sysctl node net.inet.tcp.tso could be used to globally disable TSO.
    TSO is by default on.
    
    tso/-tso are added to ifconfig(8), which could be used to enable or
    disable TSO on the specific interface.

Summary of changes:
 sbin/ifconfig/ifconfig.8 |    6 +
 sbin/ifconfig/ifconfig.c |    5 +-
 sys/net/if.h             |    1 +
 sys/net/if_ethersubr.c   |   47 +++++++++
 sys/net/if_var.h         |    5 +
 sys/netinet/ip_output.c  |   24 +++--
 sys/netinet/tcp_output.c |  236 ++++++++++++++++++++++++++++++++++++++--------
 sys/netinet/tcp_subr.c   |   81 +++++++++++++++-
 sys/netinet/tcp_var.h    |    6 +-
 sys/sys/mbuf.h           |    2 +
 10 files changed, 355 insertions(+), 58 deletions(-)

http://gitweb.dragonflybsd.org/dragonfly.git/commitdiff/5f60906c244f426e05c09979f8555e604be13865


-- 
DragonFly BSD source repository





More information about the Commits mailing list