OpenBSD Journal

Incoming: UDP parallel input

Contributed by Peter N. M. Hansteen on from the faster packets, more dept.

UDP input is about to become faster and parallel on OpenBSD. In a message to tech@ titled UDP parallel input, Alexander Bluhm (bluhm@) offers a diff that enables parallel UDP input for -current.

The message reads,

List:       openbsd-tech
Subject:    UDP parallel input
From:       Alexander Bluhm <bluhm () openbsd ! org>
Date:       2024-07-23 13:40:21

Hi,

mvs@ has completed the final bits to make socket buffer MP safe for
UDP packets.  This means that we can run UDP input on multiple
threads.  Diff below activates this.
Usually IP processing runs on multiple softnet threads with shared
net lock.  From there local packets are queued and processed by one
thread with exclusive net lock.  If the PR_MPINPUT flag is set,
protocol input is called directly from IP input on multiple threads,
shared net lock and no additional queueing.

Note that you need kernel sources from at least Sun Jul 21.  Then
apply this diff and test UDP local delivery to sockets.  To see an
performance effect, you need multiple CPUs and network interfaces
that support multiqueue.  These are bnxt, igc, ix, ixl, ngbe, vmx.

Please test!

bluhm

followed by the rather short diff that enables the code.

This is (yet another) opportunity to test and help improve the upcoming release if you feel up to it.

Update 2024-07-26: The code has now been committed.

(Comments are closed)


Comments
  1. By John McCue (jmcunx) jmcq66@comcast.net on

    I have no idea what UDP is, so instead of searching the WEB I decided to try "man udp".

    Up pops a manual, nice and unexpected. So I have a bit of an idea on what it is without doing a painful WEB search.

    Very nice!

Credits

Copyright © - Daniel Hartmeier. All rights reserved. Articles and comments are copyright their respective authors, submission implies license to publish on this web site. Contents of the archive prior to as well as images and HTML templates were copied from the fabulous original deadly.org with Jose's and Jim's kind permission. This journal runs as CGI with httpd(8) on OpenBSD, the source code is BSD licensed. undeadly \Un*dead"ly\, a. Not subject to death; immortal. [Obs.]