diff options
author | Jonathan Neuschäfer <j.neuschaefer@gmx.net> | 2018-07-01 05:28:37 +0200 |
---|---|---|
committer | Thomas Gschwantner <tharre3@gmail.com> | 2018-07-01 05:28:37 +0200 |
commit | f55eb4ec4151b5b94fac3a1eb756250231db6aed (patch) | |
tree | b3cadb28a397903eb06546b123a8477483082e99 /src/device.h | |
parent | version: bump snapshot (diff) | |
download | wireguard-monolithic-historical-f55eb4ec4151b5b94fac3a1eb756250231db6aed.tar.xz wireguard-monolithic-historical-f55eb4ec4151b5b94fac3a1eb756250231db6aed.zip |
[WIP] implement a lock-free MPMC ring buffer
TODO: actually use the right memory barriers in the right places
TODO: eliminate false sharing between mpmc_ptr_ring members
TODO: reconsider atomic_long_t vs. atomic_t, vs. the type of size in _init()
TODO: sprinkle likely/unlikely on some branches
FIXME: it still crashes
Signed-off-by: Jonathan Neuschäfer <j.neuschaefer@gmx.net>
Diffstat (limited to 'src/device.h')
-rw-r--r-- | src/device.h | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/device.h b/src/device.h index 2a0e2c7..e2fd205 100644 --- a/src/device.h +++ b/src/device.h @@ -10,13 +10,13 @@ #include "allowedips.h" #include "hashtables.h" #include "cookie.h" +#include "mpmc_ptr_ring.h" #include <linux/types.h> #include <linux/netdevice.h> #include <linux/workqueue.h> #include <linux/mutex.h> #include <linux/net.h> -#include <linux/ptr_ring.h> struct wireguard_device; @@ -26,7 +26,7 @@ struct multicore_worker { }; struct crypt_queue { - struct ptr_ring ring; + struct mpmc_ptr_ring ring; union { struct { struct multicore_worker __percpu *worker; |