NFE - Fix bug with imtimer transitions and improve performance
authorMatthew Dillon <dillon@apollo.backplane.com>
Thu, 3 Sep 2009 05:06:22 +0000 (22:06 -0700)
committerMatthew Dillon <dillon@apollo.backplane.com>
Thu, 3 Sep 2009 05:06:22 +0000 (22:06 -0700)
commitc00ddf3338e01a6f586adc9280ec218af71a7eb2
tree5b1741fb0f6ddbe0ebc2ede643f85ba4a49a9eb1
parentece4620ae55717d4760f3cdfe5ada477e350a10b
NFE - Fix bug with imtimer transitions and improve performance

* When the imtimer transitions to a new state via a sysctl the
  code called ifp->if_init() which more often then not caused
  the device to stop taking all interrupts.

* Change the way dynamic interrupt moderation works.  Timer moderation is
  not turned on until the discrete interrupt rate exceeds the threshold.
  e.g. by default 500uS is 2000 interrupts/second so timer moderation
  is not turned on until the discrete interrupt rate exceeds 2000 ips.

  This allows the device to respond interactively as long as traffic levels
  are reasonable, before converting into moderation-timer-based batching.

  Timer moderation is turned off and we go back to discrete interrupts
  if the average rate over ~4 seconds falls below the threshold.

* Change the interrupt moderation default from 125uS to 500uS.  125uS can
  saturate the cpu if the interrupt line is shared with other devices.
  A larger moderation timer is also more reasonable now that discrete
  interrupts are left intact until the rate exceeds the threshold.

  The moderation timer should be roughly designed to deal with the txring
  and rxring size.
sys/dev/netif/nfe/if_nfe.c
sys/dev/netif/nfe/if_nfevar.h