DPDK patches and discussions
 help / color / mirror / Atom feed
From: Yuval Avnery <yuvalav@mellanox.com>
To: Yuval Avnery <yuvalav@mellanox.com>, Ori Kam <orika@mellanox.com>
Cc: Thomas Monjalon <thomas@monjalon.net>, "dev@dpdk.org" <dev@dpdk.org>
Subject: Re: [dpdk-dev] [PATCH v1] regex/mlx5: fix sq free check on enqueue
Date: Wed, 29 Jul 2020 00:42:25 +0000	[thread overview]
Message-ID: <AM0PR05MB43079127207CFBA9184D7A35C5700@AM0PR05MB4307.eurprd05.prod.outlook.com> (raw)
In-Reply-To: <1595958899-67264-1-git-send-email-yuvalav@mellanox.com>

There is a bug here, will send another version

> -----Original Message-----
> From: Yuval Avnery <yuvalav@mellanox.com>
> Sent: Tuesday, July 28, 2020 10:55 AM
> To: Ori Kam <orika@mellanox.com>
> Cc: Thomas Monjalon <thomas@monjalon.net>; dev@dpdk.org; Yuval
> Avnery <yuvalav@mellanox.com>
> Subject: [PATCH v1] regex/mlx5: fix sq free check on enqueue
> 
> 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..8dfa72c 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 ((sq->ci - sq->pi) & (sq_size_get(sq) - 1)) != 1;
>  }
> 
>  static inline uint32_t
> --
> 1.8.3.1


      reply	other threads:[~2020-07-29  0:42 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-07-28 17:54 Yuval Avnery
2020-07-29  0:42 ` Yuval Avnery [this message]

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=AM0PR05MB43079127207CFBA9184D7A35C5700@AM0PR05MB4307.eurprd05.prod.outlook.com \
    --to=yuvalav@mellanox.com \
    --cc=dev@dpdk.org \
    --cc=orika@mellanox.com \
    --cc=thomas@monjalon.net \
    /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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).