DPDK patches and discussions
 help / color / mirror / Atom feed
From: Slava Ovsiienko <viacheslavo@mellanox.com>
To: Matan Azrad <matan@mellanox.com>, "dev@dpdk.org" <dev@dpdk.org>
Cc: Thomas Monjalon <thomas@monjalon.net>,
	Maxime Coquelin <maxime.coquelin@redhat.com>
Subject: Re: [dpdk-dev] [PATCH] vdpa/mlx5: fix event setup
Date: Tue, 25 Feb 2020 09:46:26 +0000	[thread overview]
Message-ID: <AM4PR05MB3265119EA52CF1E8DC2952DDD2ED0@AM4PR05MB3265.eurprd05.prod.outlook.com> (raw)
In-Reply-To: <1582620228-25629-1-git-send-email-matan@mellanox.com>

> -----Original Message-----
> From: Matan Azrad <matan@mellanox.com>
> Sent: Tuesday, February 25, 2020 10:44
> To: dev@dpdk.org
> Cc: Slava Ovsiienko <viacheslavo@mellanox.com>; Thomas Monjalon
> <thomas@monjalon.net>; Maxime Coquelin <maxime.coquelin@redhat.com>
> Subject: [PATCH] vdpa/mlx5: fix event setup
> 
> The completion event mechanism should work only if at least one of the
> virtqs has valid callfd to be notified on.
> 
> When all the virtqs works with poll mode, the event mechanism should not
> be configured.
> 
> The driver didn't take it into account and crashed in the above case.
> 
> Do not configure event interrupt when all the virtqs are in poll mode.
> 
> Fixes: 8395927cdfaf ("vdpa/mlx5: prepare HW queues")
> 
> Signed-off-by: Matan Azrad <matan@mellanox.com>
Acked-by: Viacheslav Ovsiienko <viacheslavo@mellanox.com>


> ---
>  drivers/vdpa/mlx5/mlx5_vdpa_event.c | 10 ++++++++--
>  1 file changed, 8 insertions(+), 2 deletions(-)
> 
> diff --git a/drivers/vdpa/mlx5/mlx5_vdpa_event.c
> b/drivers/vdpa/mlx5/mlx5_vdpa_event.c
> index 16276f5..dd60150 100644
> --- a/drivers/vdpa/mlx5/mlx5_vdpa_event.c
> +++ b/drivers/vdpa/mlx5/mlx5_vdpa_event.c
> @@ -237,8 +237,14 @@
>  int
>  mlx5_vdpa_cqe_event_setup(struct mlx5_vdpa_priv *priv)  {
> -	int flags = fcntl(priv->eventc->fd, F_GETFL);
> -	int ret = fcntl(priv->eventc->fd, F_SETFL, flags | O_NONBLOCK);
> +	int flags;
> +	int ret;
> +
> +	if (!priv->eventc)
> +		/* All virtqs are in poll mode. */
> +		return 0;
> +	flags = fcntl(priv->eventc->fd, F_GETFL);
> +	ret = fcntl(priv->eventc->fd, F_SETFL, flags | O_NONBLOCK);
>  	if (ret) {
>  		DRV_LOG(ERR, "Failed to change event channel FD.");
>  		rte_errno = errno;
> --
> 1.8.3.1


  reply	other threads:[~2020-02-25  9:46 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-02-25  8:43 Matan Azrad
2020-02-25  9:46 ` Slava Ovsiienko [this message]
2020-02-25  9:46 ` 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:
  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=AM4PR05MB3265119EA52CF1E8DC2952DDD2ED0@AM4PR05MB3265.eurprd05.prod.outlook.com \
    --to=viacheslavo@mellanox.com \
    --cc=dev@dpdk.org \
    --cc=matan@mellanox.com \
    --cc=maxime.coquelin@redhat.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).