On 10.11.2017. 1:58, David Gwynne wrote: > this makes ifq_start try to wait for 4 packets before calling > if->if_qstart. > > this is based on work sephe did in dragonflybsd, and described in > a comment in their sys/net/if.c. there's a link to it here: > https://github.com/DragonFlyBSD/DragonFlyBSD/blob/master/sys/net/if.c#L2976-L2987 > > the tests we've done generally show a performance bump, but otherwise > no degradation in performance. > > the mechanism for bundling packets is to but schedule a task to > service the queue later. if 4 packets get accumulated before the > task runs, it's cancelled and the code runs the start routine > directly. > > the most significant difference this implementation has to the dfly > one is that our ifqs dont (currently) track the number of bytes on > the q. dfly sends if it can bundle 4 packets, or up to mtu bytes > worth of packets. this implementation only looks at the number of > packets. > > the taskq the ifq uses is one of the softnets, which is assigned > when the ifq is initted and unconditionally used during the ifq's > lifetime. because ifq work could now be pending in a softnet taskq, > ifq_barrier also needs to put a barrier in the taskq. this is > implemented using taskq_barrier, which i wrote ages ago but didn't > have a use case for at the time. > > tests? ok?
Hi all, i've tested plain ip4 forwarding performance with and without this diff and here are results. 12 x Intel(R) Xeon(R) CPU E5-2620 v2 @ 2.10GHz, 2400.35 MHz ix (82599) - sending 14Mpps plain forwarding - 1.18Mpps patched forwarding - 1.31Mpps myx (8BL2-2S) - sending 14Mpps plain forwarding - 900Kpps patched forwarding - 1.10Mpps em (i350) - sending 1.4Mpps plain forwarding - 1Mpps patched forwarding - 1.17Mpps bge (5720) - sending 1.4Mpps plain forwarding - oscillate from 780Kpps to 940Kpps patched forwarding - oscillate from 850Kpps to 1Mpps on box with 6 x Intel(R) Xeon(R) CPU E5-2643 v2 @ 3.50GHz, 3600.55 MHz and with ix (82599) forwarding performance are the same with or without diff, which is 1.75Mpps will play with this diff over weekend just to see if there will be some ill effect