igb: Optimize TX path
authorSepherosa Ziehau <sephe@dragonflybsd.org>
Sun, 27 May 2012 13:16:46 +0000 (21:16 +0800)
committerSepherosa Ziehau <sephe@dragonflybsd.org>
Thu, 31 May 2012 13:36:49 +0000 (21:36 +0800)
commitb62201445347b6010549fd9b43c84bfea0977b4a
tree83b6090cee173fe8a43cb2ef58f9c663be1c9479
parent0339c4295a405da595fd97d11880f4b0fd1c51a1
igb: Optimize TX path

Reduce the number of status reports of TX ring: at most 16 reports every
TX descriptor count tranmission.  It is unnecessary to report status for
every TX descriptor.  This could greatly reduce bus traffic.

Use "Transmit Completions Head Write Back" as mentioned in the datasheet.
In this model, TX descriptors are no longer written by hardware thus cache
trashing is avoided.  This also greatly reduce the complexity of igb_txeof.

Implemention note of "Transmit Completions Head Write Back",
- HWBTHRESH is not used, since:
  o  82575 does not support it
  o  Number of status reports are already greatly reduced
- WB_on_EITR is not used, since:
  o  82575 does not support it
  o  It will cause unnecessary head write-back

Performance is almost same as previous code:
- 1.48Mpps for 18bytes UDP datagram
- Line rate for 1472bytes UDP datagram and TCP stream
sys/dev/netif/igb/if_igb.c
sys/dev/netif/igb/if_igb.h