Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 20 Mar 2019 10:06:44 +0000 (UTC)
From:      "Andrey V. Elsukov" <ae@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r345319 - head/sys/netpfil/ipfw/nat64
Message-ID:  <201903201006.x2KA6isJ083118@repo.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: ae
Date: Wed Mar 20 10:06:44 2019
New Revision: 345319
URL: https://svnweb.freebsd.org/changeset/base/345319

Log:
  Use NET_EPOCH instead of allocating separate one.
  
  MFC after:	1 month

Modified:
  head/sys/netpfil/ipfw/nat64/nat64lsn.c

Modified: head/sys/netpfil/ipfw/nat64/nat64lsn.c
==============================================================================
--- head/sys/netpfil/ipfw/nat64/nat64lsn.c	Wed Mar 20 07:40:38 2019	(r345318)
+++ head/sys/netpfil/ipfw/nat64/nat64lsn.c	Wed Mar 20 10:06:44 2019	(r345319)
@@ -72,12 +72,10 @@ __FBSDID("$FreeBSD$");
 
 MALLOC_DEFINE(M_NAT64LSN, "NAT64LSN", "NAT64LSN");
 
-static epoch_t nat64lsn_epoch;
-#define	NAT64LSN_EPOCH_ENTER(et)  epoch_enter_preempt(nat64lsn_epoch, &(et))
-#define	NAT64LSN_EPOCH_EXIT(et)   epoch_exit_preempt(nat64lsn_epoch, &(et))
-#define	NAT64LSN_EPOCH_WAIT()     epoch_wait_preempt(nat64lsn_epoch)
-#define	NAT64LSN_EPOCH_ASSERT()   MPASS(in_epoch(nat64lsn_epoch))
-#define	NAT64LSN_EPOCH_CALL(c, f) epoch_call(nat64lsn_epoch, (c), (f))
+#define	NAT64LSN_EPOCH_ENTER(et)  NET_EPOCH_ENTER(et)
+#define	NAT64LSN_EPOCH_EXIT(et)   NET_EPOCH_EXIT(et)
+#define	NAT64LSN_EPOCH_ASSERT()   NET_EPOCH_ASSERT()
+#define	NAT64LSN_EPOCH_CALL(c, f) epoch_call(net_epoch_preempt, (c), (f))
 
 static uma_zone_t nat64lsn_host_zone;
 static uma_zone_t nat64lsn_pgchunk_zone;
@@ -1578,8 +1576,6 @@ void
 nat64lsn_init_internal(void)
 {
 
-	nat64lsn_epoch = epoch_alloc(EPOCH_PREEMPT);
-
 	nat64lsn_host_zone = uma_zcreate("NAT64LSN hosts",
 	    sizeof(struct nat64lsn_host), NULL, NULL, NULL, NULL,
 	    UMA_ALIGN_PTR, 0);
@@ -1606,8 +1602,6 @@ nat64lsn_uninit_internal(void)
 {
 
 	/* XXX: epoch_task drain */
-	epoch_free(nat64lsn_epoch);
-
 	JQUEUE_LOCK_DESTROY();
 	uma_zdestroy(nat64lsn_host_zone);
 	uma_zdestroy(nat64lsn_pgchunk_zone);



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201903201006.x2KA6isJ083118>