From nobody Wed Dec 21 01:39:28 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 4NcGMN3r24z1GBC8; Wed, 21 Dec 2022 01:39:28 +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 4NcGMN2W9Vz3xPc; Wed, 21 Dec 2022 01:39:28 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1671586768; 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=SarqTAwe0mVg6u+9zRzvzQX1iUhHsHBuQ3fpQQBeX5U=; b=umQIJKaxn6f2jR1SMl3jQBpOlhzVdgLrveKUCSfPTb+svEdzNzjq7HO4au35AObIghljKr W+qt4rz2PWi7aDsYiQq+yVzqf3puh/7F7L/1P2Hs5U/iI+gbfVoJAZdnBGKqlJL7w0F05M 4Z2iil/Ik/GZZaHpvPSVkWDxwiS4tB20lICh6HyyJlTf6/mXxWYLpES4b6YFOZSnDPq5FT reeCLnMAP+5Sb+rNNiLgVwIi+l/utvGfK/mTqXKi1tv1yOfIE8sqs4OoS3+S2fJfGHOjSF L5EMl6bA9jBOtkFSOKhk6JBBbKBqUjltlPlcE09GTZvMaTpWuD4I+EZ9I7gcoA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1671586768; 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=SarqTAwe0mVg6u+9zRzvzQX1iUhHsHBuQ3fpQQBeX5U=; b=UX/cnDkAjf1AaiKZ7Hw+7Tv/Z2a09K0DEst3DRS7/4nnO/oR1XyfJwVbdV7leuFRctRhdG 2z+9nCqyC7/D5NCC/63Df3TdfNNKgFquw1qox9VLkrTnhOikwuHCM0D2s6x8hGmyKpuLhA Nl4SU9BmtL3Xvt0HXa8tjw1hTrGKZE2znArY1UtmncGGMuZgonoPLjjwaluceOa6hs3ps4 Z/Bn8KXql8cl/ZjoAahEDpIRwlJjVoIEIst98vboomAzrsbKs+vOQWc4o/DL8qQDdcr4w9 Ttn2bBtno4OGM+3f2Ct5noZ1iJXNmKkdVSaPgTm7r6H4OhhBOVVFV/sCK27BRw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1671586768; a=rsa-sha256; cv=none; b=DrhPbFjnZu8kRXCaXZJoRTGwEa7VdejE5XzF6NFHjctnsUGCzwaTJa8YKdSMhJOEeccr1F M3X6+x7eD0jVtuhim2FK6/oFhsAXLn1Bmr2JzcCzRFEwiaHwPPDMKmfwTexXoegE/xWBYw ogFgPn4umj8v+bbNBl8DEz9XdN4rFnl5X9cp0jafUtfsv5GXAhCDuNjt7BMjAfQ9XuqEHO /yXGm1LinEWRvcmF3UW2/rhsqkfAndzTNPhKVnKTrr8vRv3qLVk64lESQ/kX19z++psNcl r8D2Uwl0SelTS0JN3xoGlHoHyiurwdET6VGkRiWxnIhljdJa2/sHvyvqAUvjHQ== 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 4NcGMN1TpNzwbQ; Wed, 21 Dec 2022 01:39:28 +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 2BL1dSSE008436; Wed, 21 Dec 2022 01:39:28 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 2BL1dShO008435; Wed, 21 Dec 2022 01:39:28 GMT (envelope-from git) Date: Wed, 21 Dec 2022 01:39:28 GMT Message-Id: <202212210139.2BL1dShO008435@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Zhenlei Huang Subject: git: 73336a6fd85b - main - routing: Use NET_EPOCH_[CALL|WAIT] macros 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: zlei X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 73336a6fd85b0267cebdbe1c91dc009a5ef8059e Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by zlei: URL: https://cgit.FreeBSD.org/src/commit/?id=73336a6fd85b0267cebdbe1c91dc009a5ef8059e commit 73336a6fd85b0267cebdbe1c91dc009a5ef8059e Author: Zhenlei Huang AuthorDate: 2022-12-21 01:33:31 +0000 Commit: Zhenlei Huang CommitDate: 2022-12-21 01:33:31 +0000 routing: Use NET_EPOCH_[CALL|WAIT] macros Reviewed by: melifaro, kp Approved by: kp (mentor) Differential Revision: https://reviews.freebsd.org/D37729 --- sys/net/route/fib_algo.c | 2 +- sys/net/route/nhgrp_ctl.c | 3 +-- sys/net/route/nhop.c | 3 +-- sys/net/route/nhop_ctl.c | 3 +-- sys/net/route/route_rtentry.c | 3 +-- sys/net/route/route_subscription.c | 9 +++------ sys/net/route/route_tables.c | 2 +- 7 files changed, 9 insertions(+), 16 deletions(-) diff --git a/sys/net/route/fib_algo.c b/sys/net/route/fib_algo.c index 1274e5e90bd4..3c2ffa45afbb 100644 --- a/sys/net/route/fib_algo.c +++ b/sys/net/route/fib_algo.c @@ -1738,7 +1738,7 @@ fib_set_algo_ptr(struct fib_data *fd, void *algo_data) void fib_epoch_call(epoch_callback_t callback, epoch_context_t ctx) { - epoch_call(net_epoch_preempt, callback, ctx); + NET_EPOCH_CALL(callback, ctx); } /* diff --git a/sys/net/route/nhgrp_ctl.c b/sys/net/route/nhgrp_ctl.c index 5d6fb219f877..b829b1125597 100644 --- a/sys/net/route/nhgrp_ctl.c +++ b/sys/net/route/nhgrp_ctl.c @@ -385,8 +385,7 @@ nhgrp_free(struct nhgrp_object *nhg) NET_EPOCH_EXIT(et); KASSERT((nhg_priv->nhg_idx == 0), ("gr_idx != 0")); - epoch_call(net_epoch_preempt, destroy_nhgrp_epoch, - &nhg_priv->nhg_epoch_ctx); + NET_EPOCH_CALL(destroy_nhgrp_epoch, &nhg_priv->nhg_epoch_ctx); } /* diff --git a/sys/net/route/nhop.c b/sys/net/route/nhop.c index 9fac76105598..07bced3e8b11 100644 --- a/sys/net/route/nhop.c +++ b/sys/net/route/nhop.c @@ -170,8 +170,7 @@ nhops_destroy_rib(struct rib_head *rh) * Postpone destruction till the end of current epoch * so nhop_free() can safely use nh_control pointer. */ - epoch_call(net_epoch_preempt, destroy_ctl_epoch, - &ctl->ctl_epoch_ctx); + NET_EPOCH_CALL(destroy_ctl_epoch, &ctl->ctl_epoch_ctx); } /* diff --git a/sys/net/route/nhop_ctl.c b/sys/net/route/nhop_ctl.c index 201a1ed0a094..d042d9519f6b 100644 --- a/sys/net/route/nhop_ctl.c +++ b/sys/net/route/nhop_ctl.c @@ -638,8 +638,7 @@ nhop_free(struct nhop_object *nh) } NET_EPOCH_EXIT(et); - epoch_call(net_epoch_preempt, destroy_nhop_epoch, - &nh_priv->nh_epoch_ctx); + NET_EPOCH_CALL(destroy_nhop_epoch, &nh_priv->nh_epoch_ctx); } void diff --git a/sys/net/route/route_rtentry.c b/sys/net/route/route_rtentry.c index 41e4ff8ac49f..64900ae3ae39 100644 --- a/sys/net/route/route_rtentry.c +++ b/sys/net/route/route_rtentry.c @@ -154,8 +154,7 @@ rt_free(struct rtentry *rt) KASSERT(rt != NULL, ("%s: NULL rt", __func__)); - epoch_call(net_epoch_preempt, destroy_rtentry_epoch, - &rt->rt_epoch_ctx); + NET_EPOCH_CALL(destroy_rtentry_epoch, &rt->rt_epoch_ctx); } void diff --git a/sys/net/route/route_subscription.c b/sys/net/route/route_subscription.c index 65b1bdae9900..2c2b3e94e6b4 100644 --- a/sys/net/route/route_subscription.c +++ b/sys/net/route/route_subscription.c @@ -157,8 +157,7 @@ rib_unsubscribe(struct rib_subscription *rs) CK_STAILQ_REMOVE(&rnh->rnh_subscribers, rs, rib_subscription, next); RIB_WUNLOCK(rnh); - epoch_call(net_epoch_preempt, destroy_subscription_epoch, - &rs->epoch_ctx); + NET_EPOCH_CALL(destroy_subscription_epoch, &rs->epoch_ctx); } void @@ -171,8 +170,7 @@ rib_unsubscribe_locked(struct rib_subscription *rs) CK_STAILQ_REMOVE(&rnh->rnh_subscribers, rs, rib_subscription, next); - epoch_call(net_epoch_preempt, destroy_subscription_epoch, - &rs->epoch_ctx); + NET_EPOCH_CALL(destroy_subscription_epoch, &rs->epoch_ctx); } /* @@ -205,8 +203,7 @@ rib_destroy_subscriptions(struct rib_head *rnh) RIB_WLOCK(rnh); while ((rs = CK_STAILQ_FIRST(&rnh->rnh_subscribers)) != NULL) { CK_STAILQ_REMOVE_HEAD(&rnh->rnh_subscribers, next); - epoch_call(net_epoch_preempt, destroy_subscription_epoch, - &rs->epoch_ctx); + NET_EPOCH_CALL(destroy_subscription_epoch, &rs->epoch_ctx); } RIB_WUNLOCK(rnh); NET_EPOCH_EXIT(et); diff --git a/sys/net/route/route_tables.c b/sys/net/route/route_tables.c index 614c28ded0cf..637a86573320 100644 --- a/sys/net/route/route_tables.c +++ b/sys/net/route/route_tables.c @@ -245,7 +245,7 @@ grow_rtables(uint32_t num_tables) /* Wait till all cpus see new pointers */ atomic_thread_fence_rel(); - epoch_wait_preempt(net_epoch_preempt); + NET_EPOCH_WAIT(); /* Set number of fibs to a new value */ V_rt_numfibs = num_tables;