diff --git a/CHANGES b/CHANGES
index f400a84e0c..68389de8d5 100644
--- a/CHANGES
+++ b/CHANGES
@@ -1,3 +1,7 @@
+4447. [tuning] Allow the fstrm_iothr_init() options to be set using
+ named.conf to control how dnstap manages the data
+ flow. [RT #42974]
+
4446. [bug] The cache_find() and _findrdataset() functions
could find rdatasets that had been marked stale.
[RT #42853]
diff --git a/bin/named/named.conf.docbook b/bin/named/named.conf.docbook
index a4b1a298cb..67310755a6 100644
--- a/bin/named/named.conf.docbook
+++ b/bin/named/named.conf.docbook
@@ -200,8 +200,19 @@ options {
coresize size;
datasize size;
directory quoted_string;
+ dnstap { message_type; ... };
+ dnstap-output ( file | unix ) path_name;
+ dnstap-identity ( string | hostname | none );
+ dnstap-version ( string | none );
dump-file quoted_string;
files size;
+ fstrm-set-buffer-hint number;
+ fstrm-set-flush-timeout number;
+ fstrm-set-input-queue-size number;
+ fstrm-set-output-notify-threshold number;
+ fstrm-set-output-queue-model ( mpsc | spsc ) ;
+ fstrm-set-output-queue-size number;
+ fstrm-set-reopen-interval number;
heartbeat-interval integer;
host-statistics boolean; // not implemented
host-statistics-max number; // not implemented
diff --git a/bin/named/server.c b/bin/named/server.c
index 163b1b4ae3..dba45fdf5b 100644
--- a/bin/named/server.c
+++ b/bin/named/server.c
@@ -2939,6 +2939,8 @@ configure_dnstap(const cfg_obj_t **maps, dns_view_t *view) {
const cfg_obj_t *dlist = NULL;
dns_dtmsgtype_t dttypes = 0;
dns_dtmode_t dmode;
+ unsigned int i;
+ struct fstrm_iothr_options *fopt = NULL;
result = ns_config_get(maps, "dnstap", &dlist);
if (result != ISC_R_SUCCESS)
@@ -3004,7 +3006,71 @@ configure_dnstap(const cfg_obj_t **maps, dns_view_t *view) {
dpath = cfg_obj_asstring(obj2);
- CHECKM(dns_dt_create(ns_g_mctx, dmode, dpath, ns_g_cpus,
+ fopt = fstrm_iothr_options_init();
+ fstrm_iothr_options_set_num_input_queues(fopt, ns_g_cpus);
+ fstrm_iothr_options_set_queue_model(fopt,
+ FSTRM_IOTHR_QUEUE_MODEL_MPSC);
+
+ obj = NULL;
+ result = ns_config_get(maps, "fstrm-set-buffer-hint", &obj);
+ if (result == ISC_R_SUCCESS) {
+ i = cfg_obj_asuint32(obj);
+ fstrm_iothr_options_set_buffer_hint(fopt, i);
+ }
+
+ obj = NULL;
+ result = ns_config_get(maps, "fstrm-set-flush-timeout", &obj);
+ if (result == ISC_R_SUCCESS) {
+ i = cfg_obj_asuint32(obj);
+ fstrm_iothr_options_set_flush_timeout(fopt, i);
+ }
+
+ obj = NULL;
+ result = ns_config_get(maps, "fstrm-set-input-queue-size",
+ &obj);
+ if (result == ISC_R_SUCCESS) {
+ i = cfg_obj_asuint32(obj);
+ fstrm_iothr_options_set_input_queue_size(fopt, i);
+ }
+
+ obj = NULL;
+ result = ns_config_get(maps,
+ "fstrm-set-output-notify-threshold",
+ &obj);
+ if (result == ISC_R_SUCCESS) {
+ i = cfg_obj_asuint32(obj);
+ fstrm_iothr_options_set_queue_notify_threshold(fopt,
+ i);
+ }
+
+ obj = NULL;
+ result = ns_config_get(maps, "fstrm-set-output-queue-model",
+ &obj);
+ if (result == ISC_R_SUCCESS) {
+ if (strcasecmp(cfg_obj_asstring(obj), "spsc") == 0)
+ i = FSTRM_IOTHR_QUEUE_MODEL_SPSC;
+ else
+ i = FSTRM_IOTHR_QUEUE_MODEL_MPSC;
+ fstrm_iothr_options_set_queue_model(fopt, i);
+ }
+
+ obj = NULL;
+ result = ns_config_get(maps, "fstrm-set-output-queue-size",
+ &obj);
+ if (result == ISC_R_SUCCESS) {
+ i = cfg_obj_asuint32(obj);
+ fstrm_iothr_options_set_output_queue_size(fopt, i);
+ }
+
+ obj = NULL;
+ result = ns_config_get(maps, "fstrm-set-reopen-interval",
+ &obj);
+ if (result == ISC_R_SUCCESS) {
+ i = cfg_obj_asuint32(obj);
+ fstrm_iothr_options_set_reopen_interval(fopt, i);
+ }
+
+ CHECKM(dns_dt_create(ns_g_mctx, dmode, dpath, fopt,
&ns_g_server->dtenv),
"unable to create dnstap environment");
}
@@ -3041,6 +3107,9 @@ configure_dnstap(const cfg_obj_t **maps, dns_view_t *view) {
result = ISC_R_SUCCESS;
cleanup:
+ if (fopt != NULL)
+ fstrm_iothr_options_destroy(&fopt);
+
return (result);
}
#endif /* HAVE_DNSTAP */
@@ -11011,7 +11080,7 @@ nzd_count(dns_view_t *view, int *countp) {
int status;
MDB_txn *txn = NULL;
MDB_dbi dbi;
- MDB_stat stat;
+ MDB_stat statbuf;
REQUIRE(countp != NULL);
@@ -11019,7 +11088,7 @@ nzd_count(dns_view_t *view, int *countp) {
if (result != ISC_R_SUCCESS)
goto cleanup;
- status = mdb_stat(txn, dbi, &stat);
+ status = mdb_stat(txn, dbi, &statbuf);
if (status != 0) {
isc_log_write(ns_g_lctx,
NS_LOGCATEGORY_GENERAL, NS_LOGMODULE_SERVER,
@@ -11029,7 +11098,7 @@ nzd_count(dns_view_t *view, int *countp) {
goto cleanup;
}
- *countp = stat.ms_entries;
+ *countp = statbuf.ms_entries;
cleanup:
(void) nzd_close(&txn, ISC_FALSE);
diff --git a/bin/named/statschannel.c b/bin/named/statschannel.c
index 162ea0b702..a33e720ace 100644
--- a/bin/named/statschannel.c
+++ b/bin/named/statschannel.c
@@ -123,6 +123,7 @@ static const char *udpinsizestats_desc[dns_sizecounter_in_max];
static const char *udpoutsizestats_desc[dns_sizecounter_out_max];
static const char *tcpinsizestats_desc[dns_sizecounter_in_max];
static const char *tcpoutsizestats_desc[dns_sizecounter_out_max];
+static const char *dnstapstats_desc[dns_dnstapcounter_max];
#if defined(EXTENDED_STATS)
static const char *nsstats_xmldesc[dns_nsstatscounter_max];
static const char *resstats_xmldesc[dns_resstatscounter_max];
@@ -134,6 +135,7 @@ static const char *udpinsizestats_xmldesc[dns_sizecounter_in_max];
static const char *udpoutsizestats_xmldesc[dns_sizecounter_out_max];
static const char *tcpinsizestats_xmldesc[dns_sizecounter_in_max];
static const char *tcpoutsizestats_xmldesc[dns_sizecounter_out_max];
+static const char *dnstapstats_xmldesc[dns_dnstapcounter_max];
#else
#define nsstats_xmldesc NULL
#define resstats_xmldesc NULL
@@ -145,6 +147,7 @@ static const char *tcpoutsizestats_xmldesc[dns_sizecounter_out_max];
#define udpoutsizestats_xmldesc NULL
#define tcpinsizestats_xmldesc NULL
#define tcpoutsizestats_xmldesc NULL
+#define dnstapstats_xmldesc NULL
#endif /* EXTENDED_STATS */
#define TRY0(a) do { xmlrc = (a); if (xmlrc < 0) goto error; } while(0)
@@ -164,6 +167,7 @@ static int udpinsizestats_index[dns_sizecounter_in_max];
static int udpoutsizestats_index[dns_sizecounter_out_max];
static int tcpinsizestats_index[dns_sizecounter_in_max];
static int tcpoutsizestats_index[dns_sizecounter_out_max];
+static int dnstapstats_index[dns_dnstapcounter_max];
static inline void
set_desc(int counter, int maxcounter, const char *fdesc, const char **fdescs,
@@ -574,6 +578,27 @@ init_desc(void) {
SET_DNSSECSTATDESC(fail, "dnssec validation failures", "DNSSECfail");
INSIST(i == dns_dnssecstats_max);
+ /* Initialize dnstap statistics */
+ for (i = 0; i < dns_dnstapcounter_max; i++)
+ dnstapstats_desc[i] = NULL;
+#if defined(EXTENDED_STATS)
+ for (i = 0; i < dns_dnstapcounter_max; i++)
+ dnstapstats_xmldesc[i] = NULL;
+#endif
+
+#define SET_DNSTAPSTATDESC(counterid, desc, xmldesc) \
+ do { \
+ set_desc(dns_dnstapcounter_ ## counterid, \
+ dns_dnstapcounter_max, \
+ desc, dnstapstats_desc, \
+ xmldesc, dnstapstats_xmldesc); \
+ dnstapstats_index[i++] = dns_dnstapcounter_ ## counterid; \
+ } while (0)
+ i = 0;
+ SET_DNSTAPSTATDESC(success, "dnstap messges written", "DNSTAPsuccess");
+ SET_DNSTAPSTATDESC(drop, "dnstap messages dropped", "DNSSECdropped");
+ INSIST(i == dns_dnstapcounter_max);
+
/* Sanity check */
for (i = 0; i < dns_nsstatscounter_max; i++)
INSIST(nsstats_desc[i] != NULL);
@@ -587,6 +612,8 @@ init_desc(void) {
INSIST(sockstats_desc[i] != NULL);
for (i = 0; i < dns_dnssecstats_max; i++)
INSIST(dnssecstats_desc[i] != NULL);
+ for (i = 0; i < dns_dnstapcounter_max; i++)
+ INSIST(dnstapstats_desc[i] != NULL);
#if defined(EXTENDED_STATS)
for (i = 0; i < dns_nsstatscounter_max; i++)
INSIST(nsstats_xmldesc[i] != NULL);
@@ -600,6 +627,8 @@ init_desc(void) {
INSIST(sockstats_xmldesc[i] != NULL);
for (i = 0; i < dns_dnssecstats_max; i++)
INSIST(dnssecstats_xmldesc[i] != NULL);
+ for (i = 0; i < dns_dnstapcounter_max; i++)
+ INSIST(dnstapstats_xmldesc[i] != NULL);
#endif
/* Initialize traffic size statistics */
@@ -1480,6 +1509,9 @@ generatexml(ns_server_t *server, isc_uint32_t flags,
isc_uint64_t udpoutsizestat_values[dns_sizecounter_out_max];
isc_uint64_t tcpinsizestat_values[dns_sizecounter_in_max];
isc_uint64_t tcpoutsizestat_values[dns_sizecounter_out_max];
+#if HAVE_DNSTAP
+ isc_uint64_t dnstapstat_values[dns_dnstapcounter_max];
+#endif
isc_result_t result;
isc_time_now(&now);
@@ -1595,6 +1627,28 @@ generatexml(ns_server_t *server, isc_uint32_t flags,
if (result != ISC_R_SUCCESS)
goto error;
TRY0(xmlTextWriterEndElement(writer)); /* resstat */
+
+#if HAVE_DNSTAP
+ if (server->dtenv != NULL) {
+ isc_stats_t *dnstapstats = NULL;
+ TRY0(xmlTextWriterStartElement(writer,
+ ISC_XMLCHAR "counters"));
+ TRY0(xmlTextWriterWriteAttribute(writer,
+ ISC_XMLCHAR "type",
+ ISC_XMLCHAR "dnstap"));
+ dns_dt_getstats(ns_g_server->dtenv, &dnstapstats);
+ result = dump_counters(dnstapstats,
+ isc_statsformat_xml, writer,
+ NULL, dnstapstats_xmldesc,
+ dns_dnstapcounter_max,
+ dnstapstats_index,
+ dnstapstat_values, 0);
+ isc_stats_detach(&dnstapstats);
+ if (result != ISC_R_SUCCESS)
+ goto error;
+ TRY0(xmlTextWriterEndElement(writer)); /* dnstap */
+ }
+#endif
}
if ((flags & STATS_XML_NET) != 0) {
@@ -2209,6 +2263,9 @@ generatejson(ns_server_t *server, size_t *msglen,
isc_uint64_t udpoutsizestat_values[dns_sizecounter_out_max];
isc_uint64_t tcpinsizestat_values[dns_sizecounter_in_max];
isc_uint64_t tcpoutsizestat_values[dns_sizecounter_out_max];
+#if HAVE_DNSTAP
+ isc_uint64_t dnstapstat_values[dns_dnstapcounter_max];
+#endif
stats_dumparg_t dumparg;
char boottime[sizeof "yyyy-mm-ddThh:mm:ss.sssZ"];
char configtime[sizeof "yyyy-mm-ddThh:mm:ss.sssZ"];
@@ -2370,6 +2427,35 @@ generatejson(ns_server_t *server, size_t *msglen,
json_object_object_add(bindstats, "resstats", counters);
else
json_object_put(counters);
+
+#if HAVE_DNSTAP
+ /* dnstap stat counters */
+ if (ns_g_server->dtenv != NULL) {
+ isc_stats_t *dnstapstats = NULL;
+ dns_dt_getstats(ns_g_server->dtenv, &dnstapstats);
+ counters = json_object_new_object();
+ dumparg.result = ISC_R_SUCCESS;
+ dumparg.arg = counters;
+ result = dump_counters(dnstapstats,
+ isc_statsformat_json, counters,
+ NULL, dnstapstats_xmldesc,
+ dns_dnstapcounter_max,
+ dnstapstats_index,
+ dnstapstat_values, 0);
+ isc_stats_detach(&dnstapstats);
+ if (result != ISC_R_SUCCESS) {
+ json_object_put(counters);
+ goto error;
+ }
+
+ if (json_object_get_object(counters)->count != 0)
+ json_object_object_add(bindstats,
+ "dnstapstats",
+ counters);
+ else
+ json_object_put(counters);
+ }
+#endif
}
if ((flags & (STATS_JSON_ZONES | STATS_JSON_SERVER)) != 0) {
diff --git a/bin/tests/system/dnstap/bad-fstrm-set-buffer-hint-max.conf b/bin/tests/system/dnstap/bad-fstrm-set-buffer-hint-max.conf
new file mode 100644
index 0000000000..5c082db662
--- /dev/null
+++ b/bin/tests/system/dnstap/bad-fstrm-set-buffer-hint-max.conf
@@ -0,0 +1,11 @@
+/*
+ * Copyright (C) 2016 Internet Systems Consortium, Inc. ("ISC")
+ *
+ * This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/.
+ */
+
+options {
+ fstrm-set-buffer-hint 65537;
+};
diff --git a/bin/tests/system/dnstap/bad-fstrm-set-buffer-hint-min.conf b/bin/tests/system/dnstap/bad-fstrm-set-buffer-hint-min.conf
new file mode 100644
index 0000000000..709aeb5f5d
--- /dev/null
+++ b/bin/tests/system/dnstap/bad-fstrm-set-buffer-hint-min.conf
@@ -0,0 +1,11 @@
+/*
+ * Copyright (C) 2016 Internet Systems Consortium, Inc. ("ISC")
+ *
+ * This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/.
+ */
+
+options {
+ fstrm-set-buffer-hint 1023;
+};
diff --git a/bin/tests/system/dnstap/bad-fstrm-set-flush-timeout-max.conf b/bin/tests/system/dnstap/bad-fstrm-set-flush-timeout-max.conf
new file mode 100644
index 0000000000..58cf24b8d9
--- /dev/null
+++ b/bin/tests/system/dnstap/bad-fstrm-set-flush-timeout-max.conf
@@ -0,0 +1,11 @@
+/*
+ * Copyright (C) 2016 Internet Systems Consortium, Inc. ("ISC")
+ *
+ * This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/.
+ */
+
+options {
+ fstrm-set-flush-timeout 0;
+};
diff --git a/bin/tests/system/dnstap/bad-fstrm-set-flush-timeout-min.conf b/bin/tests/system/dnstap/bad-fstrm-set-flush-timeout-min.conf
new file mode 100644
index 0000000000..2394e45b21
--- /dev/null
+++ b/bin/tests/system/dnstap/bad-fstrm-set-flush-timeout-min.conf
@@ -0,0 +1,11 @@
+/*
+ * Copyright (C) 2016 Internet Systems Consortium, Inc. ("ISC")
+ *
+ * This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/.
+ */
+
+options {
+ fstrm-set-flush-timeout 601;
+};
diff --git a/bin/tests/system/dnstap/bad-fstrm-set-input-queue-size-max.conf b/bin/tests/system/dnstap/bad-fstrm-set-input-queue-size-max.conf
new file mode 100644
index 0000000000..74da12975f
--- /dev/null
+++ b/bin/tests/system/dnstap/bad-fstrm-set-input-queue-size-max.conf
@@ -0,0 +1,11 @@
+/*
+ * Copyright (C) 2016 Internet Systems Consortium, Inc. ("ISC")
+ *
+ * This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/.
+ */
+
+options {
+ fstrm-set-input-queue-size 1;
+};
diff --git a/bin/tests/system/dnstap/bad-fstrm-set-input-queue-size-min.conf b/bin/tests/system/dnstap/bad-fstrm-set-input-queue-size-min.conf
new file mode 100644
index 0000000000..141744104c
--- /dev/null
+++ b/bin/tests/system/dnstap/bad-fstrm-set-input-queue-size-min.conf
@@ -0,0 +1,11 @@
+/*
+ * Copyright (C) 2016 Internet Systems Consortium, Inc. ("ISC")
+ *
+ * This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/.
+ */
+
+options {
+ fstrm-set-input-queue-size 16385;
+};
diff --git a/bin/tests/system/dnstap/bad-fstrm-set-input-queue-size-po2.conf b/bin/tests/system/dnstap/bad-fstrm-set-input-queue-size-po2.conf
new file mode 100644
index 0000000000..8d12b8800f
--- /dev/null
+++ b/bin/tests/system/dnstap/bad-fstrm-set-input-queue-size-po2.conf
@@ -0,0 +1,11 @@
+/*
+ * Copyright (C) 2016 Internet Systems Consortium, Inc. ("ISC")
+ *
+ * This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/.
+ */
+
+options {
+ fstrm-set-input-queue-size 513;
+};
diff --git a/bin/tests/system/dnstap/bad-fstrm-set-output-notify-threshold.conf b/bin/tests/system/dnstap/bad-fstrm-set-output-notify-threshold.conf
new file mode 100644
index 0000000000..9a5f1858f4
--- /dev/null
+++ b/bin/tests/system/dnstap/bad-fstrm-set-output-notify-threshold.conf
@@ -0,0 +1,11 @@
+/*
+ * Copyright (C) 2016 Internet Systems Consortium, Inc. ("ISC")
+ *
+ * This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/.
+ */
+
+options {
+ fstrm-set-output-notify-threshold 0;
+};
diff --git a/bin/tests/system/dnstap/bad-fstrm-set-output-queue-size-max.conf b/bin/tests/system/dnstap/bad-fstrm-set-output-queue-size-max.conf
new file mode 100644
index 0000000000..830cc55d5b
--- /dev/null
+++ b/bin/tests/system/dnstap/bad-fstrm-set-output-queue-size-max.conf
@@ -0,0 +1,14 @@
+/*
+ * Copyright (C) 2016 Internet Systems Consortium, Inc. ("ISC")
+ *
+ * This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/.
+ */
+
+options {
+ /*
+ * This value is system dependent and matches IOV_MAX.
+ */
+ fstrm-set-output-queue-size 10000000;
+};
diff --git a/bin/tests/system/dnstap/bad-fstrm-set-output-queue-size-min.conf b/bin/tests/system/dnstap/bad-fstrm-set-output-queue-size-min.conf
new file mode 100644
index 0000000000..6f2ff58265
--- /dev/null
+++ b/bin/tests/system/dnstap/bad-fstrm-set-output-queue-size-min.conf
@@ -0,0 +1,11 @@
+/*
+ * Copyright (C) 2016 Internet Systems Consortium, Inc. ("ISC")
+ *
+ * This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/.
+ */
+
+options {
+ fstrm-set-output-queue-size 1;
+};
diff --git a/bin/tests/system/dnstap/bad-fstrm-set-reopen-interval-max.conf b/bin/tests/system/dnstap/bad-fstrm-set-reopen-interval-max.conf
new file mode 100644
index 0000000000..bbdb55a6f1
--- /dev/null
+++ b/bin/tests/system/dnstap/bad-fstrm-set-reopen-interval-max.conf
@@ -0,0 +1,11 @@
+/*
+ * Copyright (C) 2016 Internet Systems Consortium, Inc. ("ISC")
+ *
+ * This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/.
+ */
+
+options {
+ fstrm-set-reopen-interval 601;
+};
diff --git a/bin/tests/system/dnstap/bad-fstrm-set-reopen-interval-min.conf b/bin/tests/system/dnstap/bad-fstrm-set-reopen-interval-min.conf
new file mode 100644
index 0000000000..f00c41b3ea
--- /dev/null
+++ b/bin/tests/system/dnstap/bad-fstrm-set-reopen-interval-min.conf
@@ -0,0 +1,11 @@
+/*
+ * Copyright (C) 2016 Internet Systems Consortium, Inc. ("ISC")
+ *
+ * This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/.
+ */
+
+options {
+ fstrm-set-reopen-interval 0;
+};
diff --git a/bin/tests/system/dnstap/good-fstrm-set-buffer-hint.conf b/bin/tests/system/dnstap/good-fstrm-set-buffer-hint.conf
new file mode 100644
index 0000000000..d71b8ce394
--- /dev/null
+++ b/bin/tests/system/dnstap/good-fstrm-set-buffer-hint.conf
@@ -0,0 +1,11 @@
+/*
+ * Copyright (C) 2016 Internet Systems Consortium, Inc. ("ISC")
+ *
+ * This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/.
+ */
+
+options {
+ fstrm-set-buffer-hint 8192;
+};
diff --git a/bin/tests/system/dnstap/good-fstrm-set-flush-timeout.conf b/bin/tests/system/dnstap/good-fstrm-set-flush-timeout.conf
new file mode 100644
index 0000000000..c8aa026826
--- /dev/null
+++ b/bin/tests/system/dnstap/good-fstrm-set-flush-timeout.conf
@@ -0,0 +1,11 @@
+/*
+ * Copyright (C) 2016 Internet Systems Consortium, Inc. ("ISC")
+ *
+ * This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/.
+ */
+
+options {
+ fstrm-set-flush-timeout 1;
+};
diff --git a/bin/tests/system/dnstap/good-fstrm-set-input-queue-size.conf b/bin/tests/system/dnstap/good-fstrm-set-input-queue-size.conf
new file mode 100644
index 0000000000..fec4b5e19c
--- /dev/null
+++ b/bin/tests/system/dnstap/good-fstrm-set-input-queue-size.conf
@@ -0,0 +1,11 @@
+/*
+ * Copyright (C) 2016 Internet Systems Consortium, Inc. ("ISC")
+ *
+ * This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/.
+ */
+
+options {
+ fstrm-set-input-queue-size 512;
+};
diff --git a/bin/tests/system/dnstap/good-fstrm-set-output-notify-threshold.conf b/bin/tests/system/dnstap/good-fstrm-set-output-notify-threshold.conf
new file mode 100644
index 0000000000..cbb9945e17
--- /dev/null
+++ b/bin/tests/system/dnstap/good-fstrm-set-output-notify-threshold.conf
@@ -0,0 +1,11 @@
+/*
+ * Copyright (C) 2016 Internet Systems Consortium, Inc. ("ISC")
+ *
+ * This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/.
+ */
+
+options {
+ fstrm-set-output-notify-threshold 32;
+};
diff --git a/bin/tests/system/dnstap/good-fstrm-set-output-queue-model-mpsc.conf b/bin/tests/system/dnstap/good-fstrm-set-output-queue-model-mpsc.conf
new file mode 100644
index 0000000000..31a9535c0e
--- /dev/null
+++ b/bin/tests/system/dnstap/good-fstrm-set-output-queue-model-mpsc.conf
@@ -0,0 +1,11 @@
+/*
+ * Copyright (C) 2016 Internet Systems Consortium, Inc. ("ISC")
+ *
+ * This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/.
+ */
+
+options {
+ fstrm-set-output-queue-model mpsc;
+};
diff --git a/bin/tests/system/dnstap/good-fstrm-set-output-queue-model-spsc.conf b/bin/tests/system/dnstap/good-fstrm-set-output-queue-model-spsc.conf
new file mode 100644
index 0000000000..5c20e188d7
--- /dev/null
+++ b/bin/tests/system/dnstap/good-fstrm-set-output-queue-model-spsc.conf
@@ -0,0 +1,11 @@
+/*
+ * Copyright (C) 2016 Internet Systems Consortium, Inc. ("ISC")
+ *
+ * This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/.
+ */
+
+options {
+ fstrm-set-output-queue-model spsc;
+};
diff --git a/bin/tests/system/dnstap/good-fstrm-set-output-queue-size.conf b/bin/tests/system/dnstap/good-fstrm-set-output-queue-size.conf
new file mode 100644
index 0000000000..299bd8e1d9
--- /dev/null
+++ b/bin/tests/system/dnstap/good-fstrm-set-output-queue-size.conf
@@ -0,0 +1,11 @@
+/*
+ * Copyright (C) 2016 Internet Systems Consortium, Inc. ("ISC")
+ *
+ * This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/.
+ */
+
+options {
+ fstrm-set-output-queue-size 64;
+};
diff --git a/bin/tests/system/dnstap/good-fstrm-set-reopen-interval.conf b/bin/tests/system/dnstap/good-fstrm-set-reopen-interval.conf
new file mode 100644
index 0000000000..934e622e9a
--- /dev/null
+++ b/bin/tests/system/dnstap/good-fstrm-set-reopen-interval.conf
@@ -0,0 +1,11 @@
+/*
+ * Copyright (C) 2016 Internet Systems Consortium, Inc. ("ISC")
+ *
+ * This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/.
+ */
+
+options {
+ fstrm-set-reopen-interval 5;
+};
diff --git a/bin/tests/system/dnstap/tests.sh b/bin/tests/system/dnstap/tests.sh
index 35d9d66b3a..3cab814d93 100644
--- a/bin/tests/system/dnstap/tests.sh
+++ b/bin/tests/system/dnstap/tests.sh
@@ -13,6 +13,24 @@ RNDCCMD="$RNDC -p 9953 -c ../common/rndc.conf"
status=0
+for bad in bad-*.conf
+do
+ ret=0
+ echo "I: checking that named-checkconf detects error in $bad"
+ $CHECKCONF $bad > /dev/null 2>&1
+ if [ $? != 1 ]; then echo "I:failed"; ret=1; fi
+ status=`expr $status + $ret`
+done
+
+for good in good-*.conf
+do
+ ret=0
+ echo "I: checking that named-checkconf detects no error in $good"
+ $CHECKCONF $good > /dev/null 2>&1
+ if [ $? != 0 ]; then echo "I:failed"; ret=1; fi
+ status=`expr $status + $ret`
+done
+
$DIG +short @10.53.0.3 -p 5300 a.example > dig.out
# check three different dnstap reopen/roll methods:
diff --git a/doc/arm/Bv9ARM-book.xml b/doc/arm/Bv9ARM-book.xml
index 2535e41f49..559bdefbfb 100644
--- a/doc/arm/Bv9ARM-book.xml
+++ b/doc/arm/Bv9ARM-book.xml
@@ -4396,6 +4396,14 @@ badresp:1,adberr:0,findfail:0,valfail:0]
dnstap-output ( file | unix ) path_name; dnstap-identity ( string | hostname | none ); dnstap-version ( string | none );
+ fstrm-set-buffer-hint number ;
+ fstrm-set-flush-timeout number ;
+ fstrm-set-input-queue-size number ;
+ fstrm-set-output-notify-threshold number ;
+ fstrm-set-output-queue-model ( mpsc |
+ spsc ) ;
+ fstrm-set-output-queue-size number ;
+ fstrm-set-reopen-interval number ; geoip-directory path_name; key-directory path_name; managed-keys-directory path_name;
@@ -4870,6 +4878,81 @@ badresp:1,adberr:0,findfail:0,valfail:0]
For more information on dnstap, see
http://dnstap.info.
+
+ The fstrm library has a number of tunables that are exposed
+ in named.conf, and can be modified
+ if necessary to improve performance or prevent loss of data.
+ These are:
+
+
+
+
+ fstrm-set-buffer-hint: The
+ threshold number of bytes to accumulate in the output
+ buffer before forcing a buffer flush. The minimum is
+ 1K, the maximum is 64K, and the default is 8K.
+
+
+
+
+ fstrm-set-flush-timeout: The number
+ of seconds to allow unflushed data to remain in the
+ output buffer. The minimum is 1 second, the maximum is
+ 600 seconds (10 minutes), and the default is 1 second.
+
+
+
+
+ fstrm-set-output-notify-threshold:
+ The number of outstanding queue entries to allow on
+ an input queue before waking the I/O thread.
+ The minimum is 1 and the default is 32.
+
+
+
+
+ fstrm-set-output-queue-model:
+ Controls the queuing semantics to use for queue
+ objects. The default is mpsc
+ (multiple producer, single consumer); the other
+ option is spsc (single producer,
+ single consumer).
+
+
+
+
+ fstrm-set-input-queue-size: The
+ number of queue entries to allocate for each
+ input queue. The minimum is 2, the maximum is 16384,
+ and the default is 512.
+
+
+
+
+ fstrm-set-output-queue-size:
+ The number of queue entries to allocate for each
+ output queue. The minimum is 2, the maximum is
+ system-dependent and based on ,
+ and the default is 64.
+
+
+
+
+ fstrm-set-reopen-interval:
+ The number of seconds to wait between attempts to
+ reopen a closed output stream. The minimum is 1 second,
+ the maximum is 600 seconds (10 minutes), and the default
+ is 5 seconds.
+
+
+
+
+ Note that all of the above minimum, maximum, and default
+ values are set by the libfstrm library,
+ and may be subject to change in future versions of the
+ library. See the libfstrm documentation
+ for more information.
+
diff --git a/lib/bind9/check.c b/lib/bind9/check.c
index f5ac789073..533c6227dd 100644
--- a/lib/bind9/check.c
+++ b/lib/bind9/check.c
@@ -32,6 +32,7 @@
#include
#include
+#include
#include
#include
#include
@@ -869,6 +870,12 @@ typedef struct {
unsigned int max;
} intervaltable;
+typedef struct {
+ const char *name;
+ unsigned int min;
+ unsigned int max;
+} fstrmtable;
+
typedef enum {
optlevel_config,
optlevel_options,
@@ -945,6 +952,41 @@ check_options(const cfg_obj_t *options, isc_log_t *logctx, isc_mem_t *mctx,
NULL
};
+#if HAVE_DNSTAP
+ static fstrmtable fstrm[] = {
+ {
+ "fstrm-set-buffer-hint",
+ FSTRM_IOTHR_BUFFER_HINT_MIN,
+ FSTRM_IOTHR_BUFFER_HINT_MAX
+ },
+ {
+ "fstrm-set-flush-timeout",
+ FSTRM_IOTHR_FLUSH_TIMEOUT_MIN,
+ FSTRM_IOTHR_FLUSH_TIMEOUT_MAX
+ },
+ {
+ "fstrm-set-input-queue-size",
+ FSTRM_IOTHR_INPUT_QUEUE_SIZE_MIN,
+ FSTRM_IOTHR_INPUT_QUEUE_SIZE_MAX
+ },
+ {
+ "fstrm-set-output-notify-threshold",
+ FSTRM_IOTHR_QUEUE_NOTIFY_THRESHOLD_MIN,
+ 0
+ },
+ {
+ "fstrm-set-output-queue-size",
+ FSTRM_IOTHR_OUTPUT_QUEUE_SIZE_MIN,
+ FSTRM_IOTHR_OUTPUT_QUEUE_SIZE_MAX
+ },
+ {
+ "fstrm-set-reopen-interval",
+ FSTRM_IOTHR_REOPEN_INTERVAL_MIN,
+ FSTRM_IOTHR_REOPEN_INTERVAL_MAX
+ }
+ };
+#endif
+
/*
* Check that fields specified in units of time other than seconds
* have reasonable values.
@@ -1354,6 +1396,47 @@ check_options(const cfg_obj_t *options, isc_log_t *logctx, isc_mem_t *mctx,
}
}
+#if HAVE_DNSTAP
+ for (i = 0; i < sizeof(fstrm) / sizeof(fstrm[0]); i++) {
+ isc_uint32_t value;
+
+ obj = NULL;
+ (void) cfg_map_get(options, fstrm[i].name, &obj);
+ if (obj == NULL)
+ continue;
+
+ value = cfg_obj_asuint32(obj);
+ if (value < fstrm[i].min ||
+ (fstrm[i].max != 0U && value > fstrm[i].max)) {
+ if (fstrm[i].max != 0U)
+ cfg_obj_log(obj, logctx, ISC_LOG_ERROR,
+ "%s '%u' out of range (%u..%u)",
+ fstrm[i].name, value,
+ fstrm[i].min, fstrm[i].max);
+ else
+ cfg_obj_log(obj, logctx, ISC_LOG_ERROR,
+ "%s out of range (%u < %u)",
+ fstrm[i].name, value, fstrm[i].min);
+ result = ISC_R_RANGE;
+ }
+
+ if (strcmp(fstrm[i].name, "fstrm-set-input-queue-size") == 0) {
+ int bits = 0;
+ do {
+ bits += value & 0x1;
+ value >>= 1;
+ } while (value != 0U);
+ if (bits != 1) {
+ cfg_obj_log(obj, logctx, ISC_LOG_ERROR,
+ "%s '%u' not a power-of-2",
+ fstrm[i].name,
+ cfg_obj_asuint32(obj));
+ result = ISC_R_RANGE;
+ }
+ }
+ }
+#endif
+
return (result);
}
diff --git a/lib/dns/dnstap.c b/lib/dns/dnstap.c
index 06c16a92eb..94a6d1ccab 100644
--- a/lib/dns/dnstap.c
+++ b/lib/dns/dnstap.c
@@ -61,10 +61,11 @@
#include
#include
-#include
#include
+#include
#include
#include
+#include
#include
#include
@@ -97,6 +98,7 @@ struct dns_dtenv {
isc_region_t version;
char *path;
dns_dtmode_t mode;
+ isc_stats_t *stats;
};
#define CHECK(x) do { \
@@ -158,11 +160,10 @@ unlock:
isc_result_t
dns_dt_create(isc_mem_t *mctx, dns_dtmode_t mode, const char *path,
- unsigned int workers, dns_dtenv_t **envp)
+ struct fstrm_iothr_options *fopt, dns_dtenv_t **envp)
{
isc_result_t result = ISC_R_SUCCESS;
fstrm_res res;
- struct fstrm_iothr_options *fopt = NULL;
struct fstrm_unix_writer_options *fuwopt = NULL;
struct fstrm_file_options *ffwopt = NULL;
struct fstrm_writer_options *fwopt = NULL;
@@ -171,6 +172,7 @@ dns_dt_create(isc_mem_t *mctx, dns_dtmode_t mode, const char *path,
REQUIRE(path != NULL);
REQUIRE(envp != NULL && *envp == NULL);
+ REQUIRE(fopt != NULL);
isc_log_write(dns_lctx, DNS_LOGCATEGORY_DNSTAP,
DNS_LOGMODULE_DNSTAP, ISC_LOG_INFO,
@@ -183,6 +185,7 @@ dns_dt_create(isc_mem_t *mctx, dns_dtmode_t mode, const char *path,
memset(env, 0, sizeof(dns_dtenv_t));
CHECK(isc_refcount_init(&env->refcount, 1));
+ CHECK(isc_stats_create(mctx, &env->stats, dns_dnstapcounter_max));
env->path = isc_mem_strdup(mctx, path);
if (env->path == NULL)
CHECK(ISC_R_NOMEMORY);
@@ -217,9 +220,6 @@ dns_dt_create(isc_mem_t *mctx, dns_dtmode_t mode, const char *path,
if (fw == NULL)
CHECK(ISC_R_FAILURE);
- fopt = fstrm_iothr_options_init();
- fstrm_iothr_options_set_num_input_queues(fopt, workers);
-
/*
* Remember 'fw' so we can close and reopen it later.
*/
@@ -241,9 +241,6 @@ dns_dt_create(isc_mem_t *mctx, dns_dtmode_t mode, const char *path,
*envp = env;
cleanup:
- if (fopt != NULL)
- fstrm_iothr_options_destroy(&fopt);
-
if (ffwopt != NULL)
fstrm_file_options_destroy(&ffwopt);
@@ -259,6 +256,8 @@ dns_dt_create(isc_mem_t *mctx, dns_dtmode_t mode, const char *path,
isc_mem_detach(&env->mctx);
if (env->path != NULL)
isc_mem_free(mctx, env->path);
+ if (env->stats != NULL)
+ isc_stats_detach(&env->stats);
isc_mem_put(mctx, env, sizeof(dns_dtenv_t));
}
}
@@ -381,6 +380,17 @@ dns_dt_attach(dns_dtenv_t *source, dns_dtenv_t **destp) {
*destp = source;
}
+isc_result_t
+dns_dt_getstats(dns_dtenv_t *env, isc_stats_t **statsp) {
+ REQUIRE(VALID_DTENV(env));
+ REQUIRE(statsp != NULL && *statsp == NULL);
+
+ if (env->stats == NULL)
+ return (ISC_R_NOTFOUND);
+ isc_stats_attach(env->stats, statsp);
+ return (ISC_R_SUCCESS);
+}
+
static void
destroy(dns_dtenv_t *env) {
@@ -401,6 +411,8 @@ destroy(dns_dtenv_t *env) {
}
if (env->path != NULL)
isc_mem_free(env->mctx, env->path);
+ if (env->stats != NULL)
+ isc_stats_detach(&env->stats);
isc_mem_putanddetach(&env->mctx, env, sizeof(*env));
}
@@ -464,8 +476,16 @@ send_dt(dns_dtenv_t *env, void *buf, size_t len) {
res = fstrm_iothr_submit(env->iothr, ioq, buf, len,
fstrm_free_wrapper, NULL);
- if (res != fstrm_res_success)
+ if (res != fstrm_res_success) {
+ if (env->stats != NULL)
+ isc_stats_increment(env->stats,
+ dns_dnstapcounter_drop);
free(buf);
+ } else {
+ if (env->stats != NULL)
+ isc_stats_increment(env->stats,
+ dns_dnstapcounter_success);
+ }
}
static void
diff --git a/lib/dns/include/dns/dnstap.h b/lib/dns/include/dns/dnstap.h
index e7bfd17b99..b183c46de8 100644
--- a/lib/dns/include/dns/dnstap.h
+++ b/lib/dns/include/dns/dnstap.h
@@ -24,6 +24,8 @@
#include
#include
#include
+#else
+struct fstrm_iothr_options;
#endif /* HAVE_DNSTAP */
#include
@@ -112,7 +114,7 @@ struct dns_dtdata {
isc_result_t
dns_dt_create(isc_mem_t *mctx, dns_dtmode_t mode, const char *path,
- unsigned int workers, dns_dtenv_t **envp);
+ struct fstrm_iothr_options *fopt, dns_dtenv_t **envp);
/*%<
* Create and initialize the dnstap environment.
*
@@ -126,12 +128,10 @@ dns_dt_create(isc_mem_t *mctx, dns_dtmode_t mode, const char *path,
* with "file:", then dnstap logs are sent to a file instead of a
* socket.
*
- *\li This creates an I/O thread in libfstrm, and prepares
- * 'workers' input queues. 'workers' MUST be equal to the number
- * of worker threads in named; if it's more, some queues will be
- * wasted and if it's less, some threads will have no queue and
- * will not log any dnstap events.
- *
+ *\li 'fopt' set the options for fstrm_iothr_init(). 'fopt' must have
+ * have had the number of input queues set and this should be set
+ * to the number of worker threads. Additionally the queue model
+ * should also be set. Other options may be set if desired.
*
* Requires:
*
@@ -139,6 +139,8 @@ dns_dt_create(isc_mem_t *mctx, dns_dtmode_t mode, const char *path,
*
*\li 'path' is a valid C string.
*
+ *\li 'fopt' is non NULL.
+ *
*\li envp != NULL && *envp == NULL
*
* Returns:
@@ -206,6 +208,24 @@ dns_dt_detach(dns_dtenv_t **envp);
*\li '*envp' is NULL.
*/
+isc_result_t
+dns_dt_getstats(dns_dtenv_t *env, isc_stats_t **statsp);
+/*%<
+ * Attach to the stats struct if it exists.
+ *
+ * Requires:
+ *
+ *\li 'env' is a valid dnstap environment.
+ *
+ *\li 'statsp' is non NULL and '*statsp' is NULL.
+ *
+ * Returns:
+ *
+ *\li ISC_R_SUCCESS
+ *
+ *\li ISC_R_NOTFOUND
+ */
+
void
dns_dt_shutdown(void);
/*%<
diff --git a/lib/dns/include/dns/stats.h b/lib/dns/include/dns/stats.h
index 33c859ff7a..51d0ba53f3 100644
--- a/lib/dns/include/dns/stats.h
+++ b/lib/dns/include/dns/stats.h
@@ -129,7 +129,14 @@ enum {
dns_statscounter_recursion = 4, /*%< Recursion was used */
dns_statscounter_failure = 5, /*%< Some other failure */
dns_statscounter_duplicate = 6, /*%< Duplicate query */
- dns_statscounter_dropped = 7 /*%< Duplicate query (dropped) */
+ dns_statscounter_dropped = 7, /*%< Duplicate query (dropped) */
+
+ /*%
+ * DNSTAP statistics counters.
+ */
+ dns_dnstapcounter_success = 0,
+ dns_dnstapcounter_drop = 1,
+ dns_dnstapcounter_max = 2
};
#define DNS_STATS_NCOUNTERS 8
diff --git a/lib/dns/tests/dnstap_test.c b/lib/dns/tests/dnstap_test.c
index 02bafbe013..d0dfa1b3e1 100644
--- a/lib/dns/tests/dnstap_test.c
+++ b/lib/dns/tests/dnstap_test.c
@@ -56,6 +56,7 @@ ATF_TC_HEAD(create, tc) {
ATF_TC_BODY(create, tc) {
isc_result_t result;
dns_dtenv_t *dtenv = NULL;
+ struct fstrm_iothr_options *fopt;
UNUSED(tc);
@@ -64,14 +65,18 @@ ATF_TC_BODY(create, tc) {
result = dns_test_begin(NULL, ISC_TRUE);
ATF_REQUIRE(result == ISC_R_SUCCESS);
- result = dns_dt_create(mctx, dns_dtmode_file, TAPFILE, 1, &dtenv);
+ fopt = fstrm_iothr_options_init();
+ ATF_REQUIRE(fopt != NULL);
+ fstrm_iothr_options_set_num_input_queues(fopt, 1);
+
+ result = dns_dt_create(mctx, dns_dtmode_file, TAPFILE, fopt, &dtenv);
ATF_CHECK_EQ(result, ISC_R_SUCCESS);
if (dtenv != NULL)
dns_dt_detach(&dtenv);
ATF_CHECK(isc_file_exists(TAPFILE));
- result = dns_dt_create(mctx, dns_dtmode_unix, TAPSOCK, 1, &dtenv);
+ result = dns_dt_create(mctx, dns_dtmode_unix, TAPSOCK, fopt, &dtenv);
ATF_CHECK_EQ(result, ISC_R_SUCCESS);
if (dtenv != NULL)
dns_dt_detach(&dtenv);
@@ -79,12 +84,13 @@ ATF_TC_BODY(create, tc) {
/* 'create' should succeed, but the file shouldn't exist yet */
ATF_CHECK(!isc_file_exists(TAPSOCK));
- result = dns_dt_create(mctx, 33, TAPSOCK, 1, &dtenv);
+ result = dns_dt_create(mctx, 33, TAPSOCK, fopt, &dtenv);
ATF_CHECK_EQ(result, ISC_R_FAILURE);
ATF_CHECK_EQ(dtenv, NULL);
cleanup();
+ fstrm_iothr_options_destroy(&fopt);
dns_dt_shutdown();
dns_test_end();
}
@@ -114,6 +120,7 @@ ATF_TC_BODY(send, tc) {
struct in_addr in;
isc_stdtime_t now;
isc_time_t p, f;
+ struct fstrm_iothr_options *fopt;
UNUSED(tc);
@@ -124,7 +131,11 @@ ATF_TC_BODY(send, tc) {
result = dns_test_makeview("test", &view);
- result = dns_dt_create(mctx, dns_dtmode_file, TAPFILE, 1, &dtenv);
+ fopt = fstrm_iothr_options_init();
+ ATF_REQUIRE(fopt != NULL);
+ fstrm_iothr_options_set_num_input_queues(fopt, 1);
+
+ result = dns_dt_create(mctx, dns_dtmode_file, TAPFILE, fopt, &dtenv);
ATF_REQUIRE(result == ISC_R_SUCCESS);
dns_dt_attach(dtenv, &view->dtenv);
@@ -242,6 +253,7 @@ ATF_TC_BODY(send, tc) {
dns_dtdata_free(&dtdata);
}
+ fstrm_iothr_options_destroy(&fopt);
dns_dt_close(&handle);
cleanup();
diff --git a/lib/isccfg/namedconf.c b/lib/isccfg/namedconf.c
index 6be7e932d8..8e0caf9650 100644
--- a/lib/isccfg/namedconf.c
+++ b/lib/isccfg/namedconf.c
@@ -994,6 +994,12 @@ bindkeys_clauses[] = {
{ NULL, NULL, 0 }
};
+static const char *fstrm_model_enums[] = { "spsc", "mpsc", NULL };
+static cfg_type_t cfg_type_fstrm_model = {
+ "model", cfg_parse_enum, cfg_print_ustring, cfg_doc_enum,
+ &cfg_rep_string, &fstrm_model_enums
+};
+
/*%
* Clauses that can be found within the 'options' statement.
*/
@@ -1012,11 +1018,32 @@ options_clauses[] = {
{ "dnstap-output", &cfg_type_dnstapoutput, 0 },
{ "dnstap-identity", &cfg_type_serverid, 0 },
{ "dnstap-version", &cfg_type_qstringornone, 0 },
+ { "fstrm-set-buffer-hint", &cfg_type_uint32, 0 },
+ { "fstrm-set-flush-timeout", &cfg_type_uint32, 0 },
+ { "fstrm-set-input-queue-size", &cfg_type_uint32, 0 },
+ { "fstrm-set-output-notify-threshold", &cfg_type_uint32, 0 },
+ { "fstrm-set-output-queue-model", &cfg_type_fstrm_model, 0 },
+ { "fstrm-set-output-queue-size", &cfg_type_uint32, 0 },
+ { "fstrm-set-reopen-interval", &cfg_type_uint32, 0 },
#else
{ "dnstap-output", &cfg_type_dnstapoutput,
CFG_CLAUSEFLAG_NOTCONFIGURED },
{ "dnstap-identity", &cfg_type_serverid, CFG_CLAUSEFLAG_NOTCONFIGURED },
{ "dnstap-version", &cfg_type_qstringornone, CFG_CLAUSEFLAG_NOTCONFIGURED },
+ { "fstrm-set-buffer-hint", &cfg_type_uint32,
+ CFG_CLAUSEFLAG_NOTCONFIGURED },
+ { "fstrm-set-flush-timeout", &cfg_type_uint32,
+ CFG_CLAUSEFLAG_NOTCONFIGURED },
+ { "fstrm-set-input-queue-size", &cfg_type_uint32,
+ CFG_CLAUSEFLAG_NOTCONFIGURED },
+ { "fstrm-set-output-notify-threshold", &cfg_type_uint32,
+ CFG_CLAUSEFLAG_NOTCONFIGURED },
+ { "fstrm-set-output-queue-model", &cfg_type_fstrm_model,
+ CFG_CLAUSEFLAG_NOTCONFIGURED },
+ { "fstrm-set-output-queue-size", &cfg_type_uint32,
+ CFG_CLAUSEFLAG_NOTCONFIGURED },
+ { "fstrm-set-reopen-interval", &cfg_type_uint32,
+ CFG_CLAUSEFLAG_NOTCONFIGURED },
#endif /* HAVE_DNSTAP */
{ "session-keyfile", &cfg_type_qstringornone, 0 },
{ "session-keyname", &cfg_type_astring, 0 },
diff --git a/util/copyrights b/util/copyrights
index b7e8fe86dd..d746bfae32 100644
--- a/util/copyrights
+++ b/util/copyrights
@@ -1331,7 +1331,27 @@
./bin/tests/system/dnssec/signer/remove.db.in ZONE 2016
./bin/tests/system/dnssec/signer/remove2.db.in ZONE 2016
./bin/tests/system/dnssec/tests.sh SH 2000,2001,2002,2004,2005,2006,2007,2008,2009,2010,2011,2012,2013,2014,2015,2016
+./bin/tests/system/dnstap/bad-fstrm-set-buffer-hint-max.conf CONF-C 2016
+./bin/tests/system/dnstap/bad-fstrm-set-buffer-hint-min.conf CONF-C 2016
+./bin/tests/system/dnstap/bad-fstrm-set-flush-timeout-max.conf CONF-C 2016
+./bin/tests/system/dnstap/bad-fstrm-set-flush-timeout-min.conf CONF-C 2016
+./bin/tests/system/dnstap/bad-fstrm-set-input-queue-size-max.conf CONF-C 2016
+./bin/tests/system/dnstap/bad-fstrm-set-input-queue-size-min.conf CONF-C 2016
+./bin/tests/system/dnstap/bad-fstrm-set-input-queue-size-po2.conf CONF-C 2016
+./bin/tests/system/dnstap/bad-fstrm-set-output-notify-threshold.conf CONF-C 2016
+./bin/tests/system/dnstap/bad-fstrm-set-output-queue-size-max.conf CONF-C 2016
+./bin/tests/system/dnstap/bad-fstrm-set-output-queue-size-min.conf CONF-C 2016
+./bin/tests/system/dnstap/bad-fstrm-set-reopen-interval-max.conf CONF-C 2016
+./bin/tests/system/dnstap/bad-fstrm-set-reopen-interval-min.conf CONF-C 2016
./bin/tests/system/dnstap/clean.sh SH 2015,2016
+./bin/tests/system/dnstap/good-fstrm-set-buffer-hint.conf CONF-C 2016
+./bin/tests/system/dnstap/good-fstrm-set-flush-timeout.conf CONF-C 2016
+./bin/tests/system/dnstap/good-fstrm-set-input-queue-size.conf CONF-C 2016
+./bin/tests/system/dnstap/good-fstrm-set-output-notify-threshold.conf CONF-C 2016
+./bin/tests/system/dnstap/good-fstrm-set-output-queue-model-mpsc.conf CONF-C 2016
+./bin/tests/system/dnstap/good-fstrm-set-output-queue-model-spsc.conf CONF-C 2016
+./bin/tests/system/dnstap/good-fstrm-set-output-queue-size.conf CONF-C 2016
+./bin/tests/system/dnstap/good-fstrm-set-reopen-interval.conf CONF-C 2016
./bin/tests/system/dnstap/ns1/named.conf CONF-C 2015,2016
./bin/tests/system/dnstap/ns1/root.db ZONE 2015,2016
./bin/tests/system/dnstap/ns2/example.db ZONE 2015,2016