#define DEFAULT_PAT_LRU_SIZE 10000
#endif
+/* maximum number of pollers that may be registered */
+#ifndef MAX_POLLERS
+#define MAX_POLLERS 10
+#endif
+
#endif /* _HAPROXY_DEFAULTS_H */
/*
- * include/types/fd.h
+ * include/haproxy/fd-t.h
* File descriptors states - check src/fd.c for explanations.
*
* Copyright (C) 2000-2014 Willy Tarreau - w@1wt.eu
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
-#ifndef _TYPES_FD_H
-#define _TYPES_FD_H
+#ifndef _HAPROXY_FD_T_H
+#define _HAPROXY_FD_T_H
#include <haproxy/api-t.h>
-#include <import/ist.h>
#include <haproxy/port_range-t.h>
/* Direction for each FD event update */
struct fdlist_entry {
int next;
int prev;
-} __attribute__ ((aligned(8)));
+} ALIGNED(8);
/* head of the fd cache */
struct fdlist {
int first;
int last;
-} __attribute__ ((aligned(8)));
+} ALIGNED(8);
/* info about one given fd */
struct fdtab {
/* only align on cache lines when using threads; 32-bit small archs
* can put everything in 32-bytes when threads are disabled.
*/
-__attribute__((aligned(64)))
+ALIGNED(64)
#endif
;
+/* polled mask, one bit per thread and per direction for each FD */
+struct polled_mask {
+ unsigned long poll_recv;
+ unsigned long poll_send;
+};
+
/* less often used information */
struct fdinfo {
struct port_range *port_range; /* optional port range to bind to */
int pref; /* try pollers with higher preference first */
};
-extern struct poller cur_poller; /* the current poller */
-extern int nbpollers;
-#define MAX_POLLERS 10
-extern struct poller pollers[MAX_POLLERS]; /* all registered pollers */
-
-extern struct fdtab *fdtab; /* array of all the file descriptors */
-extern struct fdinfo *fdinfo; /* less-often used infos for file descriptors */
-extern int totalconn; /* total # of terminated sessions */
-extern int actconn; /* # of active sessions */
-
-#endif /* _TYPES_FD_H */
+#endif /* _HAPROXY_FD_T_H */
/*
* Local variables:
/*
- * include/proto/fd.h
- * File descriptors states.
+ * include/haproxy/fd.h
+ * File descriptors states - exported variables and functions
*
- * Copyright (C) 2000-2014 Willy Tarreau - w@1wt.eu
+ * Copyright (C) 2000-2020 Willy Tarreau - w@1wt.eu
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
-#ifndef _PROTO_FD_H
-#define _PROTO_FD_H
+#ifndef _HAPROXY_FD_H
+#define _HAPROXY_FD_H
-#include <stdio.h>
#include <sys/time.h>
#include <sys/types.h>
+#include <stdio.h>
#include <unistd.h>
-
+#include <import/ist.h>
+#include <haproxy/activity.h>
#include <haproxy/api.h>
+#include <haproxy/fd-t.h>
+#include <haproxy/thread.h>
#include <haproxy/ticks.h>
#include <haproxy/time.h>
-#include <types/fd.h>
-#include <haproxy/activity.h>
/* public variables */
-extern volatile struct fdlist update_list;
-
+extern struct poller cur_poller; /* the current poller */
+extern int nbpollers;
+extern struct poller pollers[MAX_POLLERS]; /* all registered pollers */
+extern struct fdtab *fdtab; /* array of all the file descriptors */
+extern struct fdinfo *fdinfo; /* less-often used infos for file descriptors */
+extern int totalconn; /* total # of terminated sessions */
+extern int actconn; /* # of active sessions */
-extern struct polled_mask {
- unsigned long poll_recv;
- unsigned long poll_send;
-} *polled_mask;
+extern volatile struct fdlist update_list;
+extern struct polled_mask *polled_mask;
extern THREAD_LOCAL int *fd_updt; // FD updates list
extern THREAD_LOCAL int fd_nbupdt; // number of updates in the list
*/
int fd_takeover(int fd, void *expected_owner);
+/* lock used by FD migration */
#ifndef HA_HAVE_CAS_DW
__decl_thread(extern HA_RWLOCK_T fd_mig_lock);
#endif
}
-#endif /* _PROTO_FD_H */
+#endif /* _HAPROXY_FD_H */
/*
* Local variables:
#include <haproxy/pool.h>
#include <types/connection.h>
#include <types/listener.h>
-#include <proto/fd.h>
+#include <haproxy/fd.h>
#include <proto/obj_type.h>
#include <proto/session.h>
#include <proto/task.h>
#include <haproxy/pool.h>
#include <types/action.h>
#include <types/stream.h>
-#include <proto/fd.h>
+#include <haproxy/fd.h>
#include <haproxy/freq_ctr.h>
#include <proto/obj_type.h>
#include <proto/queue.h>
#include <types/global.h>
#include <types/task.h>
-#include <proto/fd.h>
+#include <haproxy/fd.h>
/* Principle of the wait queue.
*
#include <proto/backend.h>
#include <proto/checks.h>
#include <proto/stats.h>
-#include <proto/fd.h>
+#include <haproxy/fd.h>
#include <proto/http_htx.h>
#include <proto/log.h>
#include <proto/mux_pt.h>
#include <proto/cli.h>
#include <proto/compression.h>
#include <proto/stats.h>
-#include <proto/fd.h>
+#include <haproxy/fd.h>
#include <haproxy/freq_ctr.h>
#include <proto/frontend.h>
#include <proto/log.h>
#include <haproxy/net_helper.h>
#include <proto/connection.h>
-#include <proto/fd.h>
+#include <haproxy/fd.h>
#include <proto/frontend.h>
#include <proto/proto_tcp.h>
#include <proto/stream_interface.h>
#include <types/signal.h>
#include <proto/cli.h>
-#include <proto/fd.h>
+#include <haproxy/fd.h>
#include <proto/hlua.h>
#include <proto/stream_interface.h>
#include <proto/task.h>
#include <proto/cli.h>
#include <proto/checks.h>
#include <proto/dns.h>
-#include <proto/fd.h>
+#include <haproxy/fd.h>
#include <proto/http_ana.h>
#include <proto/http_rules.h>
#include <proto/log.h>
#include <types/global.h>
#include <haproxy/activity.h>
-#include <proto/fd.h>
+#include <haproxy/fd.h>
#include <proto/signal.h>
#include <types/global.h>
#include <haproxy/activity.h>
-#include <proto/fd.h>
+#include <haproxy/fd.h>
#include <proto/log.h>
#include <proto/signal.h>
#include <types/global.h>
#include <haproxy/activity.h>
-#include <proto/fd.h>
+#include <haproxy/fd.h>
#include <proto/signal.h>
#include <types/global.h>
#include <haproxy/activity.h>
-#include <proto/fd.h>
+#include <haproxy/fd.h>
#ifndef POLLRDHUP
#include <types/global.h>
#include <haproxy/activity.h>
-#include <proto/fd.h>
+#include <haproxy/fd.h>
/* private data */
#include <haproxy/api.h>
#include <types/global.h>
-#include <proto/fd.h>
+#include <haproxy/fd.h>
#include <proto/log.h>
#include <haproxy/port_range.h>
#include <proto/acl.h>
#include <proto/arg.h>
#include <proto/channel.h>
-#include <proto/fd.h>
+#include <haproxy/fd.h>
#include <proto/frontend.h>
#include <proto/log.h>
#include <proto/proto_tcp.h>
#include <proto/channel.h>
#include <proto/cli.h>
#include <proto/connection.h>
-#include <proto/fd.h>
+#include <haproxy/fd.h>
#include <proto/filters.h>
#include <proto/hlua.h>
#include <proto/http_rules.h>
#include <proto/acl.h>
#include <proto/connection.h>
-#include <proto/fd.h>
+#include <haproxy/fd.h>
#include <haproxy/freq_ctr.h>
#include <proto/log.h>
#include <proto/listener.h>
#include <proto/applet.h>
#include <proto/cli.h>
-#include <proto/fd.h>
+#include <haproxy/fd.h>
#include <proto/frontend.h>
#include <proto/log.h>
#include <proto/ring.h>
#include <types/signal.h>
#include <proto/cli.h>
-#include <proto/fd.h>
+#include <haproxy/fd.h>
#include <proto/listener.h>
#include <proto/log.h>
#include <proto/mworker.h>
#include <proto/applet.h>
#include <proto/channel.h>
#include <proto/cli.h>
-#include <proto/fd.h>
+#include <haproxy/fd.h>
#include <proto/frontend.h>
#include <proto/log.h>
#include <proto/mux_pt.h>
#include <types/global.h>
#include <proto/connection.h>
-#include <proto/fd.h>
+#include <haproxy/fd.h>
#include <haproxy/freq_ctr.h>
#include <proto/listener.h>
#include <proto/log.h>
#include <proto/arg.h>
#include <proto/channel.h>
#include <proto/connection.h>
-#include <proto/fd.h>
+#include <haproxy/fd.h>
#include <proto/http_rules.h>
#include <proto/listener.h>
#include <proto/log.h>
*/
#include <types/global.h>
-#include <types/fd.h>
+#include <haproxy/fd-t.h>
#include <types/proto_udp.h>
-#include <proto/fd.h>
+#include <haproxy/fd.h>
/* datagram handler callback */
void dgram_fd_handler(int fd)
#include <types/global.h>
#include <proto/connection.h>
-#include <proto/fd.h>
+#include <haproxy/fd.h>
#include <proto/listener.h>
#include <proto/log.h>
#include <haproxy/protocol.h>
#include <proto/applet.h>
#include <proto/cli.h>
#include <proto/backend.h>
-#include <proto/fd.h>
+#include <haproxy/fd.h>
#include <proto/filters.h>
#include <proto/listener.h>
#include <proto/log.h>
#include <haproxy/time.h>
#include <proto/connection.h>
-#include <proto/fd.h>
+#include <haproxy/fd.h>
#include <haproxy/freq_ctr.h>
#include <proto/log.h>
#include <proto/pipe.h>
#include <proto/channel.h>
#include <proto/connection.h>
#include <proto/cli.h>
-#include <proto/fd.h>
+#include <haproxy/fd.h>
#include <haproxy/freq_ctr.h>
#include <proto/frontend.h>
#include <proto/http_rules.h>
#include <proto/compression.h>
#include <proto/dns.h>
#include <proto/stats.h>
-#include <proto/fd.h>
+#include <haproxy/fd.h>
#include <haproxy/freq_ctr.h>
#include <proto/frontend.h>
#include <proto/http_htx.h>
#include <proto/connection.h>
#include <proto/dns.h>
#include <proto/stats.h>
-#include <proto/fd.h>
+#include <haproxy/fd.h>
#include <proto/filters.h>
#include <haproxy/freq_ctr.h>
#include <proto/frontend.h>
#include <import/eb32sctree.h>
#include <import/eb32tree.h>
-#include <proto/fd.h>
+#include <haproxy/fd.h>
#include <haproxy/freq_ctr.h>
#include <proto/proxy.h>
#include <proto/stream.h>
#include <haproxy/thread.h>
#include <haproxy/tools.h>
#include <types/global.h>
-#include <proto/fd.h>
+#include <haproxy/fd.h>
struct thread_info ha_thread_info[MAX_THREADS] = { };
THREAD_LOCAL struct thread_info *ti = &ha_thread_info[0];