From nobody Wed Apr 12 08:56:00 2023 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 4PxGlN2rZxz44LgM; Wed, 12 Apr 2023 08:56:00 +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 4PxGlN2QTJz3CbM; Wed, 12 Apr 2023 08:56:00 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1681289760; 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=+VXLezjxplrLF0xJHHdhePXHtm7INW6vOm0itasV1Xk=; b=hM/CANYjL9TZXOckQmNCmrgeA714O3RX0J1f84iHOypakLfTeImPgbWo9TXBcmMkY4cFsq ofYRlClXIzKhHtrRFUFEbp8nDQOQgktFOXb7hW1rRm7VStZAc6d2GbT/r4nd80QsOzE1vZ s9dcl6Hjg6n0EVk0O5gM3heXhSBqL7G4ajGVDutBEbvdcuWaEotxtNEm8ENcfAH6t+rT8z PU3LcS+D7inlKyDjniynKVNFUZ1NETr1eWP6N0Urw/EBHqEPRhsLWL56JBD917wDfGBKA0 9cEw5T60eAqDTgmnXxa4Cs4AkpkexB2QDTjxGfq+CQ19pbBr5XnH3c2ZcWu7Wg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1681289760; 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=+VXLezjxplrLF0xJHHdhePXHtm7INW6vOm0itasV1Xk=; b=LuaMEplm+fZodC+4m1PFUox53vO5+4KKTtvpCNuhC8zSUtBfomej95jNmLpeureh9Q5SsD ADoPZWg6kmnMD3V9N0VswvYDbkH5ej7O3RkCfVPROJTQW4FYwSNFkSFxrbSJt/4ly+ZXz3 wLgnppRfebDe2306a0cJQRevMFa7zsBueV9PR2JKGx3iJOl7mIKiRgp44JBUsBhAk/uLbP uqzKRBgrP+OgmXk4cNR3V4yWcVDYruqg0oBrXIe61B0tJnG+W9H07L4w/xFm36eNG7eFp+ De8o4kPNfevPWmUPqpH5PF09Q+JMNQ78HEJtg8v4VPVUP4GtGy5uYWwDpVvs8Q== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1681289760; a=rsa-sha256; cv=none; b=XEs6xMpMn3A3rAnLzMbUbd9rbIrWzE0JYmrAbLxCoXFrsQo4JpESg7uKFzdg4vb8op2/w2 UeI/E/xFJJqQ4nRtSuiJpRSguzqCkyuc8dEIdA6m9hhrwQ7tIvvR/213dxvOOGYFpdsFAN vSv5NN8ssG7YI1bakU6OZQ075wgJbu3+pWnCuDbOsDezkNOuH7TimxPm6iFDzn5DftPE1h qXi1oZbFoODDtDFWsD3s9vWGfKoJ8TWVHfGd7ejUCatw+LcKIvfNHxsR84X3oXmilZRhag KJzJv/naJvA6a1L6ntepxWAo0pPinBRXCedi2KZ/2dMh4nrTS1mBqrpkGixR3w== 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 4PxGlN1WklzswY; Wed, 12 Apr 2023 08:56:00 +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 33C8u0jE042434; Wed, 12 Apr 2023 08:56:00 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 33C8u0b9042433; Wed, 12 Apr 2023 08:56:00 GMT (envelope-from git) Date: Wed, 12 Apr 2023 08:56:00 GMT Message-Id: <202304120856.33C8u0b9042433@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Michael Tuexen Subject: git: 73c48d9d8f89 - main - tcp: fix deregistering stacks when vnets are used 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: tuexen X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 73c48d9d8f89f066db5c5eef967a936d6b7f2d1f Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by tuexen: URL: https://cgit.FreeBSD.org/src/commit/?id=73c48d9d8f89f066db5c5eef967a936d6b7f2d1f commit 73c48d9d8f89f066db5c5eef967a936d6b7f2d1f Author: Michael Tuexen AuthorDate: 2023-04-12 08:52:53 +0000 Commit: Michael Tuexen CommitDate: 2023-04-12 08:52:53 +0000 tcp: fix deregistering stacks when vnets are used This fixes a bug where stacks could not be deregistered when end points in the non-default vnet are using it. Reviewed by: glebius, zlei MFC after: 1 week Sponsored by: Netflix, Inc. Differential Revision: https://reviews.freebsd.org/D39514 --- sys/netinet/tcp_subr.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/sys/netinet/tcp_subr.c b/sys/netinet/tcp_subr.c index 36112a101fa8..be78396260c7 100644 --- a/sys/netinet/tcp_subr.c +++ b/sys/netinet/tcp_subr.c @@ -1355,8 +1355,6 @@ deregister_tcp_functions(struct tcp_function_block *blk, bool quiesce, * to the default stack. */ if (force && blk->tfb_refcnt) { - struct inpcb_iterator inpi = INP_ALL_ITERATOR(&V_tcbinfo, - INPLOOKUP_WLOCKPCB); struct inpcb *inp; struct tcpcb *tp; VNET_ITERATOR_DECL(vnet_iter); @@ -1366,6 +1364,9 @@ deregister_tcp_functions(struct tcp_function_block *blk, bool quiesce, VNET_LIST_RLOCK(); VNET_FOREACH(vnet_iter) { CURVNET_SET(vnet_iter); + struct inpcb_iterator inpi = INP_ALL_ITERATOR(&V_tcbinfo, + INPLOOKUP_WLOCKPCB); + while ((inp = inp_next(&inpi)) != NULL) { tp = intotcpcb(inp); if (tp == NULL || tp->t_fb != blk)