From: Vitaliy Makkoveev Subject: Re: softnet 8 threads To: Alexander Bluhm Cc: tech@openbsd.org Date: Fri, 18 Jul 2025 02:08:47 +0300 On Fri, Jul 18, 2025 at 12:40:02AM +0200, Alexander Bluhm wrote: > Hi, > > After unlocking the hot path of the network stack, I would like to > increase the number of softnet threads. I think 8 insted of 4 would > be a good number. Note that it is capped by number of CPU. > > On a 12 core machine, I receive 30 TCP streams from two Linux > machines. With 4 softnet threads I see 40 GBit/sec combined, and > 8 threads increase it to 50 Gbit/sec. > > ok? > Makes sense. > bluhm > > Index: net/if.c > =================================================================== > RCS file: /data/mirror/openbsd/cvs/src/sys/net/if.c,v > diff -u -p -r1.737 if.c > --- net/if.c 7 Jul 2025 02:28:50 -0000 1.737 > +++ net/if.c 17 Jul 2025 09:42:50 -0000 > @@ -239,7 +239,7 @@ struct softnet { > struct taskq *sn_taskq; > struct netstack sn_netstack; > } __aligned(64); > -#define NET_TASKQ 4 > +#define NET_TASKQ 8 > struct softnet softnets[NET_TASKQ]; > > struct task if_input_task_locked = TASK_INITIALIZER(if_netisr, NULL); >