From: Tyler Retzlaff <roretzla@linux.microsoft.com>
To: "Zhang, Qi Z" <qi.z.zhang@intel.com>
Cc: "Ye, MingjinX" <mingjinx.ye@intel.com>,
"dev@dpdk.org" <dev@dpdk.org>,
"Yang, Qiming" <qiming.yang@intel.com>,
"stable@dpdk.org" <stable@dpdk.org>,
"Zhou, YidingX" <yidingx.zhou@intel.com>,
"Zhang, Ke1X" <ke1x.zhang@intel.com>
Subject: Re: [PATCH v5] net/ice: fix ice dcf control thread crash
Date: Tue, 21 Mar 2023 09:24:25 -0700 [thread overview]
Message-ID: <20230321162425.GA5043@linuxonhyperv3.guj3yctzbm1etfxqx2vob5hsef.xx.internal.cloudapp.net> (raw)
In-Reply-To: <DM4PR11MB599416FAA7577FE38FF3E687D7819@DM4PR11MB5994.namprd11.prod.outlook.com>
On Tue, Mar 21, 2023 at 11:55:19AM +0000, Zhang, Qi Z wrote:
>
>
> > -----Original Message-----
> > From: Ye, MingjinX <mingjinx.ye@intel.com>
> > Sent: Tuesday, March 21, 2023 10:08 AM
> > To: Zhang, Qi Z <qi.z.zhang@intel.com>; dev@dpdk.org
> > Cc: Yang, Qiming <qiming.yang@intel.com>; stable@dpdk.org; Zhou, YidingX
> > <yidingx.zhou@intel.com>; Zhang, Ke1X <ke1x.zhang@intel.com>
> > Subject: RE: [PATCH v5] net/ice: fix ice dcf control thread crash
> >
> > Hi Qi, here is my new solution, can you give me some good suggestions.
> > 1. remove the 'vc_event_msg_cb == NULL' related processing and let each
> > 'ice-rest' thread, end normally.
> > 2. Define vsi_update_thread_num as rte_atomic32_t.
> >
> > > -----Original Message-----
> > > From: Zhang, Qi Z <qi.z.zhang@intel.com>
> > > Sent: 2023年3月20日 20:53
> > > To: Ye, MingjinX <mingjinx.ye@intel.com>; dev@dpdk.org
> > > Cc: Yang, Qiming <qiming.yang@intel.com>; stable@dpdk.org; Zhou,
> > > YidingX <yidingx.zhou@intel.com>; Zhang, Ke1X <ke1x.zhang@intel.com>
> > > Subject: RE: [PATCH v5] net/ice: fix ice dcf control thread crash
> >
> > > > for (;;) {
> > > > + if (hw->vc_event_msg_cb == NULL)
> > > > + break;
> > > Can you explain why this is required, seems it not related with your
> > > commit log
> > The purpose of this is to bring all 'ice-reset' threads to a quick end when hw
> > is released.
>
> I don't understand, the vc_event_msg_cb was initialized in ice_dcf_dev_init and never be reset why we need this check, anything I missed?
> >
> > > >
> > > > - rte_intr_enable(pci_dev->intr_handle);
> > > > - ice_dcf_enable_irq0(hw);
> > > > + if (hw->vc_event_msg_cb != NULL) {
> > > > + rte_intr_enable(pci_dev->intr_handle);
> > > > + ice_dcf_enable_irq0(hw);
> > >
> > > Same question as above
> > These are called when HW releases the resource. Therefore, there is no need
> > to call.
> >
> > > > + rte_spinlock_lock(&dcf_hw->vsi_thread_lock);
> > > > + dcf_hw->vsi_update_thread_num++;
> > > > + rte_spinlock_unlock(&dcf_hw->vsi_thread_lock);
> > >
> > > I think you can define vsi_update_thread_num as rte_atomic32_t and use
> > > rte_atomic32_add/sub
> > At first I chose the rte_atomic32_t option, which is not very elegant using
> > spinlock.
> > The 'checkpatches.sh' script gives a warning ('Using rte_atomicNN_xxx') when
> > it is executed. I saw the comment on line 89 of the script (# refrain from new
> > additions of 16/32/64 bits rte_atomicNN_xxx()), so I went with the spinlock
> > solution.
>
> You are right, rte_atomicNN_xxx will be deprecated, and should not be used
> We can use the gcc build-in function __atomic_fetch_add/sub as an alternative, sp
using __atomic_fetch_{add,sub} is appropriate. please be aware using
__atomic_{add_fetch}_fetch is discouraged but it is easy to write the
code using only the former.
>
> >
> >
next prev parent reply other threads:[~2023-03-21 16:24 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
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 [this message]
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=20230321162425.GA5043@linuxonhyperv3.guj3yctzbm1etfxqx2vob5hsef.xx.internal.cloudapp.net \
--to=roretzla@linux.microsoft.com \
--cc=dev@dpdk.org \
--cc=ke1x.zhang@intel.com \
--cc=mingjinx.ye@intel.com \
--cc=qi.z.zhang@intel.com \
--cc=qiming.yang@intel.com \
--cc=stable@dpdk.org \
--cc=yidingx.zhou@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).