From nobody Sun Aug 14 15:20:24 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 4M5LhJ0776z4ZN2V; Sun, 14 Aug 2022 15:20:32 +0000 (UTC) (envelope-from melifaro@ipfw.ru) Received: from forward500p.mail.yandex.net (forward500p.mail.yandex.net [IPv6:2a02:6b8:0:1472:2741:0:8b7:110]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 4M5LhF6jPsz3gLj; Sun, 14 Aug 2022 15:20:29 +0000 (UTC) (envelope-from melifaro@ipfw.ru) Received: from sas1-37da021029ee.qloud-c.yandex.net (sas1-37da021029ee.qloud-c.yandex.net [IPv6:2a02:6b8:c08:1612:0:640:37da:210]) by forward500p.mail.yandex.net (Yandex) with ESMTP id 78A39F01318; Sun, 14 Aug 2022 18:20:26 +0300 (MSK) Received: by sas1-37da021029ee.qloud-c.yandex.net (smtp/Yandex) with ESMTPSA id g8WBXLwTwt-KPiqkIru; Sun, 14 Aug 2022 18:20:25 +0300 (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client certificate not present) X-Yandex-Fwd: 1 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ipfw.ru; s=mail; t=1660490426; bh=uvy3Vs7nnVQ18Y0RldVXpDnz56FiJwBPhrYUtAHrpBY=; h=Message-Id:To:Date:References:Cc:In-Reply-To:From:Subject; b=iV9UTv4nMhztbZqHqJwPp2zOSD6LVbYN/x5IMQgCiPKBFBarrJrEaWkJC3rqGsQPe ERQ6uzylLcjRKzLO6InT4fskIpnPuB7XID9ryIp8Td++nPVcqsHhb7imfebdgu53Ae Igjw9sQMcC/wIVG9mxtUUJ2rsts5j/CQwGP9/fKI= Content-Type: text/plain; charset=utf-8 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 (Mac OS X Mail 16.0 \(3696.120.41.1.1\)) Subject: Re: git: 9b967bd65de6 - main - domains: allow domains to be unloaded From: "Alexander V. Chernikov" In-Reply-To: Date: Sun, 14 Aug 2022 16:20:24 +0100 Cc: "Alexander V. Chernikov" , src-committers@freebsd.org, dev-commits-src-all@freebsd.org, dev-commits-src-main@freebsd.org Content-Transfer-Encoding: quoted-printable Message-Id: References: <202208140922.27E9Mewk097766@gitrepo.freebsd.org> To: Kyle Evans X-Mailer: Apple Mail (2.3696.120.41.1.1) X-Rspamd-Queue-Id: 4M5LhF6jPsz3gLj X-Spamd-Bar: --- Authentication-Results: mx1.freebsd.org; dkim=pass header.d=ipfw.ru header.s=mail header.b=iV9UTv4n; dmarc=none; spf=pass (mx1.freebsd.org: domain of melifaro@ipfw.ru designates 2a02:6b8:0:1472:2741:0:8b7:110 as permitted sender) smtp.mailfrom=melifaro@ipfw.ru X-Spamd-Result: default: False [-3.10 / 15.00]; NEURAL_HAM_LONG(-1.00)[-1.000]; NEURAL_HAM_MEDIUM(-1.00)[-1.000]; NEURAL_HAM_SHORT(-1.00)[-1.000]; MV_CASE(0.50)[]; R_DKIM_ALLOW(-0.20)[ipfw.ru:s=mail]; R_SPF_ALLOW(-0.20)[+ip6:2a02:6b8:0:1000::/52]; RCVD_IN_DNSWL_LOW(-0.10)[2a02:6b8:0:1472:2741:0:8b7:110:from]; MIME_GOOD(-0.10)[text/plain]; RCVD_TLS_LAST(0.00)[]; DKIM_TRACE(0.00)[ipfw.ru:+]; MLMMJ_DEST(0.00)[dev-commits-src-all@freebsd.org,dev-commits-src-main@freebsd.org]; ASN(0.00)[asn:208722, ipnet:2a02:6b8::/32, country:FI]; FROM_EQ_ENVFROM(0.00)[]; MIME_TRACE(0.00)[0:+]; RCPT_COUNT_FIVE(0.00)[5]; MID_RHS_MATCH_FROM(0.00)[]; FREEFALL_USER(0.00)[melifaro]; ARC_NA(0.00)[]; RCVD_COUNT_THREE(0.00)[3]; FROM_HAS_DN(0.00)[]; TO_MATCH_ENVRCPT_ALL(0.00)[]; TO_DN_SOME(0.00)[]; DMARC_NA(0.00)[ipfw.ru]; RCVD_VIA_SMTP_AUTH(0.00)[] X-ThisMailContainsUnwantedMimeParts: N > On 14 Aug 2022, at 15:51, Kyle Evans wrote: >=20 > On Sun, Aug 14, 2022 at 2:22 AM Alexander V. Chernikov > wrote: >>=20 >> The branch main has been updated by melifaro: >>=20 >> URL: = https://cgit.FreeBSD.org/src/commit/?id=3D9b967bd65de6647aed68a141dc34f9b2= 23a2593c >>=20 >> commit 9b967bd65de6647aed68a141dc34f9b223a2593c >> Author: Alexander V. Chernikov >> AuthorDate: 2022-08-12 13:36:53 +0000 >> Commit: Alexander V. Chernikov >> CommitDate: 2022-08-14 09:22:33 +0000 >>=20 >> domains: allow domains to be unloaded >>=20 >> Add domain_remove() SYSUNINT callback that removes the domain >> from the domain list if it has DOMF_UNLOADABLE flag set. >> This change is required to support netlink ( D36002 ). >>=20 >> Reviewed by: glebius >> Differential Revision: https://reviews.freebsd.org/D36173 >> --- >> sys/kern/uipc_domain.c | 23 +++++++++++++++++++++++ >> sys/sys/domain.h | 4 ++++ >> 2 files changed, 27 insertions(+) >>=20 >> diff --git a/sys/kern/uipc_domain.c b/sys/kern/uipc_domain.c >> index c70b3150cbf0..2cae08be089a 100644 >> --- a/sys/kern/uipc_domain.c >> +++ b/sys/kern/uipc_domain.c >> @@ -239,6 +239,29 @@ domain_add(void *data) >> mtx_unlock(&dom_mtx); >> } >>=20 >> +void >> +domain_remove(void *data) >> +{ >> + struct domain *dp =3D (struct domain *)data; >> + >> + if ((dp->dom_flags & DOMF_UNLOADABLE) =3D=3D 0) >> + return; >> + >> + mtx_lock(&dom_mtx); >> + if (domains =3D=3D dp) { >> + domains =3D dp->dom_next; >> + } else { >> + struct domain *curr; >> + for (curr =3D domains; curr !=3D NULL; curr =3D = curr->dom_next) { >> + if (curr->dom_next =3D=3D dp) { >> + curr->dom_next =3D dp->dom_next; >> + break; >> + } >> + } >> + } >> + mtx_unlock(&dom_mtx); >> +} >> + >> /* ARGSUSED*/ >> static void >> domaininit(void *dummy) >=20 > While it's not important for the one domain you care about, this > should likely also check if any contained protocols have > pr_fasttimo/pr_slowtimo and purge them from the appropriate list, just > to be technically correct. (Or at least assert under INVARIANTS that > they do not) That=E2=80=99s a good point! I should have provided more context in the commit message. There is some ongoing work glebius@ is doing in the domain space. Specifically, there are plans to remove this callbacks in the near = future - https://reviews.freebsd.org/D36163 stack provides more = reasoning and implementation details. Additionally, the KPI may be a bit fluid and may change in the = near/mid-term future - that=E2=80=99s why the minimal working version = was committed.