diff options
author | Andrew Gallatin <gallatin@FreeBSD.org> | 2007-06-08 12:43:25 +0000 |
---|---|---|
committer | Andrew Gallatin <gallatin@FreeBSD.org> | 2007-06-08 12:43:25 +0000 |
commit | 0bb6a7159d3ad414d384ab010d06e7b9ced1c37e (patch) | |
tree | 373383a903ff20fc1e97fdaabdfa1eb57361e404 /sys/net | |
parent | 3b7917d766761f79841645281a679eb3d7f79898 (diff) | |
download | src-0bb6a7159d3ad414d384ab010d06e7b9ced1c37e.tar.gz src-0bb6a7159d3ad414d384ab010d06e7b9ced1c37e.zip |
Correct the definition of PFIL_HOOKED() so that it compares
the value of ph_nhooks to zero, not the address. This removes
extranious calls to pfil_run_hooks (and an rw lock) from the
network stack's critical path when no pfil hooks are active.
Reviewed by: csjp
Sponsored by: Myricom Inc.
Notes
Notes:
svn path=/head/; revision=170432
Diffstat (limited to 'sys/net')
-rw-r--r-- | sys/net/pfil.h | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/sys/net/pfil.h b/sys/net/pfil.h index 6b00e5c5f0d9..d2308fdbee57 100644 --- a/sys/net/pfil.h +++ b/sys/net/pfil.h @@ -92,7 +92,7 @@ int pfil_head_unregister(struct pfil_head *); struct pfil_head *pfil_head_get(int, u_long); -#define PFIL_HOOKED(p) (&(p)->ph_nhooks > 0) +#define PFIL_HOOKED(p) ((p)->ph_nhooks > 0) #define PFIL_RLOCK(p) rw_rlock(&(p)->ph_mtx) #define PFIL_WLOCK(p) rw_wlock(&(p)->ph_mtx) #define PFIL_RUNLOCK(p) rw_runlock(&(p)->ph_mtx) |