if.c (249925) | if.c (250300) |
---|---|
1/*- 2 * Copyright (c) 1980, 1986, 1993 3 * The Regents of the University of California. All rights reserved. 4 * 5 * Redistribution and use in source and binary forms, with or without 6 * modification, are permitted provided that the following conditions 7 * are met: 8 * 1. Redistributions of source code must retain the above copyright --- 13 unchanged lines hidden (view full) --- 22 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 23 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 24 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 25 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 26 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 27 * SUCH DAMAGE. 28 * 29 * @(#)if.c 8.5 (Berkeley) 1/9/95 | 1/*- 2 * Copyright (c) 1980, 1986, 1993 3 * The Regents of the University of California. All rights reserved. 4 * 5 * Redistribution and use in source and binary forms, with or without 6 * modification, are permitted provided that the following conditions 7 * are met: 8 * 1. Redistributions of source code must retain the above copyright --- 13 unchanged lines hidden (view full) --- 22 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 23 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 24 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 25 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 26 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 27 * SUCH DAMAGE. 28 * 29 * @(#)if.c 8.5 (Berkeley) 1/9/95 |
30 * $FreeBSD: head/sys/net/if.c 249925 2013-04-26 12:50:32Z glebius $ | 30 * $FreeBSD: head/sys/net/if.c 250300 2013-05-06 16:42:18Z andre $ |
31 */ 32 33#include "opt_compat.h" 34#include "opt_inet6.h" 35#include "opt_inet.h" 36 37#include <sys/param.h> 38#include <sys/types.h> --- 162 unchanged lines hidden (view full) --- 201 * The global network interface list (V_ifnet) and related state (such as 202 * if_index, if_indexlim, and ifindex_table) are protected by an sxlock and 203 * an rwlock. Either may be acquired shared to stablize the list, but both 204 * must be acquired writable to modify the list. This model allows us to 205 * both stablize the interface list during interrupt thread processing, but 206 * also to stablize it over long-running ioctls, without introducing priority 207 * inversions and deadlocks. 208 */ | 31 */ 32 33#include "opt_compat.h" 34#include "opt_inet6.h" 35#include "opt_inet.h" 36 37#include <sys/param.h> 38#include <sys/types.h> --- 162 unchanged lines hidden (view full) --- 201 * The global network interface list (V_ifnet) and related state (such as 202 * if_index, if_indexlim, and ifindex_table) are protected by an sxlock and 203 * an rwlock. Either may be acquired shared to stablize the list, but both 204 * must be acquired writable to modify the list. This model allows us to 205 * both stablize the interface list during interrupt thread processing, but 206 * also to stablize it over long-running ioctls, without introducing priority 207 * inversions and deadlocks. 208 */ |
209struct rwlock_padalign ifnet_rwlock; | 209struct rwlock ifnet_rwlock; |
210struct sx ifnet_sxlock; 211 212/* 213 * The allocation of network interfaces is a rather non-atomic affair; we 214 * need to select an index before we are ready to expose the interface for 215 * use, so will use this pointer value to indicate reservation. 216 */ 217#define IFNET_HOLD (void *)(uintptr_t)(-1) --- 3198 unchanged lines hidden --- | 210struct sx ifnet_sxlock; 211 212/* 213 * The allocation of network interfaces is a rather non-atomic affair; we 214 * need to select an index before we are ready to expose the interface for 215 * use, so will use this pointer value to indicate reservation. 216 */ 217#define IFNET_HOLD (void *)(uintptr_t)(-1) --- 3198 unchanged lines hidden --- |