#define GTUNE_DISABLE_H2_WEBSOCKET (1<<21)
#define GTUNE_DISABLE_ACTIVE_CLOSE (1<<22)
#define GTUNE_QUICK_EXIT (1<<23)
-#define GTUNE_QUIC_SOCK_PER_CONN (1<<24)
+/* (1<<24) unused */
#define GTUNE_NO_QUIC (1<<25)
#define GTUNE_USE_FAST_FWD (1<<26)
#define GTUNE_LISTENER_MQ_FAIR (1<<27)
#define GTUNE_LISTENER_MQ_OPT (1<<28)
#define GTUNE_LISTENER_MQ_ANY (GTUNE_LISTENER_MQ_FAIR | GTUNE_LISTENER_MQ_OPT)
-#define GTUNE_QUIC_CC_HYSTART (1<<29)
-#define GTUNE_QUIC_NO_UDP_GSO (1<<30)
/* subsystem-specific debugging options for tune.debug */
#define GDBG_CPU_AFFINITY (1U<< 0)
#endif
#define QUIC_TUNE_NO_PACING 0x00000001
+#define QUIC_TUNE_NO_UDP_GSO 0x00000002
+#define QUIC_TUNE_SOCK_PER_CONN 0x00000004
+#define QUIC_TUNE_CC_HYSTART 0x00000008
struct quic_tune {
uint options;
return -1;
if (strcmp(args[1], "connection") == 0) {
- global.tune.options |= GTUNE_QUIC_SOCK_PER_CONN;
+ quic_tune.options |= QUIC_TUNE_SOCK_PER_CONN;
}
else if (strcmp(args[1], "listener") == 0) {
- global.tune.options &= ~GTUNE_QUIC_SOCK_PER_CONN;
+ quic_tune.options &= ~QUIC_TUNE_SOCK_PER_CONN;
}
else {
memprintf(err, "'%s' expects either 'listener' or 'connection' but got '%s'.", args[0], args[1]);
quic_tune.options |= QUIC_TUNE_NO_PACING;
}
else if (strcmp(suffix, "disable-udp-gso") == 0) {
- global.tune.options |= GTUNE_QUIC_NO_UDP_GSO;
+ quic_tune.options |= QUIC_TUNE_NO_UDP_GSO;
}
else {
memprintf(err, "'%s' keyword unhandled (please report this bug).", args[0]);
}
else if (strcmp(suffix, "cc-hystart") == 0) {
if (on)
- global.tune.options |= GTUNE_QUIC_CC_HYSTART;
+ quic_tune.options |= QUIC_TUNE_CC_HYSTART;
else
- global.tune.options &= ~GTUNE_QUIC_CC_HYSTART;
+ quic_tune.options &= ~QUIC_TUNE_CC_HYSTART;
}
return 0;
#include <haproxy/openssl-compat.h>
#include <haproxy/quic_conn.h>
#include <haproxy/quic_tp-t.h>
+#include <haproxy/quic_tune.h>
#include <haproxy/pattern.h>
#include <haproxy/peers.h>
#include <haproxy/pool.h>
#endif
#ifdef USE_THREAD
global.tune.options |= GTUNE_IDLE_POOL_SHARED;
-#endif
-#ifdef USE_QUIC
- global.tune.options |= GTUNE_QUIC_SOCK_PER_CONN;
#endif
global.tune.options |= GTUNE_STRICT_LIMITS;
/* Use zero-copy forwarding by default */
global.tune.no_zero_copy_fwd = 0;
+#ifdef USE_QUIC
+ quic_tune.options |= QUIC_TUNE_SOCK_PER_CONN;
+#endif
+
/* keep a copy of original arguments for the master process */
old_argv = copy_argv(argc, argv);
if (!old_argv) {
#include <haproxy/proxy-t.h>
#include <haproxy/quic_conn.h>
#include <haproxy/quic_sock.h>
+#include <haproxy/quic_tune.h>
#include <haproxy/sock.h>
#include <haproxy/sock_inet.h>
#include <haproxy/task.h>
int ret;
/* Check for connection socket-owner mode support. */
- if (global.tune.options & GTUNE_QUIC_SOCK_PER_CONN) {
+ if (quic_tune.options & QUIC_TUNE_SOCK_PER_CONN) {
ret = quic_test_conn_socket_owner();
if (ret < 0) {
goto err;
else if (!ret) {
ha_diag_warning("Your platform does not seem to support UDP source address retrieval through IP_PKTINFO or an alternative flag. "
"QUIC connections will use listener socket.\n");
- global.tune.options &= ~GTUNE_QUIC_SOCK_PER_CONN;
+ quic_tune.options &= ~QUIC_TUNE_SOCK_PER_CONN;
}
}
/* Check for UDP GSO support. */
- if (!(global.tune.options & GTUNE_QUIC_NO_UDP_GSO)) {
+ if (!(quic_tune.options & QUIC_TUNE_NO_UDP_GSO)) {
ret = quic_test_gso();
if (ret < 0) {
goto err;
else if (!ret) {
ha_diag_warning("Your platform does not support UDP GSO. "
"This will be automatically disabled for QUIC transfer.\n");
- global.tune.options |= GTUNE_QUIC_NO_UDP_GSO;
+ quic_tune.options |= QUIC_TUNE_NO_UDP_GSO;
}
}
#include <haproxy/quic_cc.h>
#include <haproxy/quic_cc_hystart.h>
#include <haproxy/quic_trace.h>
+#include <haproxy/quic_tune.h>
#include <haproxy/ticks.h>
#include <haproxy/trace.h>
c->last_w_max = 0;
c->W_est = 0;
c->recovery_start_time = 0;
- if (global.tune.options & GTUNE_QUIC_CC_HYSTART)
+ if (quic_tune.options & QUIC_TUNE_CC_HYSTART)
quic_cc_hystart_reset(&c->hystart);
TRACE_LEAVE(QUIC_EV_CONN_CC, cc->qc);
}
TRACE_PROTO("CC cubic", QUIC_EV_CONN_CC, cc->qc, ev);
switch (ev->type) {
case QUIC_CC_EVT_ACK:
- if (global.tune.options & GTUNE_QUIC_CC_HYSTART) {
+ if (quic_tune.options & QUIC_TUNE_CC_HYSTART) {
struct quic_hystart *h = &c->hystart;
unsigned int acked = QUIC_MIN(ev->ack.acked, (uint64_t)HYSTART_LIMIT * path->mtu);
#include <haproxy/quic_token.h>
#include <haproxy/quic_tp.h>
#include <haproxy/quic_trace.h>
+#include <haproxy/quic_tune.h>
#include <haproxy/quic_tx.h>
#include <haproxy/cbuf.h>
#include <haproxy/proto_quic.h>
conn_id->qc = qc;
if (HA_ATOMIC_LOAD(&l->rx.quic_mode) == QUIC_SOCK_MODE_CONN &&
- (global.tune.options & GTUNE_QUIC_SOCK_PER_CONN) &&
+ (quic_tune.options & QUIC_TUNE_SOCK_PER_CONN) &&
is_addr(local_addr)) {
TRACE_USER("Allocate a socket for QUIC connection", QUIC_EV_CONN_INIT, qc);
qc_alloc_fd(qc, local_addr, peer_addr);
#include <haproxy/quic_stream.h>
#include <haproxy/quic_tls.h>
#include <haproxy/quic_trace.h>
+#include <haproxy/quic_tune.h>
#include <haproxy/ssl_sock-t.h>
DECLARE_POOL(pool_head_quic_tx_packet, "quic_tx_packet", sizeof(struct quic_tx_packet));
}
qc->path->in_flight += pkt->in_flight_len;
pkt->pktns->tx.in_flight += pkt->in_flight_len;
- if ((global.tune.options & GTUNE_QUIC_CC_HYSTART) && pkt->pktns == qc->apktns)
+ if ((quic_tune.options & QUIC_TUNE_CC_HYSTART) && pkt->pktns == qc->apktns)
cc->algo->hystart_start_round(cc, pkt->pn_node.key);
if (pkt->in_flight_len)
qc_set_timer(qc);
/* Everything sent. Continue within the same datagram. */
prv_pkt = cur_pkt;
}
- else if (!(global.tune.options & GTUNE_QUIC_NO_UDP_GSO) &&
+ else if (!(quic_tune.options & QUIC_TUNE_NO_UDP_GSO) &&
!(HA_ATOMIC_LOAD(&qc->li->flags) & LI_F_UDP_GSO_NOTSUPP) &&
dglen == qc->path->mtu &&
(char *)end < b_wrap(buf) &&