git: tcp/tso: Add per-device TSO aggregation size limit

Sepherosa Ziehau sephe at crater.dragonflybsd.org
Tue Jan 22 03:57:08 PST 2013


commit e41e61d527704e7aa16af8e67ac60563ee8e4962
Author: Sepherosa Ziehau <sephe at dragonflybsd.org>
Date:   Wed Jan 16 19:02:36 2013 +0800

    tcp/tso: Add per-device TSO aggregation size limit
    
    - Prevent possible TSO large burst, when it is inappropriate (plenty of
      >24 segements bursts were observered, even when 32 parallel sending TCP
      streams are running on the same GigE NIC).
      TSO large burst has following drawbacks on a single TX queue, even on
      the devices that are multiple TX queues capable:
      o  Delay other senders' packet transmission quite a lot.
      o  Has negative effect on TCP receivers, which sends ACKs.
      o  Cause buffer bloat in software sending queues, whose upper limit is
         based on "packet count".
      o  Packet scheduler's decision could be less effective.
      On the other hand, TSO large burst could improve CPU usage.
    - Improve fairness between multiple TX queues on the devices that are
      multiple TX queues capable but only fetch data on TSO large packet
      boundary instead of TCP segment boundary.
    
    Drivers could supply their own TSO aggregation size limit.  If driver
    does not set it, the default value is 6000 (4 segments if MTU is 1500).
    The default value increases CPU usage a little bit: on i7-2600 w/ HT
    enabled, single TCP sending stream, CPU usage increases from 14%~17%
    to 17%~20%.
    
    User could configure TSO aggregation size limit by using ifconfig(8):
    ifconfig ifaceX tsolen _n_

Summary of changes:
 sbin/ifconfig/ifconfig.8 | 13 +++++++++++--
 sbin/ifconfig/ifconfig.c | 20 +++++++++++++++++++-
 sys/net/if.c             | 17 +++++++++++++++++
 sys/net/if.h             |  2 ++
 sys/net/if_ethersubr.c   | 16 ++++++++++++++++
 sys/net/if_var.h         |  2 +-
 sys/netinet/tcp_output.c | 10 ++++++++--
 sys/sys/sockio.h         |  3 +++
 8 files changed, 77 insertions(+), 6 deletions(-)

http://gitweb.dragonflybsd.org/dragonfly.git/commitdiff/e41e61d527704e7aa16af8e67ac60563ee8e4962


-- 
DragonFly BSD source repository


More information about the Commits mailing list