patches for DPDK stable branches
 help / color / mirror / Atom feed
From: Stephen Hemminger <stephen@networkplumber.org>
To: Gongming Chen <chengongming1900@outlook.com>
Cc: maxime.coquelin@redhat.com, chenbox@nvidia.com, dev@dpdk.org,
	Gongming Chen <chengm11@chinatelecom.cn>,
	stable@dpdk.org
Subject: Re: [PATCH v4] vhost: fix crash caused by accessing a freed vsocket
Date: Mon, 26 May 2025 14:14:00 -0700	[thread overview]
Message-ID: <20250526141400.552bd764@hermes.local> (raw)
In-Reply-To: <TYAP286MB06491A9489C631C9D6EEA2FFD8DA2@TYAP286MB0649.JPNP286.PROD.OUTLOOK.COM>

On Mon,  8 Jul 2024 12:41:03 +0800
Gongming Chen <chengongming1900@outlook.com> wrote:

> diff --git a/lib/vhost/vhost_thread.c b/lib/vhost/vhost_thread.c
> new file mode 100644
> index 0000000000..f3ff182976
> --- /dev/null
> +++ b/lib/vhost/vhost_thread.c
> @@ -0,0 +1,33 @@
> +#include <rte_rwlock.h>
> +
> +#include "vhost_thread.h"
> +
> +static rte_rwlock_t vhost_thread_lock = RTE_RWLOCK_INITIALIZER;
> +
> +void
> +vhost_thread_read_lock(void)
> +	__rte_no_thread_safety_analysis
> +{
> +	rte_rwlock_read_lock(&vhost_thread_lock);
> +}
> +
> +void
> +vhost_thread_read_unlock(void)
> +	__rte_no_thread_safety_analysis
> +{
> +	rte_rwlock_read_unlock(&vhost_thread_lock);
> +}
> +
> +void
> +vhost_thread_write_lock(void)
> +	__rte_no_thread_safety_analysis
> +{
> +	rte_rwlock_write_lock(&vhost_thread_lock);
> +}
> +
> +void
> +vhost_thread_write_unlock(void)
> +	__rte_no_thread_safety_analysis
> +{
> +	rte_rwlock_write_unlock(&vhost_thread_lock);
> +}

Looking at the back catalog and spotted this.

What is the reason for moving all the vhost_thread locks into a file?
Also turning off thread safety is a bad idea.
And mixing DPDK locks with pthread mutex is not wise either.

This is not going to be critical path so why not use a pthread_mutex?

      parent reply	other threads:[~2025-05-26 21:14 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-04-03 16:05 [PATCH v1] " Gongming Chen
2024-05-10  7:28 ` Gongming Chen
2024-07-02  7:48   ` Maxime Coquelin
2024-07-08 23:50     ` Gongming Chen
2024-07-08  2:17 ` [PATCH v2] " Gongming Chen
2024-07-08  2:23 ` [PATCH v3] " Gongming Chen
2024-07-08  4:41 ` [PATCH v4] " Gongming Chen
2024-07-09  7:26   ` David Marchand
2025-05-26 21:14   ` Stephen Hemminger [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=20250526141400.552bd764@hermes.local \
    --to=stephen@networkplumber.org \
    --cc=chenbox@nvidia.com \
    --cc=chengm11@chinatelecom.cn \
    --cc=chengongming1900@outlook.com \
    --cc=dev@dpdk.org \
    --cc=maxime.coquelin@redhat.com \
    --cc=stable@dpdk.org \
    /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).