From: Fan Zhang Date: Wed, 19 Apr 2017 14:47:02 +0000 (+0100) Subject: crypto/scheduler: fix ring dequeue return handling X-Git-Tag: spdx-start~3457 X-Git-Url: http://git.droids-corp.org/?a=commitdiff_plain;h=21d0b0433c955c7e4c54c55ffb81119f1f7c3689;hp=c64457cb11f0df25813983b10c47d80058b9a8ba;p=dpdk.git crypto/scheduler: fix ring dequeue return handling Commit ("ring: return remaining entry count when dequeuing") changed the return of rte_ring_sc_dequeue_bulk. This patch updates the scheduler to comply with this change. Fixes: 8a48e039432b ("crypto/scheduler: optimize crypto op ordering") Signed-off-by: Fan Zhang --- diff --git a/drivers/crypto/scheduler/scheduler_pmd_private.h b/drivers/crypto/scheduler/scheduler_pmd_private.h index 33edd1df8c..421dae3717 100644 --- a/drivers/crypto/scheduler/scheduler_pmd_private.h +++ b/drivers/crypto/scheduler/scheduler_pmd_private.h @@ -132,7 +132,7 @@ scheduler_order_drain(struct rte_ring *order_ring, struct rte_crypto_op *op; uint32_t nb_objs = rte_ring_count(order_ring); uint32_t nb_ops_to_deq = 0; - int status = -1; + uint32_t nb_ops_deqd = 0; if (nb_objs > nb_ops) nb_objs = nb_ops; @@ -145,10 +145,10 @@ scheduler_order_drain(struct rte_ring *order_ring, } if (nb_ops_to_deq) - status = rte_ring_sc_dequeue_bulk(order_ring, (void **)ops, - nb_ops_to_deq, NULL); + nb_ops_deqd = rte_ring_sc_dequeue_bulk(order_ring, + (void **)ops, nb_ops_to_deq, NULL); - return (status == 0) ? nb_ops_to_deq : 0; + return nb_ops_deqd; } /** device specific operations function pointer structure */ extern struct rte_cryptodev_ops *rte_crypto_scheduler_pmd_ops;