From nobody Sun Aug 21 14:45:38 2022 X-Original-To: dev-commits-src-main@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 4M9dZq178kz4YxxY; Sun, 21 Aug 2022 14:45:39 +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 4M9dZq0bpNz4Lyb; Sun, 21 Aug 2022 14:45:39 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1661093139; 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=hlYvOJ7n1n0OJsee1pJRw0BgAwjB1Je9+TIKJvWU9P4=; b=sLwaQrgcJI4PGz/ezVTEWhen6a8udlYfEZvLItDCWFerN3vIphBOq2AAIDNQrbyYyBWKcT nEiOam5Q9AY7cMDObzXlY879iV8KO0vlvo1B1hZ9cm2bGV1/yM7rwRlrtLUL9Xnh4sNkGN sDfBZJZRBiioGG40uAayEdMo29Ibj6hFIkFzqXIJBfhcWF3xWh93bdZympwFKrksqYZK9B Lm1fCf/LzUxrvJmuepxkA41gY4CgMyxWu51XKDNtAaSbCd88fwQyYrboDoeAaomPfDKHkF NOIUUL7Ejwe6U1ZleBkeTT3+o8V5cFI3p/Gvx6Eke0hS3SfTzFnZkzLddWI/VQ== 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 4M9dZp6XrfzDm7; Sun, 21 Aug 2022 14:45:38 +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 27LEjco5085116; Sun, 21 Aug 2022 14:45:38 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 27LEjcke085115; Sun, 21 Aug 2022 14:45:38 GMT (envelope-from git) Date: Sun, 21 Aug 2022 14:45:38 GMT Message-Id: <202208211445.27LEjcke085115@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: 6498153665fd - main - ip_reass: don't drain all vnets on a vnet destroy List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@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: 6498153665fddbcf3efa94a230933a3b8834240b Auto-Submitted: auto-generated ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1661093139; 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=hlYvOJ7n1n0OJsee1pJRw0BgAwjB1Je9+TIKJvWU9P4=; b=V57iUlXN4NJpyMJTQUMSqOrS76eHVZSSp+qR0wfD0JRpqXiGC+kFnRMFKG/U7UleofSXKL C2o1r5PM570Sy7rG2rFdHsjNWZGeXr5zzDH3LPaWcxBaic715ZmZFjzEie6w7BsNQYfYZk FRLcm1+2Cyh6VDHao1wRYOC7dKOH25Na5ZjJFc1b+igSOl8UhtkqROfbMvNBRwvQRj2fgP Pck+Ssbgg0wYKOPDO4AUyHaOmJmjVwe+ozCRUOD4cKmduAmeBr9qQxuq8qTsBuDiJOnI9T iUVGJZKb6C5EV98Q5CDBtQwCeYCMoqerqKCQ8+hMPpDGoVUd/8zb1wZVrn+7sA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1661093139; a=rsa-sha256; cv=none; b=cbUsFXppWqYHBZddtQRxZvCAGLPVDaxb5S333NJo/OLmfTi3cxBRa5+85MvT5Cp4yAv4wB 9Vq/hv9dveZ8XtuSPYaYpiDWoMSMDahawzvZ53uHIqAa3V8vUr520hGB3WuPbUt+mImgta xR4O/2EWzEQXcivmA5+q7fjEtxqzHSVWgMWyTEVGUC0dgEa0f0n/u7Owi5B9vH7VFke4H3 LyIAU+5SbVjcCF/Qn67jMo5W4sWmmvK1o3EqHJf/m1IkqHitu7RScPBtD1P74c4aI+9Y2M wqWoCpguMszfHhxu/+5ObL7yfbiZSKbm0WGpQIcc5pebGJDYSZKpiVIBtTc5lw== 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=6498153665fddbcf3efa94a230933a3b8834240b commit 6498153665fddbcf3efa94a230933a3b8834240b Author: Gleb Smirnoff AuthorDate: 2022-08-21 14:44:58 +0000 Commit: Gleb Smirnoff CommitDate: 2022-08-21 14:44:58 +0000 ip_reass: don't drain all vnets on a vnet destroy --- sys/netinet/ip_reass.c | 28 +++++++++++++++++----------- 1 file changed, 17 insertions(+), 11 deletions(-) diff --git a/sys/netinet/ip_reass.c b/sys/netinet/ip_reass.c index e581e2e622c7..2589151cc970 100644 --- a/sys/netinet/ip_reass.c +++ b/sys/netinet/ip_reass.c @@ -599,6 +599,21 @@ ipreass_timer_init(void *arg __unused) callout_reset_sbt(&ipreass_callout, SBT_1MS * 500, SBT_1MS * 10, ipreass_slowtimo, NULL, 0); } + +static void +ipreass_drain_vnet(void) +{ + + for (int i = 0; i < IPREASS_NHASH; i++) { + IPQ_LOCK(i); + while(!TAILQ_EMPTY(&V_ipq[i].head)) + ipq_drop(&V_ipq[i], TAILQ_FIRST(&V_ipq[i].head)); + KASSERT(V_ipq[i].count == 0, + ("%s: V_ipq[%d] count %d (V_ipq=%p)", __func__, i, + V_ipq[i].count, V_ipq)); + IPQ_UNLOCK(i); + } +} SYSINIT(ipreass, SI_SUB_VNET_DONE, SI_ORDER_ANY, ipreass_timer_init, NULL); /* @@ -611,16 +626,7 @@ ipreass_drain(void) VNET_FOREACH(vnet_iter) { CURVNET_SET(vnet_iter); - for (int i = 0; i < IPREASS_NHASH; i++) { - IPQ_LOCK(i); - while(!TAILQ_EMPTY(&V_ipq[i].head)) - ipq_drop(&V_ipq[i], - TAILQ_FIRST(&V_ipq[i].head)); - KASSERT(V_ipq[i].count == 0, - ("%s: V_ipq[%d] count %d (V_ipq=%p)", __func__, i, - V_ipq[i].count, V_ipq)); - IPQ_UNLOCK(i); - } + ipreass_drain_vnet(); CURVNET_RESTORE(); } } @@ -710,7 +716,7 @@ void ipreass_destroy(void) { - ipreass_drain(); + ipreass_drain_vnet(); uma_zdestroy(V_ipq_zone); V_ipq_zone = NULL; for (int i = 0; i < IPREASS_NHASH; i++)