UPSTREAM: wireguard: queueing: use saner cpu selection wrapping
Using `% nr_cpumask_bits` is slow and complicated, and not totally robust toward dynamic changes to CPU topologies. Rather than storing the next CPU in the round-robin, just store the last one, and also return that value. This simplifies the loop drastically into a much more common pattern. Bug: 254441685 Fixes: e7096c13 ("net: WireGuard secure network tunnel") Cc: stable@vger.kernel.org Reported-by:Linus Torvalds <torvalds@linux-foundation.org> Tested-by:
Manuel Leiner <manuel.leiner@gmx.de> Signed-off-by:
Jason A. Donenfeld <Jason@zx2c4.com> Signed-off-by:
David S. Miller <davem@davemloft.net> (cherry picked from commit 7387943f) Signed-off-by:
Lee Jones <joneslee@google.com> Change-Id: I7374d5e28bfae6e0d581a3e29acb3dd12ea44b32
Loading
Please sign in to comment