DPDK patches and discussions
 help / color / mirror / Atom feed
From: Stephen Hemminger <stephen@networkplumber.org>
To: Zhichao Zeng <zhichaox.zeng@intel.com>
Cc: dev@dpdk.org, david.marchand@redhat.com, qiming.yang@intel.com,
	yidingx.zhou@intel.com, stable@dpdk.org,
	Bruce Richardson <bruce.richardson@intel.com>,
	Harman Kalra <hkalra@marvell.com>
Subject: Re: [PATCH v5] lib/eal: fix segfaults in exiting
Date: Tue, 6 Sep 2022 08:03:37 -0700	[thread overview]
Message-ID: <20220906080337.25dc426d@hermes.local> (raw)
In-Reply-To: <20220906025132.160801-1-zhichaox.zeng@intel.com>

On Tue,  6 Sep 2022 10:51:31 +0800
Zhichao Zeng <zhichaox.zeng@intel.com> wrote:

>  
> +static void mark_forked(void)
> +{
> +	is_forked++;
> +}
> +

This will end up counting application threads as well.

Also, it would need to be atomic.

>  /* Launch threads, called at application init(). */
>  int
>  rte_eal_init(int argc, char **argv)
> @@ -1324,6 +1331,8 @@ rte_eal_init(int argc, char **argv)
>  
>  	eal_mcfg_complete();
>  
> +	pthread_atfork(NULL, NULL, mark_forked);
> +
>  	return fctret;
>  }

>  int
>  rte_eal_cleanup(void)
>  {
> +	if (is_forked)
> +		return 0;
> +

rte_eal_cleanup is supposed to be called only once by application.

  reply	other threads:[~2022-09-06 15:03 UTC|newest]

Thread overview: 24+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-05-17 16:04 [DPDK] eal/linux: fix segfaults due to thread exit order zhichaox.zeng
2022-05-17  8:29 ` Morten Brørup
2022-05-17 15:25 ` [EXT] " Harman Kalra
2022-05-18 14:39 ` [DPDK v2] lib/eal: " zhichaox.zeng
2022-05-23 11:16 ` [PATCH " zhichaox.zeng
2022-05-23 12:10   ` David Marchand
2022-05-23 13:00     ` David Marchand
2022-05-30 13:47   ` [PATCH v3] " zhichaox.zeng
2022-05-30 16:26     ` Stephen Hemminger
2022-05-30 16:28     ` Stephen Hemminger
2022-06-02  8:21       ` Zeng, ZhichaoX
2022-06-07 10:14     ` Zeng, ZhichaoX
2022-06-15  6:01     ` [PATCH v4] " zhichaox.zeng
2022-06-24  1:42       ` Zeng, ZhichaoX
2022-06-24  7:50         ` David Marchand
2022-06-30 10:38         ` Zeng, ZhichaoX
2022-06-30 12:24       ` Bruce Richardson
2022-09-06  2:51       ` [PATCH v5] lib/eal: fix segfaults in exiting Zhichao Zeng
2022-09-06 15:03         ` Stephen Hemminger [this message]
2022-09-07  8:53           ` Zeng, ZhichaoX
2022-10-11  5:25         ` [PATCH v6] " Zhichao Zeng
2022-10-11 14:04           ` Stephen Hemminger
2022-10-19  1:51             ` Zeng, ZhichaoX
2022-09-06  2:49 [PATCH v5] " Zhichao Zeng

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=20220906080337.25dc426d@hermes.local \
    --to=stephen@networkplumber.org \
    --cc=bruce.richardson@intel.com \
    --cc=david.marchand@redhat.com \
    --cc=dev@dpdk.org \
    --cc=hkalra@marvell.com \
    --cc=qiming.yang@intel.com \
    --cc=stable@dpdk.org \
    --cc=yidingx.zhou@intel.com \
    --cc=zhichaox.zeng@intel.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).