]> git.kaiwu.me - nginx.git/commitdiff
QUIC: removed "quic_mtu" directive.
authorRoman Arutyunyan <arut@nginx.com>
Thu, 11 May 2023 06:37:51 +0000 (10:37 +0400)
committerRoman Arutyunyan <arut@nginx.com>
Thu, 11 May 2023 06:37:51 +0000 (10:37 +0400)
The directive used to set the value of the "max_udp_payload_size" transport
parameter.  According to RFC 9000, Section 18.2, the value specifies the size
of buffer for reading incoming datagrams:

    This limit does act as an additional constraint on datagram size in
    the same way as the path MTU, but it is a property of the endpoint
    and not the path; see Section 14. It is expected that this is the
    space an endpoint dedicates to holding incoming packets.

Current QUIC implementation uses the maximum possible buffer size (65527) for
reading datagrams.

README
src/event/quic/ngx_event_quic.h
src/event/quic/ngx_event_quic_transport.c
src/http/v3/ngx_http_v3_module.c
src/stream/ngx_stream_quic_module.c

diff --git a/README b/README
index 7470457c33da3e6d7943dca6a244eb1f03fab217..cde316a7d1f9d8ffb6abb4a680d47f2d1cc3ae33 100644 (file)
--- a/README
+++ b/README
@@ -123,10 +123,6 @@ Experimental QUIC support for nginx
 
         quic_gso on;
 
-    To limit maximum UDP payload size on receive path:
-
-        quic_mtu <size>;
-
     To set host key for various tokens:
 
         quic_host_key <filename>;
@@ -209,14 +205,6 @@ Example configuration:
     Optimized sending is only supported on Linux featuring UDP_SEGMENT.
 
 
-    Syntax: quic_mtu size;
-    Default: quic_mtu 65527;
-    Context: http | stream, server
-
-    Sets the QUIC max_udp_payload_size transport parameter value.
-    This is the maximum UDP payload that we are willing to receive.
-
-
     Syntax: quic_host_key file;
     Default: -
     Context: http | stream, server
