From: Kevin Traynor <ktraynor@redhat.com>
To: Ke Zhang <ke1x.zhang@intel.com>,
qi.z.zhang@intel.com, qiming.yang@intel.com, dev@dpdk.org
Subject: Re: [PATCH v2] net/ice: fix ice dcf control thread crash
Date: Wed, 1 Mar 2023 14:53:41 +0000 [thread overview]
Message-ID: <abcc9611-ccfc-2c75-f652-b07074907e92@redhat.com> (raw)
In-Reply-To: <20230213071648.326123-1-ke1x.zhang@intel.com>
On 13/02/2023 07:16, Ke Zhang wrote:
> The control thread accesses the hardware resources after the
> resources were released, resulting in a segment error.
>
> This commit fixes the bug by exiting thread before resource released.
>
Please add the "Fixes: xyz" tag for the commit that introduced this bug
so the fix can be backported to the appropriate stable branches.
> Signed-off-by: Ke Zhang <ke1x.zhang@intel.com>
> ---
> v2: add pthread_exit() for windows
> ---
> drivers/net/ice/ice_dcf.c | 4 ++++
> lib/eal/windows/include/pthread.h | 5 +++++
> 2 files changed, 9 insertions(+)
>
> diff --git a/drivers/net/ice/ice_dcf.c b/drivers/net/ice/ice_dcf.c
> index 1c3d22ae0f..e58908caf5 100644
> --- a/drivers/net/ice/ice_dcf.c
> +++ b/drivers/net/ice/ice_dcf.c
> @@ -543,6 +543,8 @@ ice_dcf_handle_vsi_update_event(struct ice_dcf_hw *hw)
> ice_dcf_disable_irq0(hw);
>
> for (;;) {
> + if (hw->vc_event_msg_cb == NULL)
> + pthread_exit(NULL);
> if (ice_dcf_get_vf_resource(hw) == 0 &&
> ice_dcf_get_vf_vsi_map(hw) >= 0) {
> err = 0;
> @@ -760,6 +762,8 @@ ice_dcf_uninit_hw(struct rte_eth_dev *eth_dev, struct ice_dcf_hw *hw)
> rte_intr_callback_unregister(intr_handle,
> ice_dcf_dev_interrupt_handler, hw);
>
> + hw->vc_event_msg_cb = NULL;
> +
> ice_dcf_mode_disable(hw);
> iavf_shutdown_adminq(&hw->avf);
>
> diff --git a/lib/eal/windows/include/pthread.h b/lib/eal/windows/include/pthread.h
> index 27fd2cca52..f0068ebd73 100644
> --- a/lib/eal/windows/include/pthread.h
> +++ b/lib/eal/windows/include/pthread.h
> @@ -149,6 +149,11 @@ pthread_detach(__rte_unused pthread_t thread)
> return 0;
> }
>
> +static inline void
> +pthread_exit(__rte_unused void *__retval)
> +{
> +}
> +
> static inline int
> pthread_join(__rte_unused pthread_t thread,
> __rte_unused void **value_ptr)
next prev parent reply other threads:[~2023-03-01 14:53 UTC|newest]
Thread overview: 24+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-02-08 8:30 [PATCH] net/ice: fix ice dcf contrl " Ke Zhang
2023-02-09 0:05 ` Stephen Hemminger
2023-02-13 7:03 ` [PATCH v2] " Ke Zhang
2023-02-21 0:29 ` Zhang, Qi Z
2023-02-13 7:14 ` Ke Zhang
2023-02-13 7:16 ` [PATCH v2] net/ice: fix ice dcf control " Ke Zhang
2023-02-14 11:03 ` Thomas Monjalon
2023-02-16 7:53 ` Zhang, Ke1X
2023-02-20 0:30 ` Thomas Monjalon
2023-03-01 1:54 ` Zhang, Ke1X
2023-03-01 14:53 ` Kevin Traynor [this message]
2023-03-15 8:20 ` [PATCH v3] " Mingjin Ye
2023-03-15 13:06 ` Zhang, Qi Z
2023-03-17 5:09 ` [PATCH v4] " Mingjin Ye
2023-03-17 10:15 ` Zhang, Qi Z
2023-03-20 9:40 ` [PATCH v5] " Mingjin Ye
2023-03-20 12:52 ` Zhang, Qi Z
2023-03-21 2:08 ` Ye, MingjinX
2023-03-21 11:55 ` Zhang, Qi Z
2023-03-21 16:24 ` Tyler Retzlaff
2023-03-22 5:56 ` [PATCH v6] " Mingjin Ye
2023-04-03 6:54 ` Zhang, Qi Z
2023-04-11 2:08 ` [PATCH v7] " Mingjin Ye
2023-05-15 6:28 ` Zhang, Qi Z
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=abcc9611-ccfc-2c75-f652-b07074907e92@redhat.com \
--to=ktraynor@redhat.com \
--cc=dev@dpdk.org \
--cc=ke1x.zhang@intel.com \
--cc=qi.z.zhang@intel.com \
--cc=qiming.yang@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).