aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorZhenlei Huang <zlei@FreeBSD.org>2022-12-21 01:33:31 +0000
committerZhenlei Huang <zlei@FreeBSD.org>2022-12-21 01:33:31 +0000
commit73336a6fd85b0267cebdbe1c91dc009a5ef8059e (patch)
tree954869091f8e11b7f6e1a1d9da14ce5c9eb9289a
parent2e543af13ab3746c7626c53293c007c8747eff9d (diff)
downloadsrc-73336a6fd85b0267cebdbe1c91dc009a5ef8059e.tar.gz
src-73336a6fd85b0267cebdbe1c91dc009a5ef8059e.zip
routing: Use NET_EPOCH_[CALL|WAIT] macros
Reviewed by: melifaro, kp Approved by: kp (mentor) Differential Revision: https://reviews.freebsd.org/D37729
-rw-r--r--sys/net/route/fib_algo.c2
-rw-r--r--sys/net/route/nhgrp_ctl.c3
-rw-r--r--sys/net/route/nhop.c3
-rw-r--r--sys/net/route/nhop_ctl.c3
-rw-r--r--sys/net/route/route_rtentry.c3
-rw-r--r--sys/net/route/route_subscription.c9
-rw-r--r--sys/net/route/route_tables.c2
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;