aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/src/queueing.c
diff options
context:
space:
mode:
authorTharre <tharre3@gmail.com>2018-05-26 19:29:24 +0200
committerJason A. Donenfeld <Jason@zx2c4.com>2018-06-04 20:30:02 +0200
commit264292f6f0d0a3360a758b616b81253a97f0a396 (patch)
tree429827e38da16271909e47897985e0dfbb8fc842 /src/queueing.c
parentWIP (diff)
downloadwireguard-monolithic-historical-264292f6f0d0a3360a758b616b81253a97f0a396.tar.xz
wireguard-monolithic-historical-264292f6f0d0a3360a758b616b81253a97f0a396.zip
WIP2
Diffstat (limited to 'src/queueing.c')
-rw-r--r--src/queueing.c17
1 files changed, 11 insertions, 6 deletions
diff --git a/src/queueing.c b/src/queueing.c
index 85dea6b..4c9ae53 100644
--- a/src/queueing.c
+++ b/src/queueing.c
@@ -22,12 +22,13 @@ struct multicore_worker __percpu *packet_alloc_percpu_multicore_worker(work_func
int packet_queue_init(struct crypt_queue *queue, work_func_t function, bool multicore, unsigned int len)
{
- int ret;
+ /*int ret;*/
memset(queue, 0, sizeof(*queue));
- ret = ptr_ring_init(&queue->ring, len, GFP_KERNEL);
- if (ret)
- return ret;
+ /*ret = ptr_ring_init(&queue->ring, len, GFP_KERNEL);*/
+ /*if (ret)*/
+ /*return ret;*/
+ ck_ring_init(&queue->ring, len);
if (multicore) {
queue->worker = packet_alloc_percpu_multicore_worker(function, queue);
if (!queue->worker)
@@ -41,6 +42,10 @@ void packet_queue_free(struct crypt_queue *queue, bool multicore)
{
if (multicore)
free_percpu(queue->worker);
- WARN_ON(!ptr_ring_empty_bh(&queue->ring));
- ptr_ring_cleanup(&queue->ring, NULL);
+
+ /* TODO: from the ck docs: It is possible for the function to return
+ * false even if ring is non-empty. See also
+ * http://concurrencykit.org/doc/ck_ring_trydequeue_spmc.html */
+ /*WARN_ON(!ptr_ring_empty_bh(&queue->ring));*/
+ /*ptr_ring_cleanup(&queue->ring, NULL);*/
}