index 56713ec4d89beb31c426161eb581e61de8b0fb6c..0c68d68f0da09411f8981b17e8e4b6c434fd7509 100644 (file)
@@ -69,7 +69,6 @@ typedef struct {
     ngx_flag_t                     disable_active_migration;
     ngx_msec_t                     timeout;
     ngx_str_t                      host_key;
-    size_t                         mtu;
     size_t                         stream_buffer_size;
     ngx_uint_t                     max_concurrent_streams_bidi;
     ngx_uint_t                     max_concurrent_streams_uni;
index 46456db1dda474799f668e35233871e32a4bbb20..b663efbe10c16b36fb787fdf263c598ca0a7b837 100644 (file)
@@ -1987,7 +1987,7 @@ ngx_quic_init_transport_params(ngx_quic_tp_t *tp, ngx_quic_conf_t *qcf)
 
     tp->max_idle_timeout = qcf->timeout;
 
-    tp->max_udp_payload_size = qcf->mtu;
+    tp->max_udp_payload_size = NGX_QUIC_MAX_UDP_PAYLOAD_SIZE;
 
     nstreams = qcf->max_concurrent_streams_bidi
                + qcf->max_concurrent_streams_uni;
index 02b88b4793ae38213e6d8f4c3be7f634a9132a61..8569f07a0f237367f338888c2fdd2c0f14468e39 100644 (file)
@@ -16,8 +16,6 @@ static ngx_int_t ngx_http_v3_add_variables(ngx_conf_t *cf);
 static void *ngx_http_v3_create_srv_conf(ngx_conf_t *cf);
 static char *ngx_http_v3_merge_srv_conf(ngx_conf_t *cf, void *parent,
     void *child);
-static char *ngx_http_quic_mtu(ngx_conf_t *cf, void *post,
-    void *data);
 static char *ngx_http_quic_host_key(ngx_conf_t *cf, ngx_command_t *cmd,
     void *conf);
 static void *ngx_http_v3_create_loc_conf(ngx_conf_t *cf);
@@ -26,10 +24,6 @@ static char *ngx_http_v3_merge_loc_conf(ngx_conf_t *cf, void *parent,
 static char *ngx_http_v3_push(ngx_conf_t *cf, ngx_command_t *cmd, void *conf);
 
 
-static ngx_conf_post_t  ngx_http_quic_mtu_post =
-    { ngx_http_quic_mtu };
-
-
 static ngx_command_t  ngx_http_v3_commands[] = {
 
     { ngx_string("http3"),
@@ -95,13 +89,6 @@ static ngx_command_t  ngx_http_v3_commands[] = {
       offsetof(ngx_http_v3_srv_conf_t, quic.gso_enabled),
       NULL },
 
-    { ngx_string("quic_mtu"),
-      NGX_HTTP_MAIN_CONF|NGX_HTTP_SRV_CONF|NGX_CONF_TAKE1,
-      ngx_conf_set_size_slot,
-      NGX_HTTP_SRV_CONF_OFFSET,
-      offsetof(ngx_http_v3_srv_conf_t, quic.mtu),
-      &ngx_http_quic_mtu_post },
-
     { ngx_string("quic_host_key"),
       NGX_HTTP_MAIN_CONF|NGX_HTTP_SRV_CONF|NGX_CONF_TAKE1,
       ngx_http_quic_host_key,
@@ -240,7 +227,6 @@ ngx_http_v3_create_srv_conf(ngx_conf_t *cf)
     h3scf->max_concurrent_pushes = NGX_CONF_UNSET_UINT;
     h3scf->max_concurrent_streams = NGX_CONF_UNSET_UINT;
 
-    h3scf->quic.mtu = NGX_CONF_UNSET_SIZE;
     h3scf->quic.stream_buffer_size = NGX_CONF_UNSET_SIZE;
     h3scf->quic.max_concurrent_streams_bidi = NGX_CONF_UNSET_UINT;
     h3scf->quic.max_concurrent_streams_uni = NGX_HTTP_V3_MAX_UNI_STREAMS;
@@ -277,9 +263,6 @@ ngx_http_v3_merge_srv_conf(ngx_conf_t *cf, void *parent, void *child)
 
     conf->max_blocked_streams = conf->max_concurrent_streams;
 
-    ngx_conf_merge_size_value(conf->quic.mtu, prev->quic.mtu,
-                              NGX_QUIC_MAX_UDP_PAYLOAD_SIZE);
-
     ngx_conf_merge_size_value(conf->quic.stream_buffer_size,
                               prev->quic.stream_buffer_size,
                               65536);
@@ -334,26 +317,6 @@ ngx_http_v3_merge_srv_conf(ngx_conf_t *cf, void *parent, void *child)
 }
 
 
-static char *
-ngx_http_quic_mtu(ngx_conf_t *cf, void *post, void *data)
-{
-    size_t *sp = data;
-
-    if (*sp < NGX_QUIC_MIN_INITIAL_SIZE
-        || *sp > NGX_QUIC_MAX_UDP_PAYLOAD_SIZE)
-    {
-        ngx_conf_log_error(NGX_LOG_EMERG, cf, 0,
-                           "\"quic_mtu\" must be between %d and %d",
-                           NGX_QUIC_MIN_INITIAL_SIZE,
-                           NGX_QUIC_MAX_UDP_PAYLOAD_SIZE);
-
-        return NGX_CONF_ERROR;
-    }
-
-    return NGX_CONF_OK;
-}
-
-
 static char *
 ngx_http_quic_host_key(ngx_conf_t *cf, ngx_command_t *cmd, void *conf)
 {
index 644fa03801c2cd604d12bd87cb27f3664aad5678..42f5fe0603e115e89989b8d2b0293f1b37b53d2c 100644 (file)
@@ -16,12 +16,9 @@ static ngx_int_t ngx_stream_quic_add_variables(ngx_conf_t *cf);
 static void *ngx_stream_quic_create_srv_conf(ngx_conf_t *cf);
 static char *ngx_stream_quic_merge_srv_conf(ngx_conf_t *cf, void *parent,
     void *child);
-static char *ngx_stream_quic_mtu(ngx_conf_t *cf, void *post, void *data);
 static char *ngx_stream_quic_host_key(ngx_conf_t *cf, ngx_command_t *cmd,
     void *conf);
 
-static ngx_conf_post_t  ngx_stream_quic_mtu_post =
-    { ngx_stream_quic_mtu };
 
 static ngx_command_t  ngx_stream_quic_commands[] = {
 
@@ -32,13 +29,6 @@ static ngx_command_t  ngx_stream_quic_commands[] = {
       offsetof(ngx_quic_conf_t, timeout),
       NULL },
 
-    { ngx_string("quic_mtu"),
-      NGX_STREAM_MAIN_CONF|NGX_STREAM_SRV_CONF|NGX_CONF_TAKE1,
-      ngx_conf_set_size_slot,
-      NGX_STREAM_SRV_CONF_OFFSET,
-      offsetof(ngx_quic_conf_t, mtu),
-      &ngx_stream_quic_mtu_post },
-
     { ngx_string("quic_stream_buffer_size"),
       NGX_STREAM_MAIN_CONF|NGX_STREAM_SRV_CONF|NGX_CONF_TAKE1,
       ngx_conf_set_size_slot,
@@ -175,7 +165,6 @@ ngx_stream_quic_create_srv_conf(ngx_conf_t *cf)
      */
 
     conf->timeout = NGX_CONF_UNSET_MSEC;
-    conf->mtu = NGX_CONF_UNSET_SIZE;
     conf->stream_buffer_size = NGX_CONF_UNSET_SIZE;
     conf->max_concurrent_streams_bidi = NGX_CONF_UNSET_UINT;
     conf->max_concurrent_streams_uni = NGX_CONF_UNSET_UINT;
@@ -199,9 +188,6 @@ ngx_stream_quic_merge_srv_conf(ngx_conf_t *cf, void *parent, void *child)
 
     ngx_conf_merge_msec_value(conf->timeout, prev->timeout, 60000);
 
-    ngx_conf_merge_size_value(conf->mtu, prev->mtu,
-                              NGX_QUIC_MAX_UDP_PAYLOAD_SIZE);
-
     ngx_conf_merge_size_value(conf->stream_buffer_size,
                               prev->stream_buffer_size,
                               65536);
@@ -259,26 +245,6 @@ ngx_stream_quic_merge_srv_conf(ngx_conf_t *cf, void *parent, void *child)
 }
 
 
-static char *
-ngx_stream_quic_mtu(ngx_conf_t *cf, void *post, void *data)
-{
-    size_t *sp = data;
-
-    if (*sp < NGX_QUIC_MIN_INITIAL_SIZE
-        || *sp > NGX_QUIC_MAX_UDP_PAYLOAD_SIZE)
-    {
-        ngx_conf_log_error(NGX_LOG_EMERG, cf, 0,
-                           "\"quic_mtu\" must be between %d and %d",
-                           NGX_QUIC_MIN_INITIAL_SIZE,
-                           NGX_QUIC_MAX_UDP_PAYLOAD_SIZE);
-
-        return NGX_CONF_ERROR;
-    }
-
-    return NGX_CONF_OK;
-}
-
-
 static char *
 ngx_stream_quic_host_key(ngx_conf_t *cf, ngx_command_t *cmd, void *conf)
 {