patches for DPDK stable branches
 help / color / mirror / Atom feed
From: David Marchand <david.marchand@redhat.com>
To: Maxime Coquelin <maxime.coquelin@redhat.com>,
	Lingli Chen <linglix.chen@intel.com>
Cc: stable@dpdk.org, xuemingl@nvidia.com, ktraynor@redhat.com
Subject: Re: [PATCH v22.11] vhost: fix missing spinlock unlock
Date: Thu, 11 Jan 2024 12:10:33 +0100	[thread overview]
Message-ID: <CAJFAV8xaAATYqdcwFt850ZYtgMM5SEbW6PmFkc1mkKU-S+VmBQ@mail.gmail.com> (raw)
In-Reply-To: <20240111105158.3508078-1-maxime.coquelin@redhat.com>

On Thu, Jan 11, 2024 at 11:52 AM Maxime Coquelin
<maxime.coquelin@redhat.com> wrote:
>
> Two regressions were introduced when backporting below
> patch:
> b4c4e5675c85 ("vhost: fix missing lock protection in power monitor API")
>
> First, rte_vhost_get_monitor_addr did not release the lock
> in the success case. Then, rte_rwlock_read_lock() was
> converted to rte_spinlock_trylock() instead of
> rte_spinlock_lock().
>
> This patch addresses both of these issues.
>

Bugzilla ID: 1338
> Fixes: a07736eb68da ("vhost: fix missing lock protection in power monitor API")
> Cc: stable@dpdk.org
>
> Signed-off-by: Maxime Coquelin <maxime.coquelin@redhat.com>


I backported the lock annotations for the vhost lib in 22.11.
Indeed, clang reports a deadlock in this part of the code which likely
explains the bug report.

[1/2] Compiling C object lib/librte_vhost.a.p/vhost_vhost.c.o
../lib/vhost/vhost.c:2092:1: warning: mutex 'vq->access_lock' is not
held on every path through here [-Wthread-safety-analysis]
}
^
../lib/vhost/vhost.c:2061:7: note: mutex acquired here
        if (!rte_spinlock_trylock(&vq->access_lock))
             ^
1 warning generated.
[2/2] Linking static target lib/librte_vhost.a


I applied this patch and the issue is gone.

Tested-by: David Marchand <david.marchand@redhat.com>

Can the bz reporter test this patch?


-- 
David Marchand


  reply	other threads:[~2024-01-11 11:10 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-01-11 10:51 Maxime Coquelin
2024-01-11 11:10 ` David Marchand [this message]
2024-01-11 11:11 ` Xueming(Steven) Li
2024-01-22 13:10   ` Xueming(Steven) Li
2024-01-19 13:52 ` Xueming(Steven) Li

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=CAJFAV8xaAATYqdcwFt850ZYtgMM5SEbW6PmFkc1mkKU-S+VmBQ@mail.gmail.com \
    --to=david.marchand@redhat.com \
    --cc=ktraynor@redhat.com \
    --cc=linglix.chen@intel.com \
    --cc=maxime.coquelin@redhat.com \
    --cc=stable@dpdk.org \
    --cc=xuemingl@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 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).