From nobody Mon Jan 03 18:22:56 2022 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 70249191D40C; Mon, 3 Jan 2022 18:22:59 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4JSPHj6BrNz3Dch; Mon, 3 Jan 2022 18:22:57 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id EC96D221D; Mon, 3 Jan 2022 18:22:56 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 203IMuB3026295; Mon, 3 Jan 2022 18:22:56 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 203IMuTa026294; Mon, 3 Jan 2022 18:22:56 GMT (envelope-from git) Date: Mon, 3 Jan 2022 18:22:56 GMT Message-Id: <202201031822.203IMuTa026294@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Gleb Smirnoff Subject: git: 24e1c6ae7d3f - main - domains: init with standard SYSINIT(9) or VNET_SYSINIT() List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: dev-commits-src-all@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: glebius X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 24e1c6ae7d3f7731a0884a62e9d5273e5ca1335a Auto-Submitted: auto-generated ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1641234178; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=Phct3nG0nfRaOq5jk/1BAi3LiEmGzRc05b1oZPS5bkU=; b=imXn2HZTkm2Mibe/bXtX63nhDPkU83f7c8tj/fk9cw36Hmi2Ssn27MrGlo5QmPvBMeyWUc TIdeqKVb5NFmW6lqo49jo1Idl5a0xp3E7FdnVVP3nSbTDZ89Pq6ERL1iMgl86TQYGy3pLK qfEItldWV8UTpslr+i8XpjDyAm1/i+qiiZSXGCm0lMMom2ETE8/c6EaJlbmXEnfkdhbaUl VIhYZMZ8vSNLiDx9T7d+lzbZyJN+S5L/2+19j4oZVr/1IwVP0zR9JMKPGyCsNq3LFPybIV Vd0Hze4aB5o+11xO+8olaV5m07kMVyx2iCVY8TYXCzdJJBsqQjf+20Bzv5gCHA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1641234178; a=rsa-sha256; cv=none; b=qHYnO3UsR6OF1pqVvAOg7OgCgMOWjifqWJ1spbMvTjAWlXBvyLwd4YOB/nV7IdqMmS0J// IEzQgV1JroNqhM6MLSV0+rrZzqKSsMSCDIZBke97YiSDVRVEBaE24psL6V75RsQXB6j0FA XvQ76RN+9wU/T+Z+XFSLnQpuGE8a41R/6v1znk6yOdrV20UDpSX9sHdFju0gFIvWlBY1G4 jkS9yycIfiormSk0Pn1YhwQqBNPpU1Np87RzbANdqavUmwTf323i1T1C0KQNnYrSc2orXx o3f5vgw9+xkt7jqzJp4QmBAfvyzinQSUoSvGAbNG3PcbT1ppwMF6QJfwWUKENg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by glebius: URL: https://cgit.FreeBSD.org/src/commit/?id=24e1c6ae7d3f7731a0884a62e9d5273e5ca1335a commit 24e1c6ae7d3f7731a0884a62e9d5273e5ca1335a Author: Gleb Smirnoff AuthorDate: 2022-01-03 18:15:22 +0000 Commit: Gleb Smirnoff CommitDate: 2022-01-03 18:15:22 +0000 domains: init with standard SYSINIT(9) or VNET_SYSINIT() There left only three modules that used dom_init(). And netipsec was the last one to use dom_destroy(). Differential revision: https://reviews.freebsd.org/D33540 --- share/man/man9/domain.9 | 2 -- sys/kern/uipc_debug.c | 1 - sys/kern/uipc_domain.c | 4 ---- sys/kern/uipc_usrreq.c | 10 ++-------- sys/ofed/drivers/infiniband/ulp/sdp/sdp_main.c | 4 ++-- sys/sys/domain.h | 4 ---- 6 files changed, 4 insertions(+), 21 deletions(-) diff --git a/share/man/man9/domain.9 b/share/man/man9/domain.9 index 867cfa104718..2fc0fd328392 100644 --- a/share/man/man9/domain.9 +++ b/share/man/man9/domain.9 @@ -69,8 +69,6 @@ struct domain { int dom_family; /* AF_xxx */ char *dom_name; int dom_flags; - void (*dom_init) /* initialize domain data structures */ - (void); int (*dom_probe)(void); /* check for support (optional) */ void (*dom_destroy) /* cleanup structures / state */ (void); diff --git a/sys/kern/uipc_debug.c b/sys/kern/uipc_debug.c index 86c3199a3c26..2f60bb64ed3b 100644 --- a/sys/kern/uipc_debug.c +++ b/sys/kern/uipc_debug.c @@ -251,7 +251,6 @@ db_print_domain(struct domain *d, const char *domain_name, int indent) db_printf("dom_name: %s\n", d->dom_name); db_print_indent(indent); - db_printf("dom_init: %p ", d->dom_init); db_printf("dom_externalize: %p ", d->dom_externalize); db_printf("dom_dispose: %p\n", d->dom_dispose); diff --git a/sys/kern/uipc_domain.c b/sys/kern/uipc_domain.c index da21ed29a716..832db9f6e667 100644 --- a/sys/kern/uipc_domain.c +++ b/sys/kern/uipc_domain.c @@ -188,8 +188,6 @@ domain_init(void *arg) return; KASSERT((flags & DOMF_INITED) == 0 || !IS_DEFAULT_VNET(curvnet), ("Premature initialization of domain in non-default vnet")); - if (dp->dom_init) - (*dp->dom_init)(); for (pr = dp->dom_protosw; pr < dp->dom_protoswNPROTOSW; pr++) { /* * Note that with VIMAGE enabled, domain_init() will be @@ -237,8 +235,6 @@ vnet_domain_uninit(void *arg) if ((atomic_load_acq_int(&dp->dom_flags) & DOMF_SUPPORTED) == 0) return; - if (dp->dom_destroy) - (*dp->dom_destroy)(); } #endif diff --git a/sys/kern/uipc_usrreq.c b/sys/kern/uipc_usrreq.c index ceeb4741e3f4..89d4198652c3 100644 --- a/sys/kern/uipc_usrreq.c +++ b/sys/kern/uipc_usrreq.c @@ -303,7 +303,6 @@ static void unp_gc(__unused void *, int); static void unp_scan(struct mbuf *, void (*)(struct filedescent **, int)); static void unp_discard(struct file *); static void unp_freerights(struct filedescent **, int); -static void unp_init(void); static int unp_internalize(struct mbuf **, struct thread *); static void unp_internalize_fp(struct file *); static int unp_externalize(struct mbuf *, struct mbuf **, int); @@ -459,7 +458,6 @@ static struct protosw localsw[] = { static struct domain localdomain = { .dom_family = AF_LOCAL, .dom_name = "local", - .dom_init = unp_init, .dom_externalize = unp_externalize, .dom_dispose = unp_dispose, .dom_protosw = localsw, @@ -2148,15 +2146,10 @@ unp_zdtor(void *mem, int size __unused, void *arg __unused) #endif static void -unp_init(void) +unp_init(void *arg __unused) { uma_dtor dtor; -#ifdef VIMAGE - if (!IS_DEFAULT_VNET(curvnet)) - return; -#endif - #ifdef INVARIANTS dtor = unp_zdtor; #else @@ -2177,6 +2170,7 @@ unp_init(void) UNP_LINK_LOCK_INIT(); UNP_DEFERRED_LOCK_INIT(); } +SYSINIT(unp_init, SI_SUB_PROTO_DOMAIN, SI_ORDER_SECOND, unp_init, NULL); static void unp_internalize_cleanup_rights(struct mbuf *control) diff --git a/sys/ofed/drivers/infiniband/ulp/sdp/sdp_main.c b/sys/ofed/drivers/infiniband/ulp/sdp/sdp_main.c index 973372b21761..c822276185cb 100644 --- a/sys/ofed/drivers/infiniband/ulp/sdp/sdp_main.c +++ b/sys/ofed/drivers/infiniband/ulp/sdp/sdp_main.c @@ -1907,7 +1907,7 @@ sdp_zone_change(void *tag) } static void -sdp_init(void) +sdp_init(void *arg __unused) { LIST_INIT(&sdp_list); @@ -1919,6 +1919,7 @@ sdp_init(void) rx_comp_wq = create_singlethread_workqueue("rx_comp_wq"); ib_register_client(&sdp_client); } +SYSINIT(sdp_init, SI_SUB_PROTO_DOMAIN, SI_ORDER_SECOND, sdp_init, NULL); extern struct domain sdpdomain; @@ -1966,7 +1967,6 @@ struct protosw sdpsw[] = { struct domain sdpdomain = { .dom_family = AF_INET_SDP, .dom_name = "SDP", - .dom_init = sdp_init, .dom_protosw = sdpsw, .dom_protoswNPROTOSW = &sdpsw[sizeof(sdpsw)/sizeof(sdpsw[0])], }; diff --git a/sys/sys/domain.h b/sys/sys/domain.h index dc09c9786443..c9defe8e4341 100644 --- a/sys/sys/domain.h +++ b/sys/sys/domain.h @@ -51,11 +51,7 @@ struct domain { int dom_family; /* AF_xxx */ char *dom_name; int dom_flags; - void (*dom_init) /* initialize domain data structures */ - (void); int (*dom_probe)(void); /* check for support (optional) */ - void (*dom_destroy) /* cleanup structures / state */ - (void); int (*dom_externalize) /* externalize access rights */ (struct mbuf *, struct mbuf **, int); void (*dom_dispose) /* dispose of internalized rights */