DPDK patches and discussions
 help / color / mirror / Atom feed
From: 王志宏 <wangzhihong.wzh@bytedance.com>
To: "Burakov, Anatoly" <anatoly.burakov@intel.com>
Cc: dev@dpdk.org, qi.z.zhang@intel.com
Subject: Re: [External] Re: [PATCH] eal/linux: register mp hotplug callback after memory init
Date: Thu, 1 Jun 2023 20:33:13 -0700	[thread overview]
Message-ID: <CAMne5nBdFiEKsTMhb4aebaWgx9_iX=Eo6AdvwbbhAhf+pfiN4A@mail.gmail.com> (raw)
In-Reply-To: <76dfde52-62ab-5497-194c-c49f6a4cc95c@intel.com>

[-- Attachment #1: Type: text/plain, Size: 1535 bytes --]

Apologize that I have to go directly to function names to explain :)
  - rte_eal_intr_init creates eal_intr_thread_main which starts
eal_intr_handle_interrupts
  - rte_mp_channel_init creates mp_handle which processes messages
registered by rte_mp_action_register
  - then, eal_mp_dev_hotplug_init calls rte_mp_action_register to register
handle_primary_request for EAL_DEV_MP_ACTION_REQUEST

At this point the whole messaging mechanism starts to function: When
primary attaches/detaches devices, it sends EAL_DEV_MP_ACTION_REQUEST, and
handle_primary_request invokes __handle_primary_request, which
calls local_dev_probe/remove. In the end it goes to for
example rte_eth_dev_attach_secondary.

Now, if secondary is somewhere after eal_mp_dev_hotplug_init but before
memory init done, it will crash due to memory access violation.

Thanks
Zhihong
From: "Burakov, Anatoly"<anatoly.burakov@intel.com>
Date:  Thu, Jun 1, 2023, 20:26
Subject:  [External] Re: [PATCH] eal/linux: register mp hotplug callback
after memory init
To: "Zhihong Wang"<wangzhihong.wzh@bytedance.com>, <dev@dpdk.org>, <
qi.z.zhang@intel.com>
On 5/31/2023 7:55 AM, Zhihong Wang wrote:
> Secondary would crash if it tries to handle mp requests before memory
> init, since globals such as eth_dev_shared_data_lock are not accessible
> to it at this moment.
> ---

Please correct me if I'm wrong, but if init is not completed, none of
the IPC stuff is initialized either, and any hotplug requests would not
trigger any callbacks in the first place?
-- 
Thanks,
Anatoly

[-- Attachment #2: Type: text/html, Size: 5764 bytes --]

  reply	other threads:[~2023-06-02  3:33 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-05-31  6:55 Zhihong Wang
2023-06-01 12:26 ` Burakov, Anatoly
2023-06-02  3:33   ` 王志宏 [this message]
2023-06-02 13:10     ` [External] " Burakov, Anatoly
2023-06-02 13:10 ` Burakov, Anatoly
2023-06-07 20:21 ` David Marchand
2023-06-08  7:29   ` [External] " 王志宏
2023-06-08  7:25 ` [PATCH v2] " Zhihong Wang
2023-06-08  8:08   ` David Marchand

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='CAMne5nBdFiEKsTMhb4aebaWgx9_iX=Eo6AdvwbbhAhf+pfiN4A@mail.gmail.com' \
    --to=wangzhihong.wzh@bytedance.com \
    --cc=anatoly.burakov@intel.com \
    --cc=dev@dpdk.org \
    --cc=qi.z.zhang@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).