From nobody Fri Jul 29 19:21:46 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 4Lvcp26srfz4Y6Kq; Fri, 29 Jul 2022 19:21:46 +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 4Lvcp26NWjz46k4; Fri, 29 Jul 2022 19:21:46 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1659122506; 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=Zcq96FYzMeS8vpTjBr1FcnnmJecJ1bHGGQ84CnGHa9E=; b=Q3nR1e5jsCZhrGJy9QxMhaAjp45/3EUF4j3UYnzQQGrgT2xgVRLvLy4WmR8WNklodsheJB cw7Wkc5zV2SqU7DN655BtERFjCmMPG68aEFIQ0I8PipJmLGRr3y6cmQuE2TD3JwBwSptdL XYyW+lhfcj5oeojwCuRh6wcEgtxp52UNh5dGiRJMveDLpvFdeonWZEZKgxWtCilEQGPU2/ 07uQuksyKMMsMqaLLcKyEhrUSdgAsdD+kRa+q24IHog5Pv/w/ro3Z5q3wI5mxWZgSZeY4W D9Egix5G5SOSQbc97Tx3OjxhA04MCjYPMUMIguST8z+gFtnGlEjDhcPsIV5Dyg== 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 4Lvcp25Sb4zmcx; Fri, 29 Jul 2022 19:21:46 +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 26TJLklp079867; Fri, 29 Jul 2022 19:21:46 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 26TJLkU2079866; Fri, 29 Jul 2022 19:21:46 GMT (envelope-from git) Date: Fri, 29 Jul 2022 19:21:46 GMT Message-Id: <202207291921.26TJLkU2079866@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Kristof Provost Subject: git: 150486f6a940 - main - Introduce and use the NET_EPOCH_DRAIN_CALLBACKS() macro 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: kp X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 150486f6a940947fa7a7c6db357c3f92d07a955f Auto-Submitted: auto-generated ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1659122506; 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=Zcq96FYzMeS8vpTjBr1FcnnmJecJ1bHGGQ84CnGHa9E=; b=DueGLnQDcvdE/HXemalcae3tMzejnej1cvER5yM6Lj2RvfsAYRfNMuwWx0Het03r6w8iNb bkjftyTo7fRkyivUyCzat/JLc8gzypCUvWk+yq/AzPRZ5WWvCoRG3AwMi9uHeLOwojn6f4 OC0C1B86geP2gZRMY6jlco8eEZOuZV4f+qITEXyyXuR3bnUX7BWDy6attEM3wGxubX4xio Pq8ifv/y4/fFQ4y0AuD9TPMi2mNshCBhGkEVNKyPGc3DH3HRM/A/mz0eJlBtz1RU/rOkHS e0UPLbVc2jmQHTmOREB/SbEvzu3VTUAw+3tLzQBXrrRMS5HRTrS5YDICypNLJw== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1659122506; a=rsa-sha256; cv=none; b=chzmIp9VyoPdP3XV0HrT8+X91CO6c9jNG2Z4ckdy0g8+zHzlmd8hcQpz4qxusP+Aksvfie hqqeMRkKLTRhTKp9moH+LGBDk9xQM8Gatvxv6eWNDpeKH3JBcLX5FCccPzSMbHE2sBF5Jo XfkSFAh9ZvQ2HtvWuPufl1bbIBDi4KdjqnXN48Erq1oMIvGSx2+9SvKAT5V0Yx8XMuPx8E /NeVH9md5N4T7ioJ6jZpuTYFN1RzFql7FAkD51Ml5p/6yv3CKRzedtiQG51JOCbhermQ2n d4m1ATeL2kcvTYsBt8q1UdU8zp3IV23Wwgp8cXdAfv4n5SnkVSNrpKupooeVMw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by kp: URL: https://cgit.FreeBSD.org/src/commit/?id=150486f6a940947fa7a7c6db357c3f92d07a955f commit 150486f6a940947fa7a7c6db357c3f92d07a955f Author: Zhenlei Huang AuthorDate: 2022-07-29 13:02:39 +0000 Commit: Kristof Provost CommitDate: 2022-07-29 19:21:10 +0000 Introduce and use the NET_EPOCH_DRAIN_CALLBACKS() macro Reviewed by: melifao, kp Differential Revision: https://reviews.freebsd.org/D35968 --- sys/net/if.c | 4 ++-- sys/net/if_bridge.c | 2 +- sys/net/route/fib_algo.c | 2 +- sys/net/route/route_tables.c | 2 +- sys/netpfil/pf/pf_ioctl.c | 2 +- sys/sys/epoch.h | 1 + 6 files changed, 7 insertions(+), 6 deletions(-) diff --git a/sys/net/if.c b/sys/net/if.c index 8f463d0bfa58..24a97329d232 100644 --- a/sys/net/if.c +++ b/sys/net/if.c @@ -1143,7 +1143,7 @@ if_detach_internal(struct ifnet *ifp, bool vmove) * which lead to leave group calls, which in turn access the * belonging ifnet structure: */ - epoch_drain_callbacks(net_epoch_preempt); + NET_EPOCH_DRAIN_CALLBACKS(); /* * In any case (destroy or vmove) detach us from the groups @@ -4206,7 +4206,7 @@ if_deregister_com_alloc(u_char type) * fixes issues about late invocation of if_destroy(), which leads * to memory leak from if_com_alloc[type] allocated if_l2com. */ - epoch_drain_callbacks(net_epoch_preempt); + NET_EPOCH_DRAIN_CALLBACKS(); if_com_alloc[type] = NULL; if_com_free[type] = NULL; diff --git a/sys/net/if_bridge.c b/sys/net/if_bridge.c index 39085fa440e8..664a1f885a46 100644 --- a/sys/net/if_bridge.c +++ b/sys/net/if_bridge.c @@ -600,7 +600,7 @@ vnet_bridge_uninit(const void *unused __unused) BRIDGE_LIST_LOCK_DESTROY(); /* Callbacks may use the UMA zone. */ - epoch_drain_callbacks(net_epoch_preempt); + NET_EPOCH_DRAIN_CALLBACKS(); uma_zdestroy(V_bridge_rtnode_zone); } diff --git a/sys/net/route/fib_algo.c b/sys/net/route/fib_algo.c index 54b0464711a5..42ad3f43d9cf 100644 --- a/sys/net/route/fib_algo.c +++ b/sys/net/route/fib_algo.c @@ -1509,7 +1509,7 @@ set_fib_algo(uint32_t fibnum, int family, struct sysctl_oid *oidp, struct sysctl fib_cleanup_algo(rh, true, false); /* Drain cb so user can unload the module after userret if so desired */ - epoch_drain_callbacks(net_epoch_preempt); + NET_EPOCH_DRAIN_CALLBACKS(); return (0); } diff --git a/sys/net/route/route_tables.c b/sys/net/route/route_tables.c index c9a9d6a915eb..54b467f9801f 100644 --- a/sys/net/route/route_tables.c +++ b/sys/net/route/route_tables.c @@ -299,7 +299,7 @@ rtables_destroy(const void *unused __unused) * nexthops deletions will be scheduled for the next epoch run * and will be completed after vnet teardown. */ - epoch_drain_callbacks(net_epoch_preempt); + NET_EPOCH_DRAIN_CALLBACKS(); free(V_rt_tables, M_RTABLE); vnet_rtzone_destroy(); diff --git a/sys/netpfil/pf/pf_ioctl.c b/sys/netpfil/pf/pf_ioctl.c index 3108536b58ab..696ae4d0de70 100644 --- a/sys/netpfil/pf/pf_ioctl.c +++ b/sys/netpfil/pf/pf_ioctl.c @@ -5186,7 +5186,7 @@ DIOCCHANGEADDR_error: break; } /* Ensure there's no more ethernet rules to clean up. */ - epoch_drain_callbacks(net_epoch_preempt); + NET_EPOCH_DRAIN_CALLBACKS(); PF_RULES_WLOCK(); for (i = 0, ioe = ioes; i < io->size; i++, ioe++) { ioe->anchor[sizeof(ioe->anchor) - 1] = '\0'; diff --git a/sys/sys/epoch.h b/sys/sys/epoch.h index 7b06ee19c2f3..10ca9a6e5c7d 100644 --- a/sys/sys/epoch.h +++ b/sys/sys/epoch.h @@ -109,6 +109,7 @@ extern epoch_t net_epoch_preempt; #define NET_EPOCH_EXIT(et) epoch_exit_preempt(net_epoch_preempt, &(et)) #define NET_EPOCH_WAIT() epoch_wait_preempt(net_epoch_preempt) #define NET_EPOCH_CALL(f, c) epoch_call(net_epoch_preempt, (f), (c)) +#define NET_EPOCH_DRAIN_CALLBACKS() epoch_drain_callbacks(net_epoch_preempt) #define NET_EPOCH_ASSERT() MPASS(in_epoch(net_epoch_preempt)) #define NET_TASK_INIT(t, p, f, c) TASK_INIT_FLAGS(t, p, f, c, TASK_NETWORK) #define NET_GROUPTASK_INIT(gtask, prio, func, ctx) \