From: Stefan Fritsch Subject: Re: vio: Enable multiqueue To: David Gwynne Cc: tech@openbsd.org Date: Tue, 28 Jan 2025 20:57:56 +0100 Am 28.01.25 um 00:32 schrieb David Gwynne: >>>> Doesn't does gratuitously reorder forwarded packets? >>> >>> it does allow packets in "conversations" to be reordered, yes. >>> >>> there's no guarantee that packets within a conversation are always >>> processed on a specific cpu, which is what allows packets to be >>> reordered. this is true for both softnet threads when forwarding, >>> and userland programs producing packets. >>> >>> fwiw, flowids are not defined to be a toeplitz hash, they're best >>> effort set to something that hopes to spread packets out over things >>> like softnet threads, ports in lacp aggregations, and tx queues on >>> network cards. we try and make things that can do teoplitz use toeplitz, >>> but if that's not available then whatever is handy is still better than >>> nothing. >>> >>> in this situation id have vio set the flowid to the rx queue id. >> >> The diff below does that. Do we expect any disadvantage if we set this >> simplistic flowid and pf will then not set the "properly" calculated one? > > i do basically the same thing in other places and it's fine. your diff > below is ok by me. if we make something better you can change it. committed, thanks. > >> Each of the diff below and Chris Cappuccio's ifq_pkt_hash() diff speed up >> udp forwarding without pf to 2-3 times single queue performance. But the >> variation is rather high, so I cannot determine if one diff is better. For >> udp with pf and for tcp forwarding, I cannot see a difference either. > > what do you mean by "the variation is rather high" and "I cannot > see a difference"? Benchmark results vary quite a bit from run to run, maybe by 20%. So any smaller difference is lost in the noise.