Constant renamed to be consistent with kernel WG
This commit is contained in:
@@ -1,9 +1,9 @@
|
||||
// WireGuard semantics constants
|
||||
|
||||
pub const MAX_STAGED_PACKETS: usize = 128;
|
||||
pub const MAX_QUEUED_PACKETS: usize = 1024;
|
||||
|
||||
// performance constants
|
||||
|
||||
pub const PARALLEL_QUEUE_SIZE: usize = 256;
|
||||
pub const INORDER_QUEUE_SIZE: usize = PARALLEL_QUEUE_SIZE;
|
||||
pub const PARALLEL_QUEUE_SIZE: usize = MAX_QUEUED_PACKETS;
|
||||
pub const INORDER_QUEUE_SIZE: usize = MAX_QUEUED_PACKETS;
|
||||
pub const MAX_INORDER_CONSUME: usize = INORDER_QUEUE_SIZE;
|
||||
|
||||
@@ -12,6 +12,7 @@ use zerocopy::LayoutVerified;
|
||||
use super::anti_replay::AntiReplay;
|
||||
use super::pool::Job;
|
||||
|
||||
use super::constants::PARALLEL_QUEUE_SIZE;
|
||||
use super::inbound;
|
||||
use super::outbound;
|
||||
|
||||
@@ -125,8 +126,8 @@ impl<E: Endpoint, C: Callbacks, T: tun::Writer, B: udp::Writer<E>> Drop
|
||||
impl<E: Endpoint, C: Callbacks, T: tun::Writer, B: udp::Writer<E>> DeviceHandle<E, C, T, B> {
|
||||
pub fn new(num_workers: usize, tun: T) -> DeviceHandle<E, C, T, B> {
|
||||
// allocate shared device state
|
||||
let (queue_outbound, mut outrx) = ParallelQueue::new(num_workers, 128);
|
||||
let (queue_inbound, mut inrx) = ParallelQueue::new(num_workers, 128);
|
||||
let (queue_outbound, mut outrx) = ParallelQueue::new(num_workers, PARALLEL_QUEUE_SIZE);
|
||||
let (queue_inbound, mut inrx) = ParallelQueue::new(num_workers, PARALLEL_QUEUE_SIZE);
|
||||
let device = Device {
|
||||
inner: Arc::new(DeviceInner {
|
||||
inbound: tun,
|
||||
|
||||
@@ -39,7 +39,7 @@ pub struct PeerInner<E: Endpoint, C: Callbacks, T: tun::Writer, B: udp::Writer<E
|
||||
pub opaque: C::Opaque,
|
||||
pub outbound: InorderQueue<Peer<E, C, T, B>, Outbound>,
|
||||
pub inbound: InorderQueue<Peer<E, C, T, B>, Inbound<E, C, T, B>>,
|
||||
pub staged_packets: Mutex<ArrayDeque<[Vec<u8>; MAX_STAGED_PACKETS], Wrapping>>,
|
||||
pub staged_packets: Mutex<ArrayDeque<[Vec<u8>; MAX_QUEUED_PACKETS], Wrapping>>,
|
||||
pub keys: Mutex<KeyWheel>,
|
||||
pub ekey: Mutex<Option<EncryptionState>>,
|
||||
pub endpoint: Mutex<Option<E>>,
|
||||
|
||||
Reference in New Issue
Block a user