diff options
author | Tharre <tharre3@gmail.com> | 2018-05-26 19:29:24 +0200 |
---|---|---|
committer | Jason A. Donenfeld <Jason@zx2c4.com> | 2018-06-04 20:30:02 +0200 |
commit | 264292f6f0d0a3360a758b616b81253a97f0a396 (patch) | |
tree | 429827e38da16271909e47897985e0dfbb8fc842 /src/send.c | |
parent | WIP (diff) | |
download | wireguard-monolithic-historical-264292f6f0d0a3360a758b616b81253a97f0a396.tar.xz wireguard-monolithic-historical-264292f6f0d0a3360a758b616b81253a97f0a396.zip |
WIP2
Diffstat (limited to 'src/send.c')
-rw-r--r-- | src/send.c | 8 |
1 files changed, 5 insertions, 3 deletions
@@ -223,9 +223,10 @@ void packet_tx_worker(struct work_struct *work) struct sk_buff *first; enum packet_state state; - spin_lock_bh(&queue->ring.consumer_lock); + /*spin_lock_bh(&queue->ring.consumer_lock);*/ while ((first = __ptr_ring_peek(&queue->ring)) != NULL && (state = atomic_read(&PACKET_CB(first)->state)) != PACKET_STATE_UNCRYPTED) { __ptr_ring_discard_one(&queue->ring); + peer = PACKET_PEER(first); keypair = PACKET_CB(first)->keypair; @@ -237,7 +238,7 @@ void packet_tx_worker(struct work_struct *work) noise_keypair_put(keypair); peer_put(peer); } - spin_unlock_bh(&queue->ring.consumer_lock); + /*spin_unlock_bh(&queue->ring.consumer_lock);*/ } void packet_encrypt_worker(struct work_struct *work) @@ -246,7 +247,8 @@ void packet_encrypt_worker(struct work_struct *work) struct sk_buff *first, *skb, *next; bool have_simd = chacha20poly1305_init_simd(); - while ((first = ptr_ring_consume_bh(&queue->ring)) != NULL) { + /*while ((first = ptr_ring_consume_bh(&queue->ring)) != NULL) {*/ + while ((ck_ring_dequeue_mpmc(&queue->ring, &queue->ring_buffer, &first)) == true) { enum packet_state state = PACKET_STATE_CRYPTED; skb_walk_null_queue_safe(first, skb, next) { |