emx: Implement multiple hardware TX queue support; disabled by default
authorSepherosa Ziehau <sephe@dragonflybsd.org>
Thu, 7 Feb 2013 06:38:04 +0000 (14:38 +0800)
committerSepherosa Ziehau <sephe@dragonflybsd.org>
Fri, 8 Feb 2013 10:15:53 +0000 (18:15 +0800)
commitd84018e9fb36a00a2dc66fc24ff89725c03b0190
tree2d83e91d0e21579fabe3f909117c9746fa047f45
parentd22af07c0cd8fdf1297ac7bc509cd3c29fea8a53
emx: Implement multiple hardware TX queue support; disabled by default

Two notes about the multiple hardware TX queue support:

- It could only be enabled on 82571, 82572 and es2lan.  Enabling it on
  82574, whose datasheet claims multiple hardware TX queue support,
  could cause watchdog timeout when heavy TCP receiving test are
  conducted.

- It is disabled by default.  Since 82571, 82572 and es2lan only have
  one global context for TX hardware checksum and TSO, the driver will
  have to setup TX context descriptor for each packet.  Using TX context
  descriptor for each packet could cause serious transmission performance
  regression for tiny packets, see comment of following commit:
  51e6819fc2ad7cefdf830dcc9f20bcbe2af2aa52

  However, multiple hardware TX queues still could be enabled depending
  on the workload (*):
  o  TSO probably are not affected by setting up a TX context descriptor
     for each TSO packet.
  o  Stuffs do not using hardware TX checksum, e.g. IP fast forwarding.

  Multiple hardware TX queues could be enabled globally by tunable:
      hw.emx.txr=2
  Multiple hardware TX queues could be enabled on individual interface by
  tunable:
      hw.emxY.txr=2

(*) Another thought is to add per-interface metric, which indicates the
size of packets that worth hardware checksum; if the packets' size is
below that metric, software checksum is used.
sys/conf/options
sys/config/LINT
sys/config/LINT64
sys/dev/netif/emx/if_emx.c
sys/dev/netif/emx/if_emx.h