From nobody Wed Aug 17 18:52: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 4M7HFN32pTz4YxyV; Wed, 17 Aug 2022 18:52:24 +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 4M7HFN22y4z4D5N; Wed, 17 Aug 2022 18:52:24 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1660762344; 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=mit3lkyvzwkcW8B1D0E5s6nQFm6b2FGaoSO65tHNXCw=; b=ygGJcVqTfWi//+5/ONkz98HB+2hWnGIUKaZjuKKm9QJKzDVljnpInX7FdRSYdEoR6PuPJi 5VHJZlMH08JIdyjzQYZ9+TBmQlRAUsTJ2w5uObJnJEEuCSuBmrnUCWkYTGydBunu4KpYfP 9zCuYhz6o1Fc021QGW1ZNwDYxTRn257f9GGqYZn3rWv54MyROqqfcX/YncjrGZZpNxU7Io OtUpRo0N1EC2PDvsMr7vTZGQdY6mRR7+KtzALj/pjgQ+C5i1NL/jLWERiXh/6627KYlHTE fOnX6f9aF5zM3Mq91LzvWMAPF3vNtF+BRBhItx4MlhP8HRsIlESfQIrhosJmKg== 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 4M7HFN10pzz10wD; Wed, 17 Aug 2022 18:52:24 +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 27HIqOos013174; Wed, 17 Aug 2022 18:52:24 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 27HIqO4o013173; Wed, 17 Aug 2022 18:52:24 GMT (envelope-from git) Date: Wed, 17 Aug 2022 18:52:24 GMT Message-Id: <202208171852.27HIqO4o013173@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: aea0cd0432f0 - main - ip_reass: separate ipreass_init() into global and VIMAGE parts 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: glebius X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: aea0cd0432f0bb21f78ed7dbf44a64d0cd05c941 Auto-Submitted: auto-generated ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1660762344; 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=mit3lkyvzwkcW8B1D0E5s6nQFm6b2FGaoSO65tHNXCw=; b=O8qOKrfh6NrkZ9zIYQToCkoQEMxmBM6292MqG5MmctVFD7YSa8eVaMDV/2gkUfuV07BlxU dWdpQDWv4qQSFA2v+9KRNfq36LacHg8UAhSSmuwaAGhwlwFvpl/uXzazchCEdxEgODE97/ 7116u+joc+oWbYHywIsCHVqyIkuIm0pmv9Nq31GHG4nqjcpYQwhmVqV9bvF2DG5DgKufCr b+7+Unv2RYukPX4kiDszJb54jjEPLbweRUaeTSl+CYhJXOVGOBDRIsTFFw5BZVBHhr2i/C YyntHBllDO4XNyA3By13WR69c7XJjUyZDK8YFZF6cn9h/jYDONO1qGcoEQD4Rw== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1660762344; a=rsa-sha256; cv=none; b=vt9v/EhFVVCKjht88obUw57PHsgGrRgLovoEvrFO3XKf2/Qkrvcou67Qy4KYu4ctHX3nz9 Gftfwxg3QgydGqz+pkZRJQIuPiFUGfHIIRJ0/V5jk2G95hF+ldBZwzGgsVyXO6XizBn6Or lDtc69t0RolTG6bnOUFYZx6Qy8UZdlQBzRugCrF1xmERyLjsiyf26UXa+//9RnWgpcl59t ZPdGxHwODkoCEhQi235b45wVhpyX/NJA+nspbJNAMZZrgYv9VGvDO2dQZfjjz5oSoT33XI SwyMK/Kqc7EKA6Gz+KSe8HxzFtk+4hxRbNw2gsB+6mhBRz+7suTmfEKk91Qa5Q== 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=aea0cd0432f0bb21f78ed7dbf44a64d0cd05c941 commit aea0cd0432f0bb21f78ed7dbf44a64d0cd05c941 Author: Gleb Smirnoff AuthorDate: 2022-08-17 18:50:31 +0000 Commit: Gleb Smirnoff CommitDate: 2022-08-17 18:50:31 +0000 ip_reass: separate ipreass_init() into global and VIMAGE parts Should have been done in 89128ff3e42. --- sys/netinet/ip_input.c | 5 ++++- sys/netinet/ip_reass.c | 24 ++++++++++++++---------- 2 files changed, 18 insertions(+), 11 deletions(-) diff --git a/sys/netinet/ip_input.c b/sys/netinet/ip_input.c index e17d6fccb202..059f26869e0e 100644 --- a/sys/netinet/ip_input.c +++ b/sys/netinet/ip_input.c @@ -101,6 +101,7 @@ CTASSERT(sizeof(struct ip) == 20); /* IP reassembly functions are defined in ip_reass.c. */ extern void ipreass_init(void); +extern void ipreass_vnet_init(void); #ifdef VIMAGE extern void ipreass_destroy(void); #endif @@ -315,7 +316,7 @@ ip_vnet_init(void *arg __unused) V_in_ifaddrhashtbl = hashinit(INADDR_NHASH, M_IFADDR, &V_in_ifaddrhmask); /* Initialize IP reassembly queue. */ - ipreass_init(); + ipreass_vnet_init(); /* Initialize packet filter hooks. */ args.pa_version = PFIL_VERSION; @@ -349,6 +350,8 @@ static void ip_init(const void *unused __unused) { + ipreass_init(); + /* * Register statically compiled protocols, that are unlikely to * ever become dynamic. diff --git a/sys/netinet/ip_reass.c b/sys/netinet/ip_reass.c index a0a8dd42b758..0420091e0a2a 100644 --- a/sys/netinet/ip_reass.c +++ b/sys/netinet/ip_reass.c @@ -92,6 +92,7 @@ VNET_DEFINE_STATIC(int, ipreass_maxbucketsize); #define V_ipreass_maxbucketsize VNET(ipreass_maxbucketsize) void ipreass_init(void); +void ipreass_vnet_init(void); #ifdef VIMAGE void ipreass_destroy(void); #endif @@ -625,7 +626,7 @@ ipreass_drain(void) * Initialize IP reassembly structures. */ void -ipreass_init(void) +ipreass_vnet_init(void) { int max; @@ -642,16 +643,19 @@ ipreass_init(void) max = IP_MAXFRAGPACKETS; max = uma_zone_set_max(V_ipq_zone, max); V_ipreass_maxbucketsize = imax(max / (IPREASS_NHASH / 2), 1); +} - if (IS_DEFAULT_VNET(curvnet)) { - maxfrags = IP_MAXFRAGS; - EVENTHANDLER_REGISTER(nmbclusters_change, ipreass_zone_change, - NULL, EVENTHANDLER_PRI_ANY); - EVENTHANDLER_REGISTER(vm_lowmem, ipreass_drain, NULL, - LOWMEM_PRI_DEFAULT); - EVENTHANDLER_REGISTER(mbuf_lowmem, ipreass_drain, NULL, - LOWMEM_PRI_DEFAULT); - } +void +ipreass_init(void) +{ + + maxfrags = IP_MAXFRAGS; + EVENTHANDLER_REGISTER(nmbclusters_change, ipreass_zone_change, + NULL, EVENTHANDLER_PRI_ANY); + EVENTHANDLER_REGISTER(vm_lowmem, ipreass_drain, NULL, + LOWMEM_PRI_DEFAULT); + EVENTHANDLER_REGISTER(mbuf_lowmem, ipreass_drain, NULL, + LOWMEM_PRI_DEFAULT); } /*