All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Min Hu (Connor)" <humin29@huawei.com>
To: <dev@dpdk.org>
Cc: <ferruh.yigit@intel.com>, <cristian.dumitrescu@intel.com>,
	<jerinj@marvell.com>, <jianjay.zhou@huawei.com>,
	<jia.guo@intel.com>, <g.singh@nxp.com>,
	<andrew.rybchenko@oktetlabs.ru>, <hemant.agrawal@nxp.com>,
	 <orika@nvidia.com>
Subject: [dpdk-dev] [PATCH 08/10] crypto/virtio: fix return values check error
Date: Mon, 19 Apr 2021 21:34:47 +0800	[thread overview]
Message-ID: <1618839289-33224-9-git-send-email-humin29@huawei.com> (raw)
In-Reply-To: <1618839289-33224-1-git-send-email-humin29@huawei.com>

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(-)

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


  parent reply	other threads:[~2021-04-19 13:35 UTC|newest]

Thread overview: 24+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-04-19 13:34 [dpdk-dev] [PATCH 00/10] fixes for clean code Min Hu (Connor)
2021-04-19 13:34 ` [dpdk-dev] [PATCH 01/10] net/pfe: check return value Min Hu (Connor)
2023-06-30 17:59   ` Stephen Hemminger
2021-04-19 13:34 ` [dpdk-dev] [PATCH 02/10] common/sfc_efx/base: delete redundant handling Min Hu (Connor)
2021-04-20  9:33   ` Andrew Rybchenko
2021-04-20  9:42     ` Min Hu (Connor)
2021-04-19 13:34 ` [dpdk-dev] [PATCH 03/10] bus/dpaa: fix management command init calling Min Hu (Connor)
2021-04-20  9:35   ` Andrew Rybchenko
2021-04-20  9:54     ` Min Hu (Connor)
2021-04-19 13:34 ` [dpdk-dev] [PATCH 04/10] app/regex: fix division by zero Min Hu (Connor)
2021-04-19 17:48   ` Ori Kam
2021-04-19 13:34 ` [dpdk-dev] [PATCH 05/10] app/test: add null pointer check of memory allocation Min Hu (Connor)
2022-06-26 17:48   ` Thomas Monjalon
2021-04-19 13:34 ` [dpdk-dev] [PATCH 06/10] lib/librte_pipeline: fix the use of unsafe strcpy Min Hu (Connor)
2021-04-20  9:36   ` Andrew Rybchenko
2023-06-30 18:08   ` Stephen Hemminger
2023-07-03 10:57     ` Dumitrescu, Cristian
2021-04-19 13:34 ` [dpdk-dev] [PATCH 07/10] examples/l3fwd: add function return value check Min Hu (Connor)
2023-06-30 18:15   ` Stephen Hemminger
2021-04-19 13:34 ` Min Hu (Connor) [this message]
2023-06-30 18:14   ` [dpdk-dev] [PATCH 08/10] crypto/virtio: fix return values check error Stephen Hemminger
2021-04-19 13:34 ` [dpdk-dev] [PATCH 09/10] net/e1000: add function return value check Min Hu (Connor)
2021-04-19 13:34 ` [dpdk-dev] [PATCH 10/10] net/bonding: fix configuration assignment overflow Min Hu (Connor)
2023-06-30 18:02   ` Stephen Hemminger

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1618839289-33224-9-git-send-email-humin29@huawei.com \
    --to=humin29@huawei.com \
    --cc=andrew.rybchenko@oktetlabs.ru \
    --cc=cristian.dumitrescu@intel.com \
    --cc=dev@dpdk.org \
    --cc=ferruh.yigit@intel.com \
    --cc=g.singh@nxp.com \
    --cc=hemant.agrawal@nxp.com \
    --cc=jerinj@marvell.com \
    --cc=jia.guo@intel.com \
    --cc=jianjay.zhou@huawei.com \
    --cc=orika@nvidia.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.