Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/sys/net/npf npf(9): Use __HAVE_ATOMIC_AS_MEMBAR around refcn...



details:   https://anonhg.NetBSD.org/src/rev/97e5c73e2f0c
branches:  trunk
changeset: 373165:97e5c73e2f0c
user:      riastradh <riastradh%NetBSD.org@localhost>
date:      Sun Jan 22 18:39:22 2023 +0000

description:
npf(9): Use __HAVE_ATOMIC_AS_MEMBAR around refcnt consistently.

diffstat:

 sys/net/npf/npf_tableset.c |  6 +++++-
 1 files changed, 5 insertions(+), 1 deletions(-)

diffs (27 lines):

diff -r f051d5115340 -r 97e5c73e2f0c sys/net/npf/npf_tableset.c
--- a/sys/net/npf/npf_tableset.c        Sun Jan 22 17:19:11 2023 +0000
+++ b/sys/net/npf/npf_tableset.c        Sun Jan 22 18:39:22 2023 +0000
@@ -46,7 +46,7 @@
 
 #ifdef _KERNEL
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: npf_tableset.c,v 1.38 2022/04/09 23:38:33 riastradh Exp $");
+__KERNEL_RCSID(0, "$NetBSD: npf_tableset.c,v 1.39 2023/01/22 18:39:22 riastradh Exp $");
 
 #include <sys/param.h>
 #include <sys/types.h>
@@ -160,10 +160,14 @@
 
                if (t == NULL)
                        continue;
+#ifndef __HAVE_ATOMIC_AS_MEMBAR
                membar_release();
+#endif
                if (atomic_dec_uint_nv(&t->t_refcnt) > 0)
                        continue;
+#ifndef __HAVE_ATOMIC_AS_MEMBAR
                membar_acquire();
+#endif
                npf_table_destroy(t);
        }
        kmem_free(ts, NPF_TABLESET_SIZE(ts->ts_nitems));



Home | Main Index | Thread Index | Old Index