From: HongBo Zheng <[email protected]>

In virtio_crypto_pkt_tx_burst, we check the return values of
virtqueue_crypto_enqueue_xmit, which may returns -ENOSPC/-EMSGSIZE,
but we only check ENOSPC/EMSGSIZE, and cause the result of checks
is always false.

This patch fix this problem.

Fixes: 82adb12a1fce ("crypto/virtio: support burst enqueue/dequeue")
Cc: [email protected]

Signed-off-by: HongBo Zheng <[email protected]>
Signed-off-by: Min Hu (Connor) <[email protected]>
---
 drivers/crypto/virtio/virtio_rxtx.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/crypto/virtio/virtio_rxtx.c 
b/drivers/crypto/virtio/virtio_rxtx.c
index e1cb4ad..a35a5b0 100644
--- a/drivers/crypto/virtio/virtio_rxtx.c
+++ b/drivers/crypto/virtio/virtio_rxtx.c
@@ -500,10 +500,10 @@ virtio_crypto_pkt_tx_burst(void *tx_queue, struct 
rte_crypto_op **tx_pkts,
                /* Enqueue Packet buffers */
                error = virtqueue_crypto_enqueue_xmit(txvq, tx_pkts[nb_tx]);
                if (unlikely(error)) {
-                       if (error == ENOSPC)
+                       if (error == -ENOSPC)
                                VIRTIO_CRYPTO_TX_LOG_ERR(
                                        "virtqueue_enqueue Free count = 0");
-                       else if (error == EMSGSIZE)
+                       else if (error == -EMSGSIZE)
                                VIRTIO_CRYPTO_TX_LOG_ERR(
                                        "virtqueue_enqueue Free count < 1");
                        else
-- 
2.7.4

Reply via email to