Remove workaround for GATEWAY
The workaround was introduced because lltable/llentry uses rwlock but it may be executed in hardware interrupt due to fast forward. Now we don't run fast forward in hardware interrupt anymore, so we can remove the workaround.
This commit is contained in:
parent
d8252c8b23
commit
1926a64c9e
37
sys/net/if.h
37
sys/net/if.h
|
@ -1,4 +1,4 @@
|
|||
/* $NetBSD: if.h,v 1.196 2016/02/15 08:08:04 ozaki-r Exp $ */
|
||||
/* $NetBSD: if.h,v 1.197 2016/02/16 01:31:26 ozaki-r Exp $ */
|
||||
|
||||
/*-
|
||||
* Copyright (c) 1999, 2000, 2001 The NetBSD Foundation, Inc.
|
||||
|
@ -214,11 +214,7 @@ struct ifnet_lock;
|
|||
#include <sys/condvar.h>
|
||||
#include <sys/percpu.h>
|
||||
#include <sys/callout.h>
|
||||
#ifdef GATEWAY
|
||||
#include <sys/mutex.h>
|
||||
#else
|
||||
#include <sys/rwlock.h>
|
||||
#endif
|
||||
|
||||
struct ifnet_lock {
|
||||
kmutex_t il_lock; /* Protects the critical section. */
|
||||
|
@ -352,11 +348,7 @@ typedef struct ifnet {
|
|||
struct ifnet_lock *if_ioctl_lock;
|
||||
#ifdef _KERNEL /* XXX kvm(3) */
|
||||
struct callout *if_slowtimo_ch;
|
||||
#ifdef GATEWAY
|
||||
struct kmutex *if_afdata_lock;
|
||||
#else
|
||||
struct krwlock *if_afdata_lock;
|
||||
#endif
|
||||
struct if_percpuq *if_percpuq; /* We should remove it in the future */
|
||||
void *if_link_si; /* softint to handle link state changes */
|
||||
int if_old_link_state; /* previous link state */
|
||||
|
@ -450,32 +442,6 @@ typedef struct ifnet {
|
|||
"\23TSO6" \
|
||||
"\24LRO" \
|
||||
|
||||
#ifdef GATEWAY
|
||||
#define IF_AFDATA_LOCK_INIT(ifp) \
|
||||
do { \
|
||||
(ifp)->if_afdata_lock = mutex_obj_alloc(MUTEX_DEFAULT, IPL_NET); \
|
||||
} while (0)
|
||||
|
||||
#define IF_AFDATA_LOCK_DESTROY(ifp) mutex_obj_free((ifp)->if_afdata_lock)
|
||||
|
||||
#define IF_AFDATA_WLOCK(ifp) mutex_enter((ifp)->if_afdata_lock)
|
||||
#define IF_AFDATA_RLOCK(ifp) mutex_enter((ifp)->if_afdata_lock)
|
||||
#define IF_AFDATA_WUNLOCK(ifp) mutex_exit((ifp)->if_afdata_lock)
|
||||
#define IF_AFDATA_RUNLOCK(ifp) mutex_exit((ifp)->if_afdata_lock)
|
||||
#define IF_AFDATA_LOCK(ifp) IF_AFDATA_WLOCK(ifp)
|
||||
#define IF_AFDATA_UNLOCK(ifp) IF_AFDATA_WUNLOCK(ifp)
|
||||
#define IF_AFDATA_TRYLOCK(ifp) mutex_tryenter((ifp)->if_afdata_lock)
|
||||
|
||||
#define IF_AFDATA_LOCK_ASSERT(ifp) \
|
||||
KASSERT(mutex_owned((ifp)->if_afdata_lock))
|
||||
#define IF_AFDATA_RLOCK_ASSERT(ifp) \
|
||||
KASSERT(mutex_owned((ifp)->if_afdata_lock))
|
||||
#define IF_AFDATA_WLOCK_ASSERT(ifp) \
|
||||
KASSERT(mutex_owned((ifp)->if_afdata_lock))
|
||||
#define IF_AFDATA_UNLOCK_ASSERT(ifp) \
|
||||
KASSERT(!mutex_owned((ifp)->if_afdata_lock))
|
||||
|
||||
#else /* GATEWAY */
|
||||
#define IF_AFDATA_LOCK_INIT(ifp) \
|
||||
do {(ifp)->if_afdata_lock = rw_obj_alloc();} while (0)
|
||||
|
||||
|
@ -497,7 +463,6 @@ typedef struct ifnet {
|
|||
KASSERT(rw_write_held((ifp)->if_afdata_lock))
|
||||
#define IF_AFDATA_UNLOCK_ASSERT(ifp) \
|
||||
KASSERT(!rw_lock_held((ifp)->if_afdata_lock))
|
||||
#endif /* GATEWAY */
|
||||
|
||||
#define IFQ_LOCK(_ifq) if ((_ifq)->ifq_lock) mutex_enter((_ifq)->ifq_lock)
|
||||
#define IFQ_UNLOCK(_ifq) if ((_ifq)->ifq_lock) mutex_exit((_ifq)->ifq_lock)
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
/* $NetBSD: if_llatbl.c,v 1.9 2015/11/26 01:41:20 ozaki-r Exp $ */
|
||||
/* $NetBSD: if_llatbl.c,v 1.10 2016/02/16 01:31:26 ozaki-r Exp $ */
|
||||
/*
|
||||
* Copyright (c) 2004 Luigi Rizzo, Alessandro Cerri. All rights reserved.
|
||||
* Copyright (c) 2004-2008 Qing Li. All rights reserved.
|
||||
|
@ -383,16 +383,7 @@ lltable_purge_entries(struct lltable *llt)
|
|||
if (lle->la_rt != NULL) {
|
||||
struct rtentry *rt = lle->la_rt;
|
||||
lle->la_rt = NULL;
|
||||
#ifdef GATEWAY
|
||||
/* XXX cannot call rtfree with holding mutex(IPL_NET) */
|
||||
LLE_ADDREF(lle);
|
||||
LLE_WUNLOCK(lle);
|
||||
#endif
|
||||
rtfree(rt);
|
||||
#ifdef GATEWAY
|
||||
LLE_WLOCK(lle);
|
||||
LLE_REMREF(lle);
|
||||
#endif
|
||||
}
|
||||
#endif
|
||||
llentry_free(lle);
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
/* $NetBSD: if_llatbl.h,v 1.7 2015/12/17 02:38:33 ozaki-r Exp $ */
|
||||
/* $NetBSD: if_llatbl.h,v 1.8 2016/02/16 01:31:26 ozaki-r Exp $ */
|
||||
/*
|
||||
* Copyright (c) 2004 Luigi Rizzo, Alessandro Cerri. All rights reserved.
|
||||
* Copyright (c) 2004-2008 Qing Li. All rights reserved.
|
||||
|
@ -37,9 +37,6 @@
|
|||
#endif
|
||||
|
||||
#include <sys/rwlock.h>
|
||||
#ifdef GATEWAY
|
||||
#include <sys/mutex.h>
|
||||
#endif
|
||||
|
||||
#include <netinet/in.h>
|
||||
|
||||
|
@ -94,11 +91,7 @@ struct llentry {
|
|||
|
||||
LIST_ENTRY(llentry) lle_chain; /* chain of deleted items */
|
||||
struct callout lle_timer;
|
||||
#ifdef GATEWAY
|
||||
kmutex_t lle_lock;
|
||||
#else
|
||||
krwlock_t lle_lock;
|
||||
#endif
|
||||
|
||||
#ifdef __NetBSD__
|
||||
#define la_timer lle_timer
|
||||
|
@ -121,31 +114,6 @@ struct llentry {
|
|||
#define LLE_LOCK_TRACE(t, lle) do {} while (0)
|
||||
#endif
|
||||
|
||||
#ifdef GATEWAY
|
||||
#define LLE_WLOCK(lle) do { \
|
||||
LLE_LOCK_TRACE(WL, (lle)); \
|
||||
mutex_enter(&(lle)->lle_lock); \
|
||||
} while (0)
|
||||
#define LLE_RLOCK(lle) do { \
|
||||
LLE_LOCK_TRACE(RL, (lle)); \
|
||||
mutex_enter(&(lle)->lle_lock); \
|
||||
} while (0)
|
||||
#define LLE_WUNLOCK(lle) do { \
|
||||
LLE_LOCK_TRACE(WU, (lle)); \
|
||||
mutex_exit(&(lle)->lle_lock); \
|
||||
} while (0)
|
||||
#define LLE_RUNLOCK(lle) do { \
|
||||
LLE_LOCK_TRACE(RU, (lle)); \
|
||||
mutex_exit(&(lle)->lle_lock); \
|
||||
} while (0)
|
||||
#define LLE_DOWNGRADE(lle) do {} while (0)
|
||||
#define LLE_TRY_UPGRADE(lle) (1)
|
||||
#define LLE_LOCK_INIT(lle) mutex_init(&(lle)->lle_lock, MUTEX_DEFAULT, \
|
||||
IPL_NET)
|
||||
#define LLE_LOCK_DESTROY(lle) mutex_destroy(&(lle)->lle_lock)
|
||||
#define LLE_WLOCK_ASSERT(lle) KASSERT(mutex_owned(&(lle)->lle_lock))
|
||||
|
||||
#else /* GATEWAY */
|
||||
#define LLE_WLOCK(lle) do { \
|
||||
LLE_LOCK_TRACE(WL, (lle)); \
|
||||
rw_enter(&(lle)->lle_lock, RW_WRITER); \
|
||||
|
@ -171,7 +139,6 @@ struct llentry {
|
|||
#endif
|
||||
#define LLE_LOCK_DESTROY(lle) rw_destroy(&(lle)->lle_lock)
|
||||
#define LLE_WLOCK_ASSERT(lle) KASSERT(rw_write_held(&(lle)->lle_lock))
|
||||
#endif /* GATEWAY */
|
||||
|
||||
#define LLE_IS_VALID(lle) (((lle) != NULL) && ((lle) != (void *)-1))
|
||||
|
||||
|
|
Loading…
Reference in New Issue