From nobody Fri Jan 17 19:44:50 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 4YZVYt6Lb3z5lNKY; Fri, 17 Jan 2025 19:44:50 +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 4YZVYt5p7Cz3y0X; Fri, 17 Jan 2025 19:44:50 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1737143090; 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=fjboSx/9v9mg41QEJJfwcCmStj56Oqiurm63EtYtQCI=; b=Mq4yRlCoJYrDM8bzyKrtFAO6m5lgCWLr3ZGmRMW3Oy/ON33ehpn7Rcr4rGhqkrB5tafrqA B8kjuM2cfSRKw1Uul3rewTsV/aBxLR4hz049Zh5viT+wzMkFd12zJ6RhAYLuKTWqXB2Cy1 08XCA96SMCEbD2dnLAhVXFhqKwkNUUeIqeDAbAH3o8U5/7otiiRt/PdlmrwNWcnpSH8XKB 82H5yDaKEWnfN6/i6IbwI6PwUd1lkAxvLy1agW4zwziDVIr6BTMBcCahdbPiIjr7FbtULD 4Q+2bQhG1GGA8uqXLlLjx7iJU7Td+ZY/9G/4uSTl/LSldowIA8my85HYrr8knw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1737143090; 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=fjboSx/9v9mg41QEJJfwcCmStj56Oqiurm63EtYtQCI=; b=kAV/ff3LKmHxUJzAQsI0wj0xztF27RT2PMW8brDXTV8yRCKVAXr29a18+JKVwj+tmqIxbK Dh5Rf08QgGFtLZlPIc4T6AM/lgf8uCQlVDe9Ohh3SYrV1J8wmGGPbP4Yp4d6Jw1g8aTSSe 0u7W3/9f+QdSYb2YdHtKWsErWaYcwiFSruPAmrrydSs//pGdBW7Ue/XzsR3gT0Gmb7Qj34 q5UbI6EpW2cRhyqX2aTFkC9pbq4V9Cw2qumQTSw6h20Cw9DgyjqF6UNKg2DXJ08glcDiHF BkcBWnFOcnFl3UbFKsyHNhCcQjKVyYJrVZqT2D3Od4womymDq16RBJY0KLQ0Bw== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1737143090; a=rsa-sha256; cv=none; b=Dd4UZqRk0yoOTl/fb46IJRj30t8XGv64IaJM7/QvtxWfCSZGL5QwAUDGF3bVc3crvwUxLK 5EGu2AFXPQxCQxueNvsEN3S/LIO9/MxvbQuP7cNqTxcLLJ/xbzn9IlyfIZbHpFoBzotkEO ByRuOaMsW+EDOR+xMj9bSwPH82Kdx3bVz1kKp3jTju+5sIgGfmANpm16f9Z4SsCzwHzB+y unxZ969g+O3B04xcwaH3KiLoVXpSsUBiSBBjdo9b7kFzvq/xrJO2Rj8+9S7zlf3qXliGA2 3nxDQiIUWaT+BKFeEz/LMo0VogWA7x8S3Q8nWA7wz5+SXPZaAOhNjfjeP4znRA== 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 4YZVYt4l14zXLs; Fri, 17 Jan 2025 19:44:50 +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 50HJioOq061532; Fri, 17 Jan 2025 19:44:50 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 50HJio9G061529; Fri, 17 Jan 2025 19:44:50 GMT (envelope-from git) Date: Fri, 17 Jan 2025 19:44:50 GMT Message-Id: <202501171944.50HJio9G061529@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Eugene Grosbein Subject: git: 45d1cff2bfc6 - stable/13 - 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: eugen X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: 45d1cff2bfc679aee4d7f8ae8cc827bc163fbd08 Auto-Submitted: auto-generated The branch stable/13 has been updated by eugen: URL: https://cgit.FreeBSD.org/src/commit/?id=45d1cff2bfc679aee4d7f8ae8cc827bc163fbd08 commit 45d1cff2bfc679aee4d7f8ae8cc827bc163fbd08 Author: Gleb Smirnoff AuthorDate: 2025-01-13 18:08:51 +0000 Commit: Eugene Grosbein CommitDate: 2025-01-17 19:44:36 +0000 sockets: virtualize kern.ipc.soacceptqueue PR: 219655 Differential Revision: https://reviews.freebsd.org/D48314 (cherry picked from commit 4155be454c46bc1ab725aca5c6969b064b74be38) --- 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 24cb885504c9..dd5df8886aa4 100644 --- a/sys/kern/uipc_socket.c +++ b/sys/kern/uipc_socket.c @@ -212,38 +212,39 @@ VNET_DEFINE(struct hhook_head *, socket_hhh[HHOOK_SOCKET_LAST + 1]); * 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 u_int numopensockets; @@ -990,8 +991,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; }