Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 3 Aug 2008 21:40:34 +0000 (UTC)
From:      Robert Watson <rwatson@FreeBSD.org>
To:        src-committers@FreeBSD.org, cvs-src@FreeBSD.org, cvs-all@FreeBSD.org
Subject:   cvs commit: src/sys/net if.c if_var.h
Message-ID:  <200808032141.m73LfEmn000873@repoman.freebsd.org>

next in thread | raw e-mail | index | archive | help
rwatson     2008-08-03 21:40:34 UTC

  FreeBSD src repository

  Modified files:        (Branch: RELENG_7)
    sys/net              if.c if_var.h 
  Log:
  SVN rev 181264 on 2008-08-03 21:40:34Z by rwatson
  
  Merge r180042 from head to stable/7:
  
    Introduce locking around use of ifindex_table, whose use was previously
    unsynchronized.  While races were extremely rare, we've now had a
    couple of reports of panics in environments involving large numbers of
    IPSEC tunnels being added very quickly on an active system.
  
    - Add accessor functions ifnet_byindex(), ifaddr_byindex(),
      ifdev_byindex() to replace existing accessor macros.  These functions
      now acquire the ifnet lock before derefencing the table.
    - Add IFNET_WLOCK_ASSERT().
    - Add static accessor functions ifnet_setbyindex(), ifdev_setbyindex(),
      which set values in the table either asserting of acquiring the ifnet
      lock.
    - Use accessor functions throughout if.c to modify and read
      ifindex_table.
    - Rework ifnet attach/detach to lock around ifindex_table modification.
  
    Note that these changes simply close races around use of ifindex_table,
    and make no attempt to solve the probem of disappearing ifnets.  Further
    refinement of this work, including with respect to ifindex_table
    resizing, is still required.
  
    In a future change, the ifnet lock should be converted from a mutex to an
    rwlock in order to reduce contention.
  
    Reviewed and tested by: brooks
  
  Revision   Changes    Path
  1.273.2.5  +69 -12    src/sys/net/if.c
  1.115.2.3  +4 -4      src/sys/net/if_var.h



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