From nobody Mon Jan 13 18:15:18 2025 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 4YX0mQ6Lg5z5kcXW; Mon, 13 Jan 2025 18:15:18 +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 "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4YX0mQ5csGz3KnH; Mon, 13 Jan 2025 18:15:18 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1736792118; 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=33Z404A5/fZi2pVUSqocKK76CbzypZkaEUFxZAOZyg4=; b=ivf5MHYyXGMjBoYL/ahcu2N66OYiFURAe/odkUH80QMiIxjxYYLCkLAzOve8JzSl3/Kq7F mNgBQUaSsWmDER5FfxjTQ6bEg/57xuuZ5v+PxXbjrVmmzucnElV5/hvCD4QpULTn/RAVmx Wnd2LpxNqw6QI92mIozBfC8LuGbtVpGgEtcBT9GjAFIdmXIFcm5om6ILS65FFqGKw4P6yY wPuEw17zi8xMAGu0dLcOy8fo+WWFT8aoGDNSg6DCwh6K0aBYOqaf9FfKFTVdRZoFSo72g0 YFNxHqT0myDEbXL4WK8iQf4FgKRIoJ7jydH7hCJmmFTj955Zz/ztKbFwo2g3qQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1736792118; 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=33Z404A5/fZi2pVUSqocKK76CbzypZkaEUFxZAOZyg4=; b=JPmtsZi3QOwaHUcvesX40IlG2rFW5mmJ7kWdZvTE1qVlDOqITuNERZ6mHhqS09WyQZrUHA w7tPUteT/YsaLbb/I9PbxBkJbRTYxoP4yq+xeKLJz8cm2OFtuOYPejhjrS6Vvad8WDVvnf 2UkjJYkGfqtaVAQ8j2La+KSDgB5Ec7DKlLP6BVaKhiKLzkLkrbsVLIe/YK+i1JMgiZHutE jX2DGIVSVkbq2BopDp5Qzg5QRFFEqRzllr6V4hbwaUc4hbE1D/2mZPw891gp/KLO8aJEXl Azk6frmsKN23OVK82k29MXafeKbmnIIL57hUJ4GdIgR439D44IcEH0/aeTv0lg== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1736792118; a=rsa-sha256; cv=none; b=w6kaHfL0nyzYFuysjSJIgvPtyM9s/u0hhy/08Qh1yA44DWXtaEUCw+pXZvlFcoDnqDuuwv M5t4zM7yHLsUS+8l3nopdIq9eCfnrqIBkMI551np65dd8SboFXF8jL73JV/sGMIl4s7Mwd Yuk6HgMwd7kAwQYpBoKouZNUM2qg81Klxn7QaGaZihRzXrbwH+jFywMh/J3VfPRqOK5MDH kr8sm9CTGYCC/nXp3W6Oaalc6YmGYv9uGdM/1RBlgmjFfSbKkDaFjfbgI/awT462jLNXzs ISmkZwp7cl3hzA8DrVeGggEia6EKCtWhwRTzebWPDKw0ZXN4YqgAbfMkLYykPg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none 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 4YX0mQ57Gyzj23; Mon, 13 Jan 2025 18:15:18 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 50DIFIO5007935; Mon, 13 Jan 2025 18:15:18 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 50DIFIVA007932; Mon, 13 Jan 2025 18:15:18 GMT (envelope-from git) Date: Mon, 13 Jan 2025 18:15:18 GMT Message-Id: <202501131815.50DIFIVA007932@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: 4155be454c46 - main - sockets: virtualize kern.ipc.soacceptqueue 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: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-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: 4155be454c46bc1ab725aca5c6969b064b74be38 Auto-Submitted: auto-generated The branch main has been updated by glebius: URL: https://cgit.FreeBSD.org/src/commit/?id=4155be454c46bc1ab725aca5c6969b064b74be38 commit 4155be454c46bc1ab725aca5c6969b064b74be38 Author: Gleb Smirnoff AuthorDate: 2025-01-13 18:08:51 +0000 Commit: Gleb Smirnoff CommitDate: 2025-01-13 18:11:39 +0000 sockets: virtualize kern.ipc.soacceptqueue PR: 219655 Differential Revision: https://reviews.freebsd.org/D48314 --- sys/kern/uipc_socket.c | 23 ++++++++++++----------- 1 file changed, 12 insertions(+), 11 deletions(-) diff --git a/sys/kern/uipc_socket.c b/sys/kern/uipc_socket.c index 470a2b3a51e4..7a76b561389a 100644 --- a/sys/kern/uipc_socket.c +++ b/sys/kern/uipc_socket.c @@ -240,38 +240,39 @@ struct splice32 { * NB: The original sysctl somaxconn is still available but hidden * to prevent confusion about the actual purpose of this number. */ -static u_int somaxconn = SOMAXCONN; +VNET_DEFINE_STATIC(u_int, somaxconn) = SOMAXCONN; +#define V_somaxconn VNET(somaxconn) static int sysctl_somaxconn(SYSCTL_HANDLER_ARGS) { int error; - int val; + u_int val; - val = somaxconn; + val = V_somaxconn; error = sysctl_handle_int(oidp, &val, 0, req); if (error || !req->newptr ) return (error); /* * The purpose of the UINT_MAX / 3 limit, is so that the formula - * 3 * so_qlimit / 2 + * 3 * sol_qlimit / 2 * below, will not overflow. */ if (val < 1 || val > UINT_MAX / 3) return (EINVAL); - somaxconn = val; + V_somaxconn = val; return (0); } SYSCTL_PROC(_kern_ipc, OID_AUTO, soacceptqueue, - CTLTYPE_UINT | CTLFLAG_RW | CTLFLAG_MPSAFE, 0, sizeof(int), - sysctl_somaxconn, "I", + CTLTYPE_UINT | CTLFLAG_RW | CTLFLAG_MPSAFE | CTLFLAG_VNET, 0, sizeof(u_int), + sysctl_somaxconn, "IU", "Maximum listen socket pending connection accept queue size"); SYSCTL_PROC(_kern_ipc, KIPC_SOMAXCONN, somaxconn, - CTLTYPE_UINT | CTLFLAG_RW | CTLFLAG_SKIP | CTLFLAG_MPSAFE, 0, - sizeof(int), sysctl_somaxconn, "I", + CTLTYPE_UINT | CTLFLAG_RW | CTLFLAG_SKIP | CTLFLAG_MPSAFE | CTLFLAG_VNET, 0, + sizeof(u_int), sysctl_somaxconn, "IU", "Maximum listen socket pending connection accept queue size (compat)"); static int numopensockets; @@ -1523,8 +1524,8 @@ solisten_proto(struct socket *so, int backlog) so->so_options |= SO_ACCEPTCONN; listening: - if (backlog < 0 || backlog > somaxconn) - backlog = somaxconn; + if (backlog < 0 || backlog > V_somaxconn) + backlog = V_somaxconn; so->sol_qlimit = backlog; mtx_unlock(&so->so_snd_mtx);