DPDK patches and discussions
 help / color / mirror / Atom feed
From: Yuval Avnery <yuvalav@mellanox.com>
To: Ori Kam <orika@mellanox.com>
Cc: thomas@monjalon.net, dev@dpdk.org, yuvalav@mellanox.com
Subject: [dpdk-dev] [PATCH v2] regex/mlx5: fix sq free check on enqueue
Date: Wed, 29 Jul 2020 02:14:51 +0000
Message-ID: <1595988891-151622-1-git-send-email-yuvalav@mellanox.com> (raw)

Free sq check had a bug, causing jobs to overwrite.

Fixes: 8740ba5fe57f ("regex/mlx5: add enqueue implementation")
Signed-off-by: Yuval Avnery <yuvalav@mellanox.com>
Acked-by: Ori Kam <orika@mellanox.com>
 drivers/regex/mlx5/mlx5_regex_fastpath.c | 5 +----
 1 file changed, 1 insertion(+), 4 deletions(-)

diff --git a/drivers/regex/mlx5/mlx5_regex_fastpath.c b/drivers/regex/mlx5/mlx5_regex_fastpath.c
index fc5a7fc..4385d85 100644
--- a/drivers/regex/mlx5/mlx5_regex_fastpath.c
+++ b/drivers/regex/mlx5/mlx5_regex_fastpath.c
@@ -152,10 +152,7 @@ struct mlx5_regex_job {
 static inline int
 can_send(struct mlx5_regex_sq *sq) {
-	return unlikely(sq->ci > sq->pi) ?
-			MLX5_REGEX_MAX_WQE_INDEX + sq->pi - sq->ci <
-			sq_size_get(sq) :
-			sq->pi - sq->ci < sq_size_get(sq);
+	return ((uint16_t)(sq->pi - sq->ci) < sq_size_get(sq));
 static inline uint32_t

             reply	other threads:[~2020-07-29  2:15 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-07-29  2:14 Yuval Avnery [this message]
2020-07-29 14:51 ` Thomas Monjalon

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:

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

  git send-email \
    --in-reply-to=1595988891-151622-1-git-send-email-yuvalav@mellanox.com \
    --to=yuvalav@mellanox.com \
    --cc=dev@dpdk.org \
    --cc=orika@mellanox.com \
    --cc=thomas@monjalon.net \


* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link

DPDK patches and discussions

This inbox may be cloned and mirrored by anyone:

	git clone --mirror https://inbox.dpdk.org/dev/0 dev/git/0.git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V2 dev dev/ https://inbox.dpdk.org/dev \
	public-inbox-index dev

Example config snippet for mirrors.
Newsgroup available over NNTP:

AGPL code for this site: git clone https://public-inbox.org/public-inbox.git