]> git.ipfire.org Git - thirdparty/bind9.git/commitdiff
Rename the configuration option to load balance sockets to reuseport
authorOndřej Surý <ondrej@isc.org>
Wed, 6 Apr 2022 15:00:24 +0000 (17:00 +0200)
committerOndřej Surý <ondrej@isc.org>
Wed, 6 Apr 2022 15:51:12 +0000 (17:51 +0200)
After some back and forth, it was decidede to match the configuration
option with unbound ("so-reuseport"), PowerDNS ("reuseport") and/or
nginx ("reuseport").

(cherry picked from commit 7e71c4d0cc9b7961c56e9ec3cbdcde6c6e37c497)

CHANGES
bin/named/config.c
bin/named/named.conf.rst
bin/named/server.c
doc/arm/reference.rst
doc/man/named.conf.5in
doc/misc/options
doc/misc/options.active
doc/misc/options.grammar.rst
doc/notes/notes-current.rst
lib/isccfg/namedconf.c

diff --git a/CHANGES b/CHANGES
index d5ac1a044dedaf538c2697d4c984068de31d5760..ada40441d465a910e004a84f2e81ae8f00e0351b 100644 (file)
--- a/CHANGES
+++ b/CHANGES
@@ -1,5 +1,5 @@
-5852.  [func]          Add new "load-balance-socket" option to
-                       enable/disable load balancing of sockets. [GL #3249]
+5852.  [func]          Add new "reuseport" option to enable/disable load
+                       balancing of sockets. [GL #3249]
 
 5843.  [bug]           When an UPDATE targets a zone that is not configured,
                        the requested zone name is now logged in the "not
index d2676dd17b9fa4da382a19b78400b438727f2f90..e42f21c0fd467ca7a3003de9a448ec513ed9129e 100644 (file)
@@ -76,15 +76,7 @@ options {\n\
        interface-interval 60;\n\
 #      keep-response-order {none;};\n\
        listen-on {any;};\n\
-       listen-on-v6 {any;};\n"
-#if HAVE_SO_REUSEPORT_LB
-                           "\
-       load-balance-sockets yes;\n"
-#else
-                           "\
-       load-balance-sockets no;\n"
-#endif
-                           "\
+       listen-on-v6 {any;};\n\
 #      lock-file \"" NAMED_LOCALSTATEDIR "/run/named/named.lock\";\n\
        match-mapped-addresses no;\n\
        max-ixfr-ratio unlimited;\n\
@@ -96,7 +88,15 @@ options {\n\
        nta-lifetime 3600;\n\
        nta-recheck 300;\n\
 #      pid-file \"" NAMED_LOCALSTATEDIR "/run/named/named.pid\"; \n\
-       port 53;\n\
+       port 53;\n"
+#if HAVE_SO_REUSEPORT_LB
+                           "\
+       reuseport yes;\n"
+#else
+                           "\
+       reuseport no;\n"
+#endif
+                           "\
        prefetch 2 9;\n\
        recursing-file \"named.recursing\";\n\
        recursive-clients 1000;\n\
index 4829ba02471e7be1e2c3b04b96c49ae8128856d1..64a2b770c8b816134f2f8a108597aebc6ce7d74e 100644 (file)
@@ -288,7 +288,6 @@ OPTIONS
            integer ] {
            address_match_element; ... };
        lmdb-mapsize sizeval;
-       load-balance-sockets boolean;
        lock-file ( quoted_string | none );
        managed-keys-directory quoted_string;
        masterfile-format ( map | raw | text );
@@ -397,6 +396,7 @@ OPTIONS
            [ recursive-only boolean ] [ nsip-enable boolean ] [
            nsdname-enable boolean ] [ dnsrps-enable boolean ] [
            dnsrps-options { unspecified-text } ];
+       reuseport boolean;
        root-delegation-only [ exclude { string; ... } ];
        root-key-sentinel boolean;
        rrset-order { [ class string ] [ type string ] [ name
index ef4d5e4be1a95027344e0f272e7763ad67b87666..978ef68c5cc5d174ad9cc3a81ccbe25e031c75da 100644 (file)
@@ -8791,7 +8791,7 @@ load_configuration(const char *filename, named_server_t *server,
        ns_interfacemgr_setbacklog(server->interfacemgr, backlog);
 
        obj = NULL;
-       result = named_config_get(maps, "load-balance-sockets", &obj);
+       result = named_config_get(maps, "reuseport", &obj);
        INSIST(result == ISC_R_SUCCESS);
        loadbalancesockets = cfg_obj_asboolean(obj);
 #if HAVE_SO_REUSEPORT_LB
@@ -8801,14 +8801,12 @@ load_configuration(const char *filename, named_server_t *server,
        } else if (loadbalancesockets !=
                   isc_nm_getloadbalancesockets(named_g_nm)) {
                cfg_obj_log(obj, named_g_lctx, ISC_LOG_WARNING,
-                           "changing load-balance-sockets value requires "
-                           "server restart");
+                           "changing reuseport value requires server restart");
        }
 #else
        if (loadbalancesockets) {
-               cfg_obj_log(
-                       obj, named_g_lctx, ISC_LOG_WARNING,
-                       "load-balance-sockets has no effect on this system");
+               cfg_obj_log(obj, named_g_lctx, ISC_LOG_WARNING,
+                           "reuseport has no effect on this system");
        }
 #endif
 
index d665d46cf4dc01bcc0c8aedde6545f05f1acbcee..8a9d9548008bfe4f9247d2ff4a3d31f5111cb938 100644 (file)
@@ -1691,17 +1691,16 @@ Boolean Options
    If ``yes``, respond to root key sentinel probes as described in
    draft-ietf-dnsop-kskroll-sentinel-08. The default is ``yes``.
 
-``load-balance-sockets``
-
+``reuseport``
    This option enables kernel load-balancing of sockets on systems which support
-   it, including Linux and FreeBSD. This instructs the kernel to distribute
-   incoming socket connections among the networking threads based on a hashing
-   scheme. For more information, see the receive network flow classification
-   options (``rx-flow-hash``) section in the ``ethtool`` manual page. The
-   default is ``yes``.
-
-   Enabling ``load-balance-sockets`` significantly increases general throughput
-   when incoming traffic is distributed uniformly onto the threads by the
+   it, including Linux (SO_REUSEPORT) and FreeBSD (SO_REUSEPORT_LB). This
+   instructs the kernel to distribute incoming socket connections among the
+   networking threads based on a hashing scheme. For more information, see the
+   receive network flow classification options (``rx-flow-hash``) section in the
+   ``ethtool`` manual page. The default is ``yes``.
+
+   Enabling ``reuseport`` significantly increases general throughput when
+   incoming traffic is distributed uniformly onto the threads by the
    operating system. However, in cases where a worker thread is busy with a
    long-lasting operation, such as processing a Response Policy Zone (RPZ) or
    Catalog Zone update or an unusually large zone transfer, incoming traffic
index 77499fd344f8bca83061a0e16ad7636714d14487..676e4447b96a1aa229b957847a8885098ebd5b3e 100644 (file)
@@ -340,7 +340,6 @@ options {
           integer ] {
           address_match_element; ... };
       lmdb\-mapsize sizeval;
-      load\-balance\-sockets boolean;
       lock\-file ( quoted_string | none );
       managed\-keys\-directory quoted_string;
       masterfile\-format ( map | raw | text );
@@ -449,6 +448,7 @@ options {
           [ recursive\-only boolean ] [ nsip\-enable boolean ] [
           nsdname\-enable boolean ] [ dnsrps\-enable boolean ] [
           dnsrps\-options { unspecified\-text } ];
+      reuseport boolean;
       root\-delegation\-only [ exclude { string; ... } ];
       root\-key\-sentinel boolean;
       rrset\-order { [ class string ] [ type string ] [ name
index a7fcd160625be4d49ccc4b3557db29d8fbc298aa..1e90b555347e857dbc274859a792d9ad25def77a 100644 (file)
@@ -228,7 +228,6 @@ options {
             <integer> ] {
             <address_match_element>; ... }; // may occur multiple times
         lmdb-mapsize <sizeval>;
-        load-balance-sockets <boolean>;
         lock-file ( <quoted_string> | none );
         maintain-ixfr-base <boolean>; // ancient
         managed-keys-directory <quoted_string>;
@@ -348,6 +347,7 @@ options {
             [ recursive-only <boolean> ] [ nsip-enable <boolean> ] [
             nsdname-enable <boolean> ] [ dnsrps-enable <boolean> ] [
             dnsrps-options { <unspecified-text> } ];
+        reuseport <boolean>;
         rfc2308-type1 <boolean>; // ancient
         root-delegation-only [ exclude { <string>; ... } ];
         root-key-sentinel <boolean>;
index 4f1661c3cb0f61f6a139bc16b5f1e31405eac7cd..8fec88e0fe1c6068d67baecc69b1fe57f0a9968e 100644 (file)
@@ -205,7 +205,6 @@ options {
             <integer> ] {
             <address_match_element>; ... }; // may occur multiple times
         lmdb-mapsize <sizeval>;
-        load-balance-sockets <boolean>;
         lock-file ( <quoted_string> | none );
         managed-keys-directory <quoted_string>;
         masterfile-format ( map | raw | text );
@@ -314,6 +313,7 @@ options {
             [ recursive-only <boolean> ] [ nsip-enable <boolean> ] [
             nsdname-enable <boolean> ] [ dnsrps-enable <boolean> ] [
             dnsrps-options { <unspecified-text> } ];
+        reuseport <boolean>;
         root-delegation-only [ exclude { <string>; ... } ];
         root-key-sentinel <boolean>;
         rrset-order { [ class <string> ] [ type <string> ] [ name
index 3ab9ab9888735e6e37bf3be32f293d6dd0c2bc09..438072c95c41d712322727428c4de1a7c441b254 100644 (file)
        dnssec-secure-to-insecure <boolean>;
        dnssec-update-mode ( maintain | no-resign );
        dnssec-validation ( yes | no | auto );
-       dnstap { ( all | auth | client | forwarder |
-           resolver | update ) [ ( query | response ) ];
-           ... };
-       dnstap-identity ( <quoted_string> | none |
-           hostname );
-       dnstap-output ( file | unix ) <quoted_string> [
-           size ( unlimited | <size> ) ] [ versions (
-           unlimited | <integer> ) ] [ suffix ( increment
-           | timestamp ) ];
+       dnstap { ( all | auth | client | forwarder | resolver | update ) [
+           ( query | response ) ]; ... };
+       dnstap-identity ( <quoted_string> | none | hostname );
+       dnstap-output ( file | unix ) <quoted_string> [ size ( unlimited |
+           <size> ) ] [ versions ( unlimited | <integer> ) ] [ suffix (
+           increment | timestamp ) ];
        dnstap-version ( <quoted_string> | none );
        dscp <integer>;
        dual-stack-servers [ port <integer> ] { ( <quoted_string> [ port
            <integer> ] {
            <address_match_element>; ... };
        lmdb-mapsize <sizeval>;
-       load-balance-sockets <boolean>;
        lock-file ( <quoted_string> | none );
        managed-keys-directory <quoted_string>;
        masterfile-format ( map | raw | text );
            [ recursive-only <boolean> ] [ nsip-enable <boolean> ] [
            nsdname-enable <boolean> ] [ dnsrps-enable <boolean> ] [
            dnsrps-options { <unspecified-text> } ];
+       reuseport <boolean>;
        root-delegation-only [ exclude { <string>; ... } ];
        root-key-sentinel <boolean>;
        rrset-order { [ class <string> ] [ type <string> ] [ name
index 3eed6a5089ba22cca2ea6e449d09b26b7a6b7ec9..d223cb73287326729613caa5225e23cb69f650ee 100644 (file)
@@ -37,7 +37,7 @@ Feature Changes
 
 - None.
 
-- Add a new configuration option ``load-balance-sockets`` to disable
+- Add a new configuration option ``reuseport`` to disable
   load balancing on sockets in scenarios in which processing of
   Response Policy Zones (RPZ), Catalog Zones, or large zone transfers
   can cause service disruptions. See the BIND 9 ARM for more detail.
index d86f6f7105e7dd2343496e39d2ba06a1594e8f54..cab4c22ef5261b8d017906e88edf4e114099d17c 100644 (file)
@@ -1222,7 +1222,6 @@ static cfg_clausedef_t options_clauses[] = {
        { "keep-response-order", &cfg_type_bracketed_aml, 0 },
        { "listen-on", &cfg_type_listenon, CFG_CLAUSEFLAG_MULTI },
        { "listen-on-v6", &cfg_type_listenon, CFG_CLAUSEFLAG_MULTI },
-       { "load-balance-sockets", &cfg_type_boolean, 0 },
        { "lock-file", &cfg_type_qstringornone, 0 },
        { "managed-keys-directory", &cfg_type_qstring, 0 },
        { "match-mapped-addresses", &cfg_type_boolean, 0 },
@@ -1238,6 +1237,7 @@ static cfg_clausedef_t options_clauses[] = {
        { "random-device", &cfg_type_qstringornone, 0 },
        { "recursing-file", &cfg_type_qstring, 0 },
        { "recursive-clients", &cfg_type_uint32, 0 },
+       { "reuseport", &cfg_type_boolean, 0 },
        { "reserved-sockets", &cfg_type_uint32, 0 },
        { "secroots-file", &cfg_type_qstring, 0 },
        { "serial-queries", &cfg_type_uint32, CFG_CLAUSEFLAG_ANCIENT },