Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 20 Dec 2006 11:14:46 +0000 (UTC)
From:      Bruce Evans <bde@FreeBSD.org>
To:        src-committers@FreeBSD.org, cvs-src@FreeBSD.org, cvs-all@FreeBSD.org
Subject:   cvs commit: src/sys/dev/bge if_bge.c
Message-ID:  <200612201114.kBKBEklb044854@repoman.freebsd.org>

next in thread | raw e-mail | index | archive | help
bde         2006-12-20 11:14:46 UTC

  FreeBSD src repository

  Modified files:
    sys/dev/bge          if_bge.c 
  Log:
  Avoid a race and a pessimization in bge_intr():
  
  - moved the synchronizing bus read to after the bus write for the first
    interrupt ack so that it actually synchronizes everything necessary.
  
    We were acking not only the status update that triggered the interrupt
    together with any status updates that occurred before we got around
    to the bus write for the ack, but also any status updates that occur
    after we do the bus write but before the write reaches the device.
    The corresponding race for the second interrupt ack resulted in
    sometimes returning from the interrupt handler with acked but
    unserviced interrupt events.  Such events then remain unserviced
    until further events cause another interrupt or the watchdog times
    out.
  
    The race was often lost on my 5705, apparently since my 5705 has broken
    event coalescing which causes a status update for almost every packet,
    so another status update is quite likely to occur while the interrupt
    handler is running.  Watchdog timeouts weren't very noticeable,
    apparently because bge_txeof() has one of the usual bugs resetting the
    watchdog.
  
  - don't disable device interrupts while bge_intr() is running.  Doing this
    just had the side effects of:
    - entering a device mode in which different coalescing parameters apply.
      Different coalescing parameters can be used to either inhibit or
      enhance the chance of getting another status update while in the
      interrupt handler.  This feature is useless with the current
      organization of the interrupt handler but might be useful with a
      taskqueue handler.
    - giving a race for ack+reenable/return.  This cannot be handled
      by simply rearranging the order of bus accesses like the race for
      ack+keepenable/entry.  It is necessary to sync the ack and then
      check for new events.
    - taking longer, especially with the extra code to avoid the race on
      ack+reenable/return.
  
  Reviewed by:    ru, gleb, scottl
  
  Revision  Changes    Path
  1.169     +22 -6     src/sys/dev/bge/if_bge.c



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200612201114.kBKBEklb044854>