diff options
author | Qing Li <qingli@FreeBSD.org> | 2009-10-22 18:48:25 +0000 |
---|---|---|
committer | Qing Li <qingli@FreeBSD.org> | 2009-10-22 18:48:25 +0000 |
commit | dbd4bfe3179659737a9ba77ed9eae5331d810229 (patch) | |
tree | 06a78a41acda09e6bc192017ddf07ce1834f7e15 | |
parent | 1c7deea4370081ab4cba762f18952363bdab1015 (diff) |
MFC 198306
The flow-table function flowtable_route_flush() may be called
during system initialization time. Since the flow-table is
designed to maintain per CPU flow cache, the existing code
did not check whether "smp_started" is true before calling
sched_bind() and sched_unbind(), which triggers a page fault.
Reviewed by: jeff
Approved by: re
Notes
Notes:
svn path=/stable/8/; revision=198371
-rw-r--r-- | sys/net/flowtable.c | 18 |
1 files changed, 11 insertions, 7 deletions
diff --git a/sys/net/flowtable.c b/sys/net/flowtable.c index b85ae268081a..31c2acc19a9f 100644 --- a/sys/net/flowtable.c +++ b/sys/net/flowtable.c @@ -930,16 +930,20 @@ flowtable_route_flush(struct flowtable *ft, struct rtentry *rt) for (i = 0; i <= mp_maxid; i++) { if (CPU_ABSENT(i)) continue; - - thread_lock(curthread); - sched_bind(curthread, i); - thread_unlock(curthread); + + if (smp_started == 1) { + thread_lock(curthread); + sched_bind(curthread, i); + thread_unlock(curthread); + } flowtable_free_stale(ft, rt); - thread_lock(curthread); - sched_unbind(curthread); - thread_unlock(curthread); + if (smp_started == 1) { + thread_lock(curthread); + sched_unbind(curthread); + thread_unlock(curthread); + } } } else { flowtable_free_stale(ft, rt); |