This is an automated email from the ASF dual-hosted git repository.
duke8253 pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/trafficserver.git
The following commit(s) were added to refs/heads/master by this push:
new 0776a0d8ba add new config option to support CUBIC (#10888)
0776a0d8ba is described below
commit 0776a0d8ba40e5392fc6d7fa60beb11bbdc96267
Author: Fei Deng <[email protected]>
AuthorDate: Fri Dec 1 11:34:49 2023 -0500
add new config option to support CUBIC (#10888)
---
doc/admin-guide/files/records.yaml.en.rst | 11 +++++++++++
include/iocore/net/quic/QUICConfig.h | 5 +++++
src/iocore/net/QUICNetProcessor.cc | 4 +---
src/iocore/net/quic/QUICConfig.cc | 14 ++++++++++++++
src/records/RecordsConfig.cc | 2 ++
5 files changed, 33 insertions(+), 3 deletions(-)
diff --git a/doc/admin-guide/files/records.yaml.en.rst
b/doc/admin-guide/files/records.yaml.en.rst
index fc0415eaa4..4dc2b8ae06 100644
--- a/doc/admin-guide/files/records.yaml.en.rst
+++ b/doc/admin-guide/files/records.yaml.en.rst
@@ -4785,6 +4785,17 @@ removed in the future without prior notice.
Disables HTTP/0.9 over QUIC by default.
+.. ts:cv:: CONFIG proxy.config.quic.cc_algorithm INT 0
+
+ Specified the congestion control algorithm.
+
+ ===== ======================================================================
+ Value Description
+ ===== ======================================================================
+ ``0`` RENO (default).
+ ``1`` CUBIC.
+ ===== ======================================================================
+
UDP Configuration
=====================
diff --git a/include/iocore/net/quic/QUICConfig.h
b/include/iocore/net/quic/QUICConfig.h
index a48a24c583..ca77da8c4b 100644
--- a/include/iocore/net/quic/QUICConfig.h
+++ b/include/iocore/net/quic/QUICConfig.h
@@ -24,6 +24,7 @@
#pragma once
#include <openssl/ssl.h>
+#include <quiche.h>
#include "iocore/eventsystem/ConfigProcessor.h"
#include "../../../../src/iocore/net/P_SSLCertLookup.h"
@@ -87,6 +88,8 @@ public:
bool disable_http_0_9() const;
+ quiche_cc_algorithm get_cc_algorithm() const;
+
private:
static int _connection_table_size;
// TODO: make configurable
@@ -140,6 +143,8 @@ private:
uint32_t _max_send_udp_payload_size_out = 0;
uint32_t _disable_http_0_9 = 1;
+
+ uint32_t _cc_algorithm = 0;
};
class QUICConfig
diff --git a/src/iocore/net/QUICNetProcessor.cc
b/src/iocore/net/QUICNetProcessor.cc
index 57322f504a..57fe6eeac6 100644
--- a/src/iocore/net/QUICNetProcessor.cc
+++ b/src/iocore/net/QUICNetProcessor.cc
@@ -34,8 +34,6 @@
#include "iocore/net/quic/QUICConfig.h"
#include "iocore/net/QUICMultiCertConfigLoader.h"
-#include <quiche.h>
-
//
// Global Data
//
@@ -99,7 +97,7 @@ QUICNetProcessor::start(int, size_t stacksize)
quiche_config_set_initial_max_streams_uni(this->_quiche_config,
params->initial_max_streams_uni_in());
quiche_config_set_disable_active_migration(this->_quiche_config,
params->disable_active_migration());
quiche_config_set_active_connection_id_limit(this->_quiche_config,
params->active_cid_limit_in());
- quiche_config_set_cc_algorithm(this->_quiche_config, QUICHE_CC_RENO);
+ quiche_config_set_cc_algorithm(this->_quiche_config,
params->get_cc_algorithm());
#ifdef TLS1_3_VERSION_DRAFT_TXT
// FIXME: remove this when TLS1_3_VERSION_DRAFT_TXT is removed
diff --git a/src/iocore/net/quic/QUICConfig.cc
b/src/iocore/net/quic/QUICConfig.cc
index cf6c8bc454..23d3c50b58 100644
--- a/src/iocore/net/quic/QUICConfig.cc
+++ b/src/iocore/net/quic/QUICConfig.cc
@@ -161,6 +161,7 @@ QUICConfigParams::initialize()
REC_EstablishStaticConfigInt32U(this->_max_send_udp_payload_size_in,
"proxy.config.quic.max_send_udp_payload_size_in");
REC_EstablishStaticConfigInt32U(this->_max_send_udp_payload_size_out,
"proxy.config.quic.max_send_udp_payload_size_out");
REC_EstablishStaticConfigInt32U(this->_disable_http_0_9,
"proxy.config.quic.disable_http_0_9");
+ REC_EstablishStaticConfigInt32U(this->_cc_algorithm,
"proxy.config.quic.cc_algorithm");
this->_client_ssl_ctx = quic_init_client_ssl_ctx(this);
}
@@ -419,6 +420,19 @@ QUICConfigParams::disable_http_0_9() const
return this->_disable_http_0_9;
}
+quiche_cc_algorithm
+QUICConfigParams::get_cc_algorithm() const
+{
+ switch (this->_cc_algorithm) {
+ case 0:
+ return QUICHE_CC_RENO;
+ case 1:
+ return QUICHE_CC_CUBIC;
+ default:
+ return QUICHE_CC_RENO;
+ }
+}
+
//
// QUICConfig
//
diff --git a/src/records/RecordsConfig.cc b/src/records/RecordsConfig.cc
index 75ed50f58d..4173656c74 100644
--- a/src/records/RecordsConfig.cc
+++ b/src/records/RecordsConfig.cc
@@ -1422,6 +1422,8 @@ static const RecordElement RecordsConfig[] =
,
{RECT_CONFIG, "proxy.config.quic.disable_http_0_9", RECD_INT, "1",
RECU_DYNAMIC, RR_NULL, RECC_STR, "[0-1]", RECA_NULL}
,
+ {RECT_CONFIG, "proxy.config.quic.cc_algorithm", RECD_INT, "0", RECU_DYNAMIC,
RR_NULL, RECC_STR, "[0-1]", RECA_NULL}
+ ,
//# Add LOCAL Records Here
{RECT_LOCAL, "proxy.config.incoming_ip_to_bind", RECD_STRING, nullptr,
RECU_NULL, RR_NULL, RECC_NULL, nullptr, RECA_NULL}