diff options
author | Jason A. Donenfeld <Jason@zx2c4.com> | 2019-07-02 14:15:35 +0200 |
---|---|---|
committer | Jason A. Donenfeld <Jason@zx2c4.com> | 2019-07-02 14:15:46 +0200 |
commit | bc7840be16f7e4e116cada45b7ce8a2477e6b571 (patch) | |
tree | 8e7f2f74983d6dfe9fc9e83110d287021253deb9 | |
parent | f64cd4fd2935d0e71c549199937c3dd2abd6cb0f (diff) |
receive: queue dead packets to napi queue instead of empty rx_queue
Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
-rw-r--r-- | src/queueing.h | 3 | ||||
-rw-r--r-- | src/receive.c | 5 |
2 files changed, 3 insertions, 5 deletions
diff --git a/src/queueing.h b/src/queueing.h index f8de703..e49a464 100644 --- a/src/queueing.h +++ b/src/queueing.h @@ -177,8 +177,7 @@ static inline void wg_queue_enqueue_per_peer(struct crypt_queue *queue, wg_peer_put(peer); } -static inline void wg_queue_enqueue_per_peer_napi(struct crypt_queue *queue, - struct sk_buff *skb, +static inline void wg_queue_enqueue_per_peer_napi(struct sk_buff *skb, enum packet_state state) { /* We take a reference, because as soon as we call atomic_set, the diff --git a/src/receive.c b/src/receive.c index 6a3980b..247a56b 100644 --- a/src/receive.c +++ b/src/receive.c @@ -521,8 +521,7 @@ void wg_packet_decrypt_worker(struct work_struct *work) &PACKET_CB(skb)->keypair->receiving, &simd_context)) ? PACKET_STATE_CRYPTED : PACKET_STATE_DEAD; - wg_queue_enqueue_per_peer_napi(&PACKET_PEER(skb)->rx_queue, skb, - state); + wg_queue_enqueue_per_peer_napi(skb, state); simd_relax(&simd_context); } @@ -551,7 +550,7 @@ static void wg_packet_consume_data(struct wg_device *wg, struct sk_buff *skb) wg->packet_crypt_wq, &wg->decrypt_queue.last_cpu); if (unlikely(ret == -EPIPE)) - wg_queue_enqueue_per_peer(&peer->rx_queue, skb, PACKET_STATE_DEAD); + wg_queue_enqueue_per_peer_napi(skb, PACKET_STATE_DEAD); if (likely(!ret || ret == -EPIPE)) { rcu_read_unlock_bh(); return; |