-/* $OpenBSD: if.c,v 1.697 2023/05/16 14:32:54 jan Exp $ */
+/* $OpenBSD: if.c,v 1.698 2023/05/30 23:55:42 dlg Exp $ */
/* $NetBSD: if.c,v 1.35 1996/05/07 05:26:04 thorpej Exp $ */
/*
return (sn->sn_taskq);
}
+
+void
+net_tq_barriers(const char *wmesg)
+{
+ struct task barriers[NET_TASKQ];
+ struct refcnt r = REFCNT_INITIALIZER();
+ int i;
+
+ for (i = 0; i < nitems(barriers); i++) {
+ task_set(&barriers[i], (void (*)(void *))refcnt_rele_wake, &r);
+ refcnt_take(&r);
+ task_add(softnets[i].sn_taskq, &barriers[i]);
+ }
+
+ refcnt_finalize(&r, wmesg);
+}
-/* $OpenBSD: if.h,v 1.213 2023/05/16 14:32:54 jan Exp $ */
+/* $OpenBSD: if.h,v 1.214 2023/05/30 23:55:42 dlg Exp $ */
/* $NetBSD: if.h,v 1.23 1996/05/07 02:40:27 thorpej Exp $ */
/*
__dead void unhandled_af(int);
int if_setlladdr(struct ifnet *, const uint8_t *);
struct taskq * net_tq(unsigned int);
+void net_tq_barriers(const char *);
#endif /* _KERNEL */