DPDK patches and discussions
 help / color / mirror / Atom feed
From: "Zhao1, Wei" <wei.zhao1@intel.com>
To: Ilya Maximets <i.maximets@samsung.com>,
	"Zhang, Qi Z" <qi.z.zhang@intel.com>,
	"dev@dpdk.org" <dev@dpdk.org>
Cc: "Lu, Wenzhuo" <wenzhuo.lu@intel.com>,
	"Ananyev, Konstantin" <konstantin.ananyev@intel.com>,
	Laurent Hardy <laurent.hardy@6wind.com>,
	"stable@dpdk.org" <stable@dpdk.org>,
	Thomas Monjalon <thomas@monjalon.net>,
	"Yigit, Ferruh" <ferruh.yigit@intel.com>
Subject: Re: [dpdk-dev] [PATCH] net/ixgbe: fix busy polling while fiber link update
Date: Tue, 9 Oct 2018 10:22:43 +0000	[thread overview]
Message-ID: <A2573D2ACFCADC41BB3BE09C6DE313CA07E4BF32@PGSMSX103.gar.corp.intel.com> (raw)
In-Reply-To: <20181003074105eucas1p19452a3d3d788e58be6eaab36295775a6~aCVDfgCVZ0655806558eucas1p1H@eucas1p1.samsung.com>

HI,

