Replace the linked list of TCP dispatches with hash table

Reusing TCP connections with dns_dispatch_gettcp() used linear linked
list to lookup existing outgoing TCP connections that could be reused.
Replace the linked list with per-loop cds_lfht hashtable to speedup the
lookups.  We use cds_lfht because it allows non-unique node insertion
that we need to check for dispatches in different connection states.
This commit is contained in:
Ondřej Surý
2023-09-15 14:38:02 +02:00
parent 6fd06c461b
commit c9b4b45943
11 changed files with 131 additions and 101 deletions

View File

@@ -77,7 +77,8 @@ struct dns_dispatchset {
#define DNS_DISPATCHOPT_FIXEDID 0x00000001U
isc_result_t
dns_dispatchmgr_create(isc_mem_t *mctx, isc_nm_t *nm, dns_dispatchmgr_t **mgrp);
dns_dispatchmgr_create(isc_mem_t *mctx, isc_loopmgr_t *loopmgr, isc_nm_t *nm,
dns_dispatchmgr_t **mgrp);
/*%<
* Creates a new dispatchmgr object, and sets the available ports
* to the default range (1024-65535).