[08/10] crypto/virtio: fix return values check error
Checks
Commit Message
From: HongBo Zheng <zhenghongbo3@huawei.com>
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: stable@dpdk.org
Signed-off-by: HongBo Zheng <zhenghongbo3@huawei.com>
Signed-off-by: Min Hu (Connor) <humin29@huawei.com>
---
drivers/crypto/virtio/virtio_rxtx.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
Comments
On Mon, 19 Apr 2021 21:34:47 +0800
"Min Hu (Connor)" <humin29@huawei.com> wrote:
> From: HongBo Zheng <zhenghongbo3@huawei.com>
>
> 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: stable@dpdk.org
>
> Signed-off-by: HongBo Zheng <zhenghongbo3@huawei.com>
> Signed-off-by: Min Hu (Connor) <humin29@huawei.com>
This patch looks correct.
Acked-by: Stephen Hemminger <stephen@networkplumber.org>
@@ -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