Module Name: src Committed By: riastradh Date: Sun Jan 22 18:39:22 UTC 2023
Modified Files: src/sys/net/npf: npf_tableset.c Log Message: npf(9): Use __HAVE_ATOMIC_AS_MEMBAR around refcnt consistently. To generate a diff of this commit: cvs rdiff -u -r1.38 -r1.39 src/sys/net/npf/npf_tableset.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.
Modified files: Index: src/sys/net/npf/npf_tableset.c diff -u src/sys/net/npf/npf_tableset.c:1.38 src/sys/net/npf/npf_tableset.c:1.39 --- src/sys/net/npf/npf_tableset.c:1.38 Sat Apr 9 23:38:33 2022 +++ src/sys/net/npf/npf_tableset.c Sun Jan 22 18:39:22 2023 @@ -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 @@ npf_tableset_destroy(npf_tableset_t *ts) 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));