aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/src/queueing.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/queueing.h')
-rw-r--r--src/queueing.h14
1 files changed, 12 insertions, 2 deletions
diff --git a/src/queueing.h b/src/queueing.h
index 0057cfa..c17b0d8 100644
--- a/src/queueing.h
+++ b/src/queueing.h
@@ -26,8 +26,9 @@ struct multicore_worker __percpu *packet_alloc_percpu_multicore_worker(work_func
/* receive.c APIs: */
void packet_receive(struct wireguard_device *wg, struct sk_buff *skb);
void packet_handshake_receive_worker(struct work_struct *work);
-/* Workqueue workers: */
-void packet_rx_worker(struct work_struct *work);
+/* NAPI poll function: */
+int packet_rx_poll(struct napi_struct *napi, int budget);
+/* Workqueue worker: */
void packet_decrypt_worker(struct work_struct *work);
/* send.c APIs: */
@@ -138,6 +139,15 @@ static inline void queue_enqueue_per_peer(struct crypt_queue *queue, struct sk_b
peer_put(peer);
}
+static inline void queue_enqueue_per_peer_napi(struct crypt_queue *queue, struct sk_buff *skb, enum packet_state state)
+{
+ struct wireguard_peer *peer = peer_rcu_get(PACKET_PEER(skb));
+
+ atomic_set(&PACKET_CB(skb)->state, state);
+ napi_schedule(&peer->napi);
+ peer_put(peer);
+}
+
#ifdef DEBUG
bool packet_counter_selftest(void);
#endif