netlink: Use NET_EPOCH_[CALL|WAIT] macros

Reviewed by:	melifaro, kp
Approved by:	kp (mentor)
Differential Revision:	https://reviews.freebsd.org/D37730
This commit is contained in:
Zhenlei Huang 2022-12-21 09:40:05 +08:00
parent 73336a6fd8
commit ab591c874b
4 changed files with 5 additions and 6 deletions

View File

@ -486,7 +486,7 @@ nl_pru_detach(struct socket *so)
NL_LOG(LOG_DEBUG3, "socket %p, detached", so);
/* XXX: is delayed free needed? */
epoch_call(net_epoch_preempt, destroy_nlpcb_epoch, &nlp->nl_epoch_ctx);
NET_EPOCH_CALL(destroy_nlpcb_epoch, &nlp->nl_epoch_ctx);
}
static int

View File

@ -513,6 +513,6 @@ genl_unload(void *u __unused)
{
genl_nlctrl_destroy();
GENL_LOCK_DESTROY();
epoch_wait_preempt(net_epoch_preempt);
NET_EPOCH_WAIT();
}
SYSUNINIT(genl_unload, SI_SUB_PROTO_DOMAIN, SI_ORDER_THIRD, genl_unload, NULL);

View File

@ -134,6 +134,6 @@ rtnl_unload(void *u __unused)
rtnl_neighs_destroy();
/* Wait till all consumers read nlbridge data */
epoch_wait_preempt(net_epoch_preempt);
NET_EPOCH_WAIT();
}
SYSUNINIT(rtnl_unload, SI_SUB_PROTO_DOMAIN, SI_ORDER_THIRD, rtnl_unload, NULL);

View File

@ -553,8 +553,7 @@ delete_unhop(struct unhop_ctl *ctl, struct nlmsghdr *hdr, uint32_t uidx)
while (unhop_base != NULL) {
unhop_chain = unhop_base->un_nextchild;
epoch_call(net_epoch_preempt, destroy_unhop_epoch,
&unhop_base->un_epoch_ctx);
NET_EPOCH_CALL(destroy_unhop_epoch, &unhop_base->un_epoch_ctx);
unhop_base = unhop_chain;
}
@ -632,7 +631,7 @@ vnet_destroy_unhops(const void *unused __unused)
V_un_ctl = NULL;
/* Wait till all unhop users finish their reads */
epoch_wait_preempt(net_epoch_preempt);
NET_EPOCH_WAIT();
UN_WLOCK(ctl);
CHT_SLIST_FOREACH_SAFE(&ctl->un_head, unhop, unhop, tmp) {