2
0
mirror of https://gitlab.isc.org/isc-projects/bind9 synced 2025-08-31 06:25:31 +00:00

associate socket stats counters with netmgr socket objects

- the socket stat counters have been moved from socket.h to stats.h.
- isc_nm_t now attaches to the same stats counter group as
  isc_socketmgr_t, so that both managers can increment the same
  set of statistics
- isc__nmsocket_init() now takes an interface as a paramter so that
  the address family can be determined when initializing the socket.
- based on the address family and socket type, a group of statistics
  counters will be associated with the socket - for example, UDP4Active
  with IPv4 UDP sockets and TCP6Active with IPv6 TCP sockets.  note
  that no counters are currently associated with TCPDNS sockets; those
  stats will be handled by the underlying TCP socket.
- the counters are not actually used by netmgr sockets yet; counter
  increment and decrement calls will be added in a later commit.
This commit is contained in:
Evan Hunt
2020-01-05 01:02:12 -08:00
parent a4ec0ccb91
commit 80a5c9f5c8
10 changed files with 343 additions and 149 deletions

View File

@@ -54,8 +54,7 @@ isc_nm_listenudp(isc_nm_t *mgr, isc_nmiface_t *iface,
* socket for each worker thread.
*/
nsock = isc_mem_get(mgr->mctx, sizeof(isc_nmsocket_t));
isc__nmsocket_init(nsock, mgr, isc_nm_udplistener);
nsock->iface = iface;
isc__nmsocket_init(nsock, mgr, isc_nm_udplistener, iface);
nsock->nchildren = mgr->nworkers;
atomic_init(&nsock->rchildren, mgr->nworkers);
nsock->children = isc_mem_get(mgr->mctx,
@@ -74,9 +73,8 @@ isc_nm_listenudp(isc_nm_t *mgr, isc_nmiface_t *iface,
isc__netievent_udplisten_t *ievent = NULL;
isc_nmsocket_t *csock = &nsock->children[i];
isc__nmsocket_init(csock, mgr, isc_nm_udpsocket);
isc__nmsocket_init(csock, mgr, isc_nm_udpsocket, iface);
csock->parent = nsock;
csock->iface = iface;
csock->tid = i;
csock->extrahandlesize = extrahandlesize;