aboutsummaryrefslogtreecommitdiffstats
path: root/wpa_supplicant
diff options
context:
space:
mode:
authorMasashi Honma <masashi.honma@gmail.com>2014-05-13 00:35:48 (GMT)
committerJouni Malinen <j@w1.fi>2014-05-16 15:25:51 (GMT)
commitf0356ec85c468f425a86cfa11b98e051a2d022e8 (patch)
tree087a6f8ee74a44e0ed71465ad0cc47a8ab03df6a /wpa_supplicant
parentda96a6f793f0edc542f9edf963a308391565d3bf (diff)
downloadhostap-f0356ec85c468f425a86cfa11b98e051a2d022e8.zip
hostap-f0356ec85c468f425a86cfa11b98e051a2d022e8.tar.gz
hostap-f0356ec85c468f425a86cfa11b98e051a2d022e8.tar.bz2
eloop: Add epoll option for better performance
This patch adds epoll option for the eloop implementation. This can be selected with the CONFIG_ELOOP_EPOLL=y build option. [merit] See Table1. Table1. comparison table +--------+--------+-----------+------------+-------------+ | | add fd | remove fd | prepare fd | dispatch fd | +--------+--------+-----------+------------+-------------+ | select | O(1) | O(1) | O(N) | O(N) | +--------+--------+-----------+------------+-------------+ | poll | O(1) | O(1) | O(N) | O(N) | +--------+--------+-----------+------------+-------------+ | epoll | O(1) | O(1) | 0 | O(M) | +--------+--------+-----------+------------+-------------+ "add fd" is addition of fd by eloop_sock_table_add_sock(). "remove fd" is removal of fd by eloop_sock_table_remove_sock(). "prepare fd" is preparation of fds before wait in eloop_run(). "dispatch fd" is dispatchment of fds by eloop_sock_table_dispatch(). "N" is all watching fds. "M" is fds which could be dispatched after waiting. As shown in Table1, epoll option has better performance on "prepare fd" column. Because select/poll option requires setting fds before every select()/poll(). But epoll_wait() doesn't need it. And epoll option has also better performance on "dispatch fd" column. Because select/poll option needs to check all registered fds to find out dispatchable fds. But epoll option doesn't require checking all registered fds. Because epoll_wait() returns dispatchable fd set. So epoll option is effective for GO/AP functionality. [demerit] The epoll option requires additional heap memory. In case of P2P GO, it is about 8K bytes. Signed-off-by: Masashi Honma <masashi.honma@gmail.com>
Diffstat (limited to 'wpa_supplicant')
-rw-r--r--wpa_supplicant/Android.mk4
-rw-r--r--wpa_supplicant/Makefile3
-rw-r--r--wpa_supplicant/android.config5
-rw-r--r--wpa_supplicant/defconfig5
4 files changed, 15 insertions, 2 deletions
diff --git a/wpa_supplicant/Android.mk b/wpa_supplicant/Android.mk
index ca9d82d..eaf9705 100644
--- a/wpa_supplicant/Android.mk
+++ b/wpa_supplicant/Android.mk
@@ -140,6 +140,10 @@ ifdef CONFIG_ELOOP_POLL
L_CFLAGS += -DCONFIG_ELOOP_POLL
endif
+ifdef CONFIG_ELOOP_EPOLL
+L_CFLAGS += -DCONFIG_ELOOP_EPOLL
+endif
+
ifdef CONFIG_EAPOL_TEST
L_CFLAGS += -Werror -DEAPOL_TEST
endif
diff --git a/wpa_supplicant/Makefile b/wpa_supplicant/Makefile
index 48eb28a..49f7907 100644
--- a/wpa_supplicant/Makefile
+++ b/wpa_supplicant/Makefile
@@ -138,6 +138,9 @@ ifdef CONFIG_ELOOP_POLL
CFLAGS += -DCONFIG_ELOOP_POLL
endif
+ifdef CONFIG_ELOOP_EPOLL
+CFLAGS += -DCONFIG_ELOOP_EPOLL
+endif
ifdef CONFIG_EAPOL_TEST
CFLAGS += -Werror -DEAPOL_TEST
diff --git a/wpa_supplicant/android.config b/wpa_supplicant/android.config
index ffa2f01..3ed734d 100644
--- a/wpa_supplicant/android.config
+++ b/wpa_supplicant/android.config
@@ -237,7 +237,7 @@ CONFIG_BACKEND=file
# main_none = Very basic example (development use only)
#CONFIG_MAIN=main
-# Select wrapper for operatins system and C library specific functions
+# Select wrapper for operating system and C library specific functions
# unix = UNIX/POSIX like systems (default)
# win32 = Windows systems
# none = Empty template
@@ -251,6 +251,9 @@ CONFIG_ELOOP=eloop
# Should we use poll instead of select? Select is used by default.
#CONFIG_ELOOP_POLL=y
+# Should we use epoll instead of select? Select is used by default.
+#CONFIG_ELOOP_EPOLL=y
+
# Select layer 2 packet implementation
# linux = Linux packet socket (default)
# pcap = libpcap/libdnet/WinPcap
diff --git a/wpa_supplicant/defconfig b/wpa_supplicant/defconfig
index d194eb8..94c94b1 100644
--- a/wpa_supplicant/defconfig
+++ b/wpa_supplicant/defconfig
@@ -253,7 +253,7 @@ CONFIG_BACKEND=file
# main_none = Very basic example (development use only)
#CONFIG_MAIN=main
-# Select wrapper for operatins system and C library specific functions
+# Select wrapper for operating system and C library specific functions
# unix = UNIX/POSIX like systems (default)
# win32 = Windows systems
# none = Empty template
@@ -267,6 +267,9 @@ CONFIG_BACKEND=file
# Should we use poll instead of select? Select is used by default.
#CONFIG_ELOOP_POLL=y
+# Should we use epoll instead of select? Select is used by default.
+#CONFIG_ELOOP_EPOLL=y
+
# Select layer 2 packet implementation
# linux = Linux packet socket (default)
# pcap = libpcap/libdnet/WinPcap