> -----Original Message-----
> From: dev [mailto:dev-bounces@dpdk.org] On Behalf Of Ilya Maximets
> Sent: Wednesday, October 3, 2018 3:43 PM
> To: Zhang, Qi Z <qi.z.zhang@intel.com>; dev@dpdk.org
> Cc: Lu, Wenzhuo <wenzhuo.lu@intel.com>; Ananyev, Konstantin
> <konstantin.ananyev@intel.com>; Laurent Hardy
> <laurent.hardy@6wind.com>; Dai, Wei <wei.dai@intel.com>;
> stable@dpdk.org; Thomas Monjalon <thomas@monjalon.net>; Yigit, Ferruh
> <ferruh.yigit@intel.com>
> Subject: Re: [dpdk-dev] [PATCH] net/ixgbe: fix busy polling while fiber link
> update
> 
> On 21.09.2018 17:25, Zhang, Qi Z wrote:
> >
> >
> >> -----Original Message-----
> >> From: dev [mailto:dev-bounces@dpdk.org] On Behalf Of Zhang, Qi Z
> >> Sent: Wednesday, September 12, 2018 4:29 PM
> >> To: Ilya Maximets <i.maximets@samsung.com>; dev@dpdk.org
> >> Cc: Lu, Wenzhuo <wenzhuo.lu@intel.com>; Ananyev, Konstantin
> >> <konstantin.ananyev@intel.com>; Laurent Hardy
> >> <laurent.hardy@6wind.com>; Dai, Wei <wei.dai@intel.com>;
> >> stable@dpdk.org
> >> Subject: Re: [dpdk-dev] [PATCH] net/ixgbe: fix busy polling while
> >> fiber link update
> >>
> >>
> >>
> >>> -----Original Message-----
> >>> From: Ilya Maximets [mailto:i.maximets@samsung.com]
> >>> Sent: Wednesday, September 12, 2018 4:05 PM
> >>> To: Zhang, Qi Z <qi.z.zhang@intel.com>; dev@dpdk.org
> >>> Cc: Lu, Wenzhuo <wenzhuo.lu@intel.com>; Ananyev, Konstantin
> >>> <konstantin.ananyev@intel.com>; Laurent Hardy
> >>> <laurent.hardy@6wind.com>; Dai, Wei <wei.dai@intel.com>;
> >>> stable@dpdk.org
> >>> Subject: Re: [dpdk-dev] [PATCH] net/ixgbe: fix busy polling while
> >>> fiber link update
> >>>
> >>> On 12.09.2018 09:49, Zhang, Qi Z wrote:
> >>>>
> >>>>
> >>>>> -----Original Message-----
> >>>>> From: Ilya Maximets [mailto:i.maximets@samsung.com]
> >>>>> Sent: Monday, September 10, 2018 11:09 PM
> >>>>> To: Zhang, Qi Z <qi.z.zhang@intel.com>; dev@dpdk.org
> >>>>> Cc: Lu, Wenzhuo <wenzhuo.lu@intel.com>; Ananyev, Konstantin
> >>>>> <konstantin.ananyev@intel.com>; Laurent Hardy
> >>>>> <laurent.hardy@6wind.com>; Dai, Wei <wei.dai@intel.com>;
> >>>>> stable@dpdk.org
> >>>>> Subject: Re: [dpdk-dev] [PATCH] net/ixgbe: fix busy polling while
> >>>>> fiber link update
> >>>>>
> >>>>> On 04.09.2018 09:08, Zhang, Qi Z wrote:
> >>>>>> Hi Ilya:
> >>>>>>
> >>>>>>> -----Original Message-----
> >>>>>>> From: dev [mailto:dev-bounces@dpdk.org] On Behalf Of Ilya
> >>>>>>> Maximets
> >>>>>>> Sent: Friday, August 31, 2018 8:40 PM
> >>>>>>> To: dev@dpdk.org
> >>>>>>> Cc: Lu, Wenzhuo <wenzhuo.lu@intel.com>; Ananyev, Konstantin
> >>>>>>> <konstantin.ananyev@intel.com>; Laurent Hardy
> >>>>>>> <laurent.hardy@6wind.com>; Dai, Wei <wei.dai@intel.com>; Ilya
> >>>>>>> Maximets <i.maximets@samsung.com>; stable@dpdk.org
> >>>>>>> Subject: [dpdk-dev] [PATCH] net/ixgbe: fix busy polling while
> >>>>>>> fiber link update
> >>>>>>>
> >>>>>>> If the multispeed fiber link is in DOWN state, ixgbe_setup_link
> >>>>>>> could take around a second of busy polling. This is highly
> >>>>>>> inconvenient for the case where single thread periodically
> >>>>>>> checks the link
> >>> statuses.
> >>>>>>> For example, OVS main thread periodically updates the link
> >>>>>>> statuses and hangs for a really long time busy waiting on
> >>>>>>> ixgbe_setup_link() for a DOWN fiber ports. For case with 3 down
> >>>>>>> ports it hangs for a 3 seconds and unable to do anything
> >>>>>>> including
> >> packet processing.
> >>>>>>> Fix that by shifting that workaround to a separate thread by
> >>>>>>> alarm handler that will try to set up link if it is DOWN.
> >>>>>>
> >>>>>> Does that mean we will block the interrupt thread for 3 seconds?
> >>>>>
> >>>>> Three times for one second. Other work could be scheduled between.
> >>>>> IMHO, it's much better than blocking usual caller for 3 seconds.
> >>>>>
> >>>>>> Also, can we guarantee there will not be any race condition if we
> >>>>>> call
> >>>>> ixgbe_setup_link at another thread, the base code API is not
> >>>>> assumed to be thread-safe as I know.
> >>>>>
> >>>>> The only user of 'ixgbe_setup_link' is 'ixgbe_dev_start', but it
> >>>>> could be called only if device stopped. 'ixgbe_dev_stop' cancels
> >>>>> the
> >> alarm.
> >>>>> Race with 'link_update' avoided by
> 'IXGBE_FLAG_NEED_LINK_CONFIG'
> >> flag.
> >>>>
> >>>> I guess, it' not only about when ixgb_setup_link race with itself,
> >>>> but also
> >>> when it race with other APIs.
> >>>> Also the concern is, even in current version, we can prove there is
> >>>> no issue,
> >>> how can we guarantee we are safe for future base code update? It's
> >>> not designed as thread-safe.
> >>>> For my option, the change is risky.
> >>>
> >>> In current implementation interrupt handler already calls the
> >>> 'ixgbe_dev_link_update' which subsequently calls 'ixgbe_setup_link'
> >>> in our case if LSC interrupts enabled. So, my change makes the
> >>> driver even safer by moving 'ixgbe_setup_link' to the same interrupt
> thread.
> >>> Otherwise two threads (interrupts handler and the link status
> >>> checking
> >>> thread) could call 'ixgbe_setup_link' simultaneously.
> >>
> >> Ok, you are right, seems the concern I have is already exist , your
> >> patch does not introduce new issue.
> >> So I have no objection if this will fix some issue.
> >> But let's check if any ixgbe experts will comment.
> >>
> >> Regards
> >> Qi
> >>
> >>>
> >>>>
> >>>> Btw, since ixgbe support LSC, it is not necessary for "single
> >>>> thread
> >>> periodically checks the link statuses", right?
> >>>
> >>> In current implementation it will take at least 5 seconds (4 + 1)
> >>> for the interrupt handler to detect DOWN link state for ixgbe
> >>> multispeed fiber. This is too much for many real world cases.
> >>>
> >>>>
> >>>>>
> >>>>>>
> >>>>>> Regards
> >>>>>> Qi
> >>>>>>
> >>>>>>>
> >>>>>>> Fixes: c12d22f65b13 ("net/ixgbe: ensure link status is updated")
> >>>>>>> CC: stable@dpdk.org
> >>>>>>>
> >>>>>>> Signed-off-by: Ilya Maximets <i.maximets@samsung.com>
> >
> > Reviewed-by: Qi Zhang <qi.z.zhang@intel.com>
> 
> Hi.
> Is there any chance for this to be merged in a near future?
> 
> Situation becomes even worse. Recently accepted commit b2815c41bd0b
> ("net/ixgbe: wait longer for link after fiber MAC setup") increases the time of
> the thread hang busy waiting up to
> 1.5 seconds per port on each link state check.
> 
> Best regards, Ilya Maximets.

We are review this patch now, and feedback to you ASAP, SORRY.


  reply	other threads:[~2018-10-09 10:22 UTC|newest]

Thread overview: 27+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <CGME20180831123824eucas1p1cd2981c716c4764703e24c3eeb4d33c7@eucas1p1.samsung.com>
2018-08-31 12:39 ` Ilya Maximets
2018-09-04  6:08   ` Zhang, Qi Z
2018-09-10 15:08     ` Ilya Maximets
2018-09-12  6:49       ` Zhang, Qi Z
2018-09-12  8:05         ` Ilya Maximets
2018-09-12  8:28           ` Zhang, Qi Z
2018-09-21 14:25             ` Zhang, Qi Z
2018-10-03  7:43               ` Ilya Maximets
2018-10-09 10:22                 ` Zhao1, Wei [this message]
2018-10-11  9:56           ` Zhao1, Wei
2018-10-11 10:26             ` Ilya Maximets
2018-10-11 12:21               ` Laurent Hardy
2018-10-12  7:36                 ` Zhao1, Wei
2018-10-15 10:43                   ` Laurent Hardy
2018-10-16  8:29                     ` Zhao1, Wei
2018-10-12  9:19               ` Zhao1, Wei
2018-10-12 10:14                 ` Ilya Maximets
2018-10-15  3:03                   ` Zhao1, Wei
2018-10-15  8:40                     ` Ilya Maximets
2018-10-16  8:59                       ` Zhao1, Wei
2018-10-30 10:20   ` Ilya Maximets
2018-11-01 15:45     ` Zhang, Qi Z
2018-11-01 16:05       ` Ilya Maximets
     [not found]   ` <CGME20181101160505eucas1p1fcf268f3febaa80dcbb3e573b2fc2c68@eucas1p1.samsung.com>
2018-11-01 16:04     ` [dpdk-dev] [PATCH v2] " Ilya Maximets
2018-11-02 13:49       ` Zhang, Qi Z
2018-11-07 15:52       ` Burakov, Anatoly
2018-11-08 10:27         ` Ilya Maximets

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=A2573D2ACFCADC41BB3BE09C6DE313CA07E4BF32@PGSMSX103.gar.corp.intel.com \
    --to=wei.zhao1@intel.com \
    --cc=dev@dpdk.org \
    --cc=ferruh.yigit@intel.com \
    --cc=i.maximets@samsung.com \
    --cc=konstantin.ananyev@intel.com \
    --cc=laurent.hardy@6wind.com \
    --cc=qi.z.zhang@intel.com \
    --cc=stable@dpdk.org \
    --cc=thomas@monjalon.net \
    --cc=wenzhuo.lu@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).