fragattacks/src/utils
Masashi Honma f0356ec85c 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>
2014-05-16 18:25:51 +03:00
..
.gitignore Add build rules for building a library from src/utils files 2009-12-05 21:39:41 +02:00
base64.c Remove the GPL notification from files contributed by Jouni Malinen 2012-02-11 19:39:36 +02:00
base64.h Remove the GPL notification from files contributed by Jouni Malinen 2012-02-11 19:39:36 +02:00
bitfield.c Add bitfield routines 2013-04-27 22:16:40 +03:00
bitfield.h Add bitfield routines 2013-04-27 22:16:40 +03:00
browser-android.c HS 2.0R2: Add wrapper for Android browser for user interaction 2014-03-12 01:09:21 +02:00
browser-system.c HS 2.0R2: Add wrapper for system browser 2014-03-12 01:09:22 +02:00
browser-wpadebug.c HS 2.0R2: Add wrapper for wpadebug browser on Android 2014-03-12 01:09:21 +02:00
browser.c HS 2.0R2: Add wrapper functions for WebKit 2014-03-12 01:09:21 +02:00
browser.h HS 2.0R2: Add wrapper functions for WebKit 2014-03-12 01:09:21 +02:00
build_config.h Remove forgotten Xcode defines 2013-07-09 15:20:17 +03:00
common.c Move int_array helpfer functions to utils/common.c 2013-12-26 13:37:06 +02:00
common.h Define __maybe_unused 2013-12-29 13:38:27 +02:00
edit_readline.c edit: Fix libreadline history clearing with WPA_TRACE 2013-05-14 16:46:38 +03:00
edit_simple.c edit: Increase buffer size to 4096 bytes 2014-03-31 12:30:50 +03:00
edit.c edit: Increase buffer size to 4096 bytes 2014-03-31 12:30:50 +03:00
edit.h edit: Add support for setting prompt string 2012-08-05 20:46:34 +03:00
eloop_win.c Fix req_scan-deplete-timeout and update eloop API for this 2014-01-07 10:45:10 +02:00
eloop.c eloop: Add epoll option for better performance 2014-05-16 18:25:51 +03:00
eloop.h Fix req_scan-deplete-timeout and update eloop API for this 2014-01-07 10:45:10 +02:00
ext_password_i.h EXT PW: Add framework for supporting external password storage 2012-08-03 22:15:42 +03:00
ext_password_test.c EXT PW: Add framework for supporting external password storage 2012-08-03 22:15:42 +03:00
ext_password.c EXT PW: Add framework for supporting external password storage 2012-08-03 22:15:42 +03:00
ext_password.h EXT PW: Add framework for supporting external password storage 2012-08-03 22:15:42 +03:00
http_curl.c HS 2.0R2: Clean up debug from libcurl 2014-03-18 00:39:35 +02:00
http-utils.h HS 2.0R2: Add parse_cert command for debugging purposes 2014-03-12 01:09:22 +02:00
includes.h Remove experimental Symbian build 2012-04-07 13:00:30 +03:00
ip_addr.c Remove the GPL notification from files contributed by Jouni Malinen 2012-02-11 19:39:36 +02:00
ip_addr.h Remove the GPL notification from files contributed by Jouni Malinen 2012-02-11 19:39:36 +02:00
list.h Remove the GPL notification from files contributed by Jouni Malinen 2012-02-11 19:39:36 +02:00
Makefile Add CONFIG_CODE_COVERAGE=y option for gcov 2013-11-24 19:16:12 +02:00
os_internal.c Use monotonic clock for relative time for eloop if available 2013-11-20 23:52:56 +02:00
os_none.c Use monotonic clock for relative time for eloop if available 2013-11-20 23:52:56 +02:00
os_unix.c Add os_file_exists() 2014-03-12 01:09:22 +02:00
os_win32.c Use monotonic clock for relative time for eloop if available 2013-11-20 23:52:56 +02:00
os.h Add os_file_exists() 2014-03-12 01:09:22 +02:00
pcsc_funcs.c SCARD: Fix GSM authentication on USIM 2014-05-16 01:01:25 +03:00
pcsc_funcs.h SCARD: Clean up SIM/USIM selection 2013-11-17 16:47:38 +02:00
platform.h radiotap: Fix compilation for systems without le16toh/le32toh 2014-04-24 12:15:32 +03:00
radiotap_iter.h radiotap: Update radiotap parser to library version 2014-04-13 23:49:59 +03:00
radiotap.c radiotap: Update radiotap parser to library version 2014-04-13 23:49:59 +03:00
radiotap.h radiotap: Update radiotap parser to library version 2014-04-13 23:49:59 +03:00
state_machine.h Remove the GPL notification from files contributed by Jouni Malinen 2012-02-11 19:39:36 +02:00
trace.c trace: Replace demangle.h with internal defines 2014-04-25 19:27:48 +03:00
trace.h Remove the GPL notification from files contributed by Jouni Malinen 2012-02-11 19:39:36 +02:00
uuid.c Remove the GPL notification from files contributed by Jouni Malinen 2012-02-11 19:39:36 +02:00
uuid.h Remove the GPL notification from files contributed by Jouni Malinen 2012-02-11 19:39:36 +02:00
wpa_debug.c wpa_debug: Remove 2048 byte message length limit 2014-02-20 16:32:26 +02:00
wpa_debug.h Declare wpa_debug_* variables in src/utils/wpa_debug.h 2013-12-31 19:29:52 +02:00
wpabuf.c wpabuf: Get rid of separate ext_data pointer 2012-08-19 18:25:25 +03:00
wpabuf.h wpabuf: Get rid of separate ext_data pointer 2012-08-19 18:25:25 +03:00
xml_libxml2.c HS 2.0R2: Add wrapper functions for libxml2 2014-03-12 01:09:22 +02:00
xml-utils.c HS 2.0R2: Add wrapper functions for libxml2 2014-03-12 01:09:22 +02:00
xml-utils.h XML: Remove forgotten, unused definition of debug_print_func 2014-03-31 12:25:13 +03:00