mirror of
https://git.haproxy.org/git/haproxy.git/
synced 2025-09-23 14:51:27 +02:00
MINOR: receiver: define a flag for local accept
This flag is named RX_F_LOCAL_ACCEPT. It will be activated for special receivers where connection balancing to threads is already handle outside of listener_accept, such as with QUIC listeners.
This commit is contained in:
parent
4b40f19f92
commit
7f7713d6ef
@ -33,6 +33,7 @@
|
|||||||
#define RX_F_BOUND 0x00000001 /* receiver already bound */
|
#define RX_F_BOUND 0x00000001 /* receiver already bound */
|
||||||
#define RX_F_INHERITED 0x00000002 /* inherited FD from the parent process (fd@) */
|
#define RX_F_INHERITED 0x00000002 /* inherited FD from the parent process (fd@) */
|
||||||
#define RX_F_MWORKER 0x00000004 /* keep the FD open in the master but close it in the children */
|
#define RX_F_MWORKER 0x00000004 /* keep the FD open in the master but close it in the children */
|
||||||
|
#define RX_F_LOCAL_ACCEPT 0x00000008 /* do not use a tasklet for accept, connections will be accepted on the current thread */
|
||||||
|
|
||||||
/* Bit values for rx_settings->options */
|
/* Bit values for rx_settings->options */
|
||||||
#define RX_O_FOREIGN 0x00000001 /* receives on foreign addresses */
|
#define RX_O_FOREIGN 0x00000001 /* receives on foreign addresses */
|
||||||
|
@ -953,6 +953,9 @@ void listener_accept(struct listener *l)
|
|||||||
|
|
||||||
|
|
||||||
#if defined(USE_THREAD)
|
#if defined(USE_THREAD)
|
||||||
|
if (l->rx.flags & RX_F_LOCAL_ACCEPT)
|
||||||
|
goto local_accept;
|
||||||
|
|
||||||
mask = thread_mask(l->rx.bind_thread) & all_threads_mask;
|
mask = thread_mask(l->rx.bind_thread) & all_threads_mask;
|
||||||
if (atleast2(mask) && (global.tune.options & GTUNE_LISTENER_MQ) && !stopping) {
|
if (atleast2(mask) && (global.tune.options & GTUNE_LISTENER_MQ) && !stopping) {
|
||||||
struct accept_queue_ring *ring;
|
struct accept_queue_ring *ring;
|
||||||
@ -1066,6 +1069,7 @@ void listener_accept(struct listener *l)
|
|||||||
}
|
}
|
||||||
#endif // USE_THREAD
|
#endif // USE_THREAD
|
||||||
|
|
||||||
|
local_accept:
|
||||||
_HA_ATOMIC_INC(&l->thr_conn[tid]);
|
_HA_ATOMIC_INC(&l->thr_conn[tid]);
|
||||||
ret = l->accept(cli_conn);
|
ret = l->accept(cli_conn);
|
||||||
if (unlikely(ret <= 0)) {
|
if (unlikely(ret <= 0)) {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user