git: kernel - Revamp ifsq_watchdog*() a bit

Matthew Dillon dillon at crater.dragonflybsd.org
Tue Sep 1 11:12:07 PDT 2020


commit e2292763210b551b05c63fd27fe614dedee1c0de
Author: Matthew Dillon <dillon at apollo.backplane.com>
Date:   Tue Sep 1 11:06:23 2020 -0700

    kernel - Revamp ifsq_watchdog*() a bit
    
    * Add a flags argument to ifsq_watchdog_init() and implement two
      flags:
    
      IF_WDOG_ALLTICKS	Watchdog callback occurs each second
    			prior to terminal count, and on terminal
    			count.
    
      IF_WDOG_LASTTICK	Watchdog callback occurs one second prior
    			to terminal count, and on terminal count.
    
      0			Watchdog callback only occurs on terminal
    			count.
    
      Note that the ifnet lock is fully serialized when a watchdog
      callback is made, so generally speaking to avoid hicups you
      only want to use IF_WDOG_LASTTICK.
    
    * This feature allows the watchdog code to flush any tx buffers
      (call *_txeof()) that have completed transmission.  Many NICs
      and virtual NICs don't bother to generate interrupts to clean-up
      such buffers when the rings are only lightly loaded.
    
    * Fix spurious vtnet watchdog events on lightly loaded vtnet
      interfaces, loosly using the same code that FreeBSD uses
      (just txeof from the second-prior watchdog callback and then
      check on terminal count).

Summary of changes:
 sys/dev/netif/bce/if_bce.c            |  6 ++--
 sys/dev/netif/bnx/if_bnx.c            |  7 ++--
 sys/dev/netif/emx/if_emx.c            | 12 +++----
 sys/dev/netif/igb/if_igb.c            |  8 ++---
 sys/dev/netif/ix/if_ix.c              |  8 ++---
 sys/dev/netif/mxge/if_mxge.c          |  6 ++--
 sys/dev/virtual/virtio/net/if_vtnet.c | 30 ++++++++++++++---
 sys/net/if.c                          | 62 +++++++++++++++++++++++++++++------
 sys/net/if_var.h                      |  8 ++++-
 sys/net/ifq_var.h                     |  7 +++-
 10 files changed, 114 insertions(+), 40 deletions(-)

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


-- 
DragonFly BSD source repository


More information about the Commits mailing list