-/* $OpenBSD: if.c,v 1.642 2021/06/30 13:23:33 bluhm Exp $ */
+/* $OpenBSD: if.c,v 1.643 2021/07/20 16:32:28 bluhm Exp $ */
/* $NetBSD: if.c,v 1.35 1996/05/07 05:26:04 thorpej Exp $ */
/*
* to PF globals, pipex globals, unicast and multicast addresses
* lists and the socket layer.
*/
+
+ /*
+ * XXXSMP IPsec data structures are not ready to be accessed
+ * by multiple network threads in parallel. In this case
+ * use an exclusive lock.
+ */
NET_LOCK();
while ((m = ml_dequeue(ml)) != NULL)
(*ifp->if_input)(ifp, m);
panic("unhandled af %d", af);
}
-/*
- * XXXSMP This tunable is here to work around the fact that IPsec
- * globals aren't ready to be accessed by multiple threads in
- * parallel.
- */
-int nettaskqs = NET_TASKQ;
-
struct taskq *
net_tq(unsigned int ifindex)
{
struct taskq *t = NULL;
+ static int nettaskqs;
+
+ if (nettaskqs == 0)
+ nettaskqs = min(NET_TASKQ, ncpus);
t = nettqmp[ifindex % nettaskqs];
-/* $OpenBSD: pfkeyv2.c,v 1.218 2021/07/14 22:39:26 tobhe Exp $ */
+/* $OpenBSD: pfkeyv2.c,v 1.219 2021/07/20 16:32:28 bluhm Exp $ */
/*
* @(#)COPYRIGHT 1.1 (NRL) 17 January 1995
}
TAILQ_INSERT_HEAD(&ipsec_policy_head, ipo, ipo_list);
ipsec_in_use++;
- /*
- * XXXSMP IPsec data structures are not ready to be
- * accessed by multiple Network threads in parallel,
- * so force all packets to be processed by the first
- * one.
- */
- extern int nettaskqs;
- nettaskqs = 1;
} else {
ipo->ipo_last_searched = ipo->ipo_flags = 0;
}