aboutgitcodebugslistschat
path: root/passt.c
diff options
context:
space:
mode:
Diffstat (limited to 'passt.c')
-rw-r--r--passt.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/passt.c b/passt.c
index 3604fa1..6645e45 100644
--- a/passt.c
+++ b/passt.c
@@ -28,6 +28,7 @@
#include <sys/stat.h>
#include <dirent.h>
#include <fcntl.h>
+#include <sys/mman.h>
#include <sys/resource.h>
#include <sys/uio.h>
#include <sys/wait.h>
@@ -61,12 +62,12 @@
#include "tap.h"
#include "conf.h"
-#define EPOLL_EVENTS 10
+#define EPOLL_EVENTS 8
#define __TIMER_INTERVAL MIN(TCP_TIMER_INTERVAL, UDP_TIMER_INTERVAL)
#define TIMER_INTERVAL MIN(__TIMER_INTERVAL, ICMP_TIMER_INTERVAL)
-char pkt_buf [PKT_BUF_BYTES];
+char pkt_buf[PKT_BUF_BYTES] __attribute__ ((aligned(PAGE_SIZE)));
char *ip_proto_str[IPPROTO_SCTP + 1] = {
[IPPROTO_ICMP] = "ICMP",
@@ -323,6 +324,9 @@ int main(int argc, char **argv)
log_name = "passt";
}
+ if (madvise(pkt_buf, TAP_BUF_BYTES, MADV_HUGEPAGE))
+ perror("madvise");
+
openlog(log_name, 0, LOG_DAEMON);
setlogmask(LOG_MASK(LOG_EMERG));