From: Honnappa Nagarahalli <Honnappa.Nagarahalli@arm.com>
To: Erik Gabriel Carrillo <erik.g.carrillo@intel.com>,
"dev@dpdk.org" <dev@dpdk.org>
Cc: "stable@dpdk.org" <stable@dpdk.org>, nd <nd@arm.com>,
Honnappa Nagarahalli <Honnappa.Nagarahalli@arm.com>,
nd <nd@arm.com>
Subject: Re: [dpdk-stable] [dpdk-dev] [PATCH 1/1] timer: add limitation note for sync stop and reset
Date: Thu, 10 Sep 2020 01:22:42 +0000 [thread overview]
Message-ID: <DBAPR08MB5814D9E2263BC281C0480E0598270@DBAPR08MB5814.eurprd08.prod.outlook.com> (raw)
In-Reply-To: <1599662474-44882-2-git-send-email-erik.g.carrillo@intel.com>
<snip>
>
> If a timer's callback function calls rte_timer_reset_sync() or
> rte_timer_stop_sync() on another timer that is in the RUNNING state and
> owned by the current lcore, the *_sync() calls will loop indefinitely.
>
> Relatedly, if a timer's callback function calls *_sync() on another timer that is
> in the RUNNING state and is owned by a different lcore, but a timer callback
> function runs on that different lcore and calls
> *_sync() on a timer that is in the RUNNING state and owned by the current
> lcore, the two lcores will loop indefinitely.
>
> Add a note in the rte_timer_stop_sync and rte_timer_reset_sync
> documentation that indicates that these APIs should not be used inside
> timer callback functions in order to avoid the hangs described above, and
> suggests an alternative.
>
> Bugzilla ID: 491
> Cc: stable@dpdk.org
>
> Signed-off-by: Erik Gabriel Carrillo <erik.g.carrillo@intel.com>
Looks good.
Reviewed-by: Honnappa Nagarahalli <honnappa.nagarahalli@arm.com>
> ---
> lib/librte_timer/rte_timer.h | 12 ++++++++++++
> 1 file changed, 12 insertions(+)
>
> diff --git a/lib/librte_timer/rte_timer.h b/lib/librte_timer/rte_timer.h index
> c6b3d45..d7c3e03 100644
> --- a/lib/librte_timer/rte_timer.h
> +++ b/lib/librte_timer/rte_timer.h
> @@ -274,6 +274,12 @@ int rte_timer_reset(struct rte_timer *tim, uint64_t
> ticks,
> * The callback function of the timer.
> * @param arg
> * The user argument of the callback function.
> + *
> + * @note
> + * This API should not be called inside a timer's callback function to
> + * reset another timer; doing so could hang in certain scenarios. Instead,
> + * the rte_timer_reset() API can be called directly and its return code
> + * can be checked for success or failure.
> */
> void
> rte_timer_reset_sync(struct rte_timer *tim, uint64_t ticks, @@ -313,6
> +319,12 @@ int rte_timer_stop(struct rte_timer *tim);
> *
> * @param tim
> * The timer handle.
> + *
> + * @note
> + * This API should not be called inside a timer's callback function to
> + * stop another timer; doing so could hang in certain scenarios. Instead,
> the
> + * rte_timer_stop() API can be called directly and its return code can
> + * be checked for success or failure.
> */
> void rte_timer_stop_sync(struct rte_timer *tim);
>
> --
> 2.6.4
next prev parent reply other threads:[~2020-09-10 1:22 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <1599662474-44882-1-git-send-email-erik.g.carrillo@intel.com>
2020-09-09 14:41 ` [dpdk-stable] " Erik Gabriel Carrillo
2020-09-10 1:22 ` Honnappa Nagarahalli [this message]
2020-10-08 10:28 ` [dpdk-stable] [dpdk-dev] " David Marchand
2020-10-08 13:58 ` Carrillo, Erik G
2020-10-08 14:11 ` 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=DBAPR08MB5814D9E2263BC281C0480E0598270@DBAPR08MB5814.eurprd08.prod.outlook.com \
--to=honnappa.nagarahalli@arm.com \
--cc=dev@dpdk.org \
--cc=erik.g.carrillo@intel.com \
--cc=nd@arm.com \
--cc=stable@dpdk.org \
/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).