From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from dpdk.org (dpdk.org [92.243.14.124]) by inbox.dpdk.org (Postfix) with ESMTP id D7B6CA04B6 for ; Thu, 10 Sep 2020 03:22:53 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id B4BBD1C0CD; Thu, 10 Sep 2020 03:22:53 +0200 (CEST) Received: from EUR04-VI1-obe.outbound.protection.outlook.com (mail-eopbgr80078.outbound.protection.outlook.com [40.107.8.78]) by dpdk.org (Postfix) with ESMTP id 4A9C71B9B7; Thu, 10 Sep 2020 03:22:51 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=armh.onmicrosoft.com; s=selector2-armh-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=Zo8rcOPIragx/PQhS0biFzxnXY3/JgA2BJyq/c0fPI0=; b=0f+NivNwdtZ8Cql1U6QMyC0zosQDO6KU9DB53TKH9UgMHMvBeF/I22xj2xAOYufQtPEiSlOuQLTdfhbHjyyVpgA/LzDtLqVQ9my8rtsy7wTSrqzMdfxlDRhgR3YbvbYwqKY6MrD/GroAiOtwtS3EBGWcVWAe5j4+vDW0PHJvDyQ= Received: from AM6P193CA0139.EURP193.PROD.OUTLOOK.COM (2603:10a6:209:85::44) by DB6PR0801MB1989.eurprd08.prod.outlook.com (2603:10a6:4:75::22) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3370.16; Thu, 10 Sep 2020 01:22:50 +0000 Received: from AM5EUR03FT011.eop-EUR03.prod.protection.outlook.com (2603:10a6:209:85:cafe::74) by AM6P193CA0139.outlook.office365.com (2603:10a6:209:85::44) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3370.16 via Frontend Transport; Thu, 10 Sep 2020 01:22:49 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 63.35.35.123) smtp.mailfrom=arm.com; dpdk.org; dkim=pass (signature was verified) header.d=armh.onmicrosoft.com;dpdk.org; dmarc=bestguesspass action=none header.from=arm.com; Received-SPF: Pass (protection.outlook.com: domain of arm.com designates 63.35.35.123 as permitted sender) receiver=protection.outlook.com; client-ip=63.35.35.123; helo=64aa7808-outbound-1.mta.getcheckrecipient.com; Received: from 64aa7808-outbound-1.mta.getcheckrecipient.com (63.35.35.123) by AM5EUR03FT011.mail.protection.outlook.com (10.152.16.152) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3370.16 via Frontend Transport; Thu, 10 Sep 2020 01:22:49 +0000 Received: ("Tessian outbound a0bffebca527:v64"); Thu, 10 Sep 2020 01:22:49 +0000 X-CR-MTA-TID: 64aa7808 Received: from 3c7a920780bf.2 by 64aa7808-outbound-1.mta.getcheckrecipient.com id 4C476C63-925A-4137-A9C2-AC02B5A18404.1; Thu, 10 Sep 2020 01:22:44 +0000 Received: from EUR02-HE1-obe.outbound.protection.outlook.com by 64aa7808-outbound-1.mta.getcheckrecipient.com with ESMTPS id 3c7a920780bf.2 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384); Thu, 10 Sep 2020 01:22:44 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=L72d4LE/Z8oO8cVBUUv4b1hmDoTRlPkFOPq4CVV63/JV4lzsL+IKbN5xwXGbynCtArRMJJRi99NwgaXdyO0Nso8U440M6y4b8ZNqnorcoRoRy6LtJzFwsoGmhrpZhc4VGx8Fk8AZUidxBcpUiNpRYkjn1MBonBeGA17qN+9OgqP1Im0dsUGyvoqPoMhOj1r2UlRADI1aCfCeeNiLGLsFABArAD5ZchZJeWPSNrUEKrnl67fVZfuk6INp2J2amQEktRDiesgDlY5LQVh5qkc0LesMpBzgr992LDCJszC6Y2D7JOEOhLLpRftJUZ0cLPSpqrrtV3lG9uIM2ej66w4IGA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=Zo8rcOPIragx/PQhS0biFzxnXY3/JgA2BJyq/c0fPI0=; b=J17bIoqQpjWEuif+UzgVvnOqgZB7WLfXHYeLWbeAcNdXMCT2oerDsa0cna3DfikP/l5/uCtjdvuZi1GIoQRLXYD1pIshgmiOiQ9EZrNxGfYmml1CcdJgQiYVLCQxE7nT2N7sm96awtkjzV7IRatXvccjQ3TxkGNBbm4x3tkgDOfDXm631ZvpcztDujw4aan8HOQG39H2HRrGtDmEg7/uoxzxhSUHxUOY9YbXZp+z7HHaVRvbSJP/HndGNI7TekTqsfd+Q+qmR3NhLlFj4cHOrOQ/L3W3McFGsDM0S5sj1/230D6Y+fMr0K22p5ZaxFcg0/xszXKVqkgJPlnrFaquNg== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=arm.com; dmarc=pass action=none header.from=arm.com; dkim=pass header.d=arm.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=armh.onmicrosoft.com; s=selector2-armh-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=Zo8rcOPIragx/PQhS0biFzxnXY3/JgA2BJyq/c0fPI0=; b=0f+NivNwdtZ8Cql1U6QMyC0zosQDO6KU9DB53TKH9UgMHMvBeF/I22xj2xAOYufQtPEiSlOuQLTdfhbHjyyVpgA/LzDtLqVQ9my8rtsy7wTSrqzMdfxlDRhgR3YbvbYwqKY6MrD/GroAiOtwtS3EBGWcVWAe5j4+vDW0PHJvDyQ= Received: from DBAPR08MB5814.eurprd08.prod.outlook.com (2603:10a6:10:1b1::6) by DB6PR08MB2646.eurprd08.prod.outlook.com (2603:10a6:6:20::26) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3348.15; Thu, 10 Sep 2020 01:22:42 +0000 Received: from DBAPR08MB5814.eurprd08.prod.outlook.com ([fe80::408a:40fb:7402:c805]) by DBAPR08MB5814.eurprd08.prod.outlook.com ([fe80::408a:40fb:7402:c805%6]) with mapi id 15.20.3348.019; Thu, 10 Sep 2020 01:22:42 +0000 From: Honnappa Nagarahalli To: Erik Gabriel Carrillo , "dev@dpdk.org" CC: "stable@dpdk.org" , nd , Honnappa Nagarahalli , nd Thread-Topic: [dpdk-dev] [PATCH 1/1] timer: add limitation note for sync stop and reset Thread-Index: AQHWhrdalKPOMjT8yE+DDZ93/o34dKlhE9Vg Date: Thu, 10 Sep 2020 01:22:42 +0000 Message-ID: References: <1599662474-44882-1-git-send-email-erik.g.carrillo@intel.com> <1599662474-44882-2-git-send-email-erik.g.carrillo@intel.com> In-Reply-To: <1599662474-44882-2-git-send-email-erik.g.carrillo@intel.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-ts-tracking-id: 10D397DCAA606346A16DB04B7834030E.0 x-checkrecipientchecked: true Authentication-Results-Original: intel.com; dkim=none (message not signed) header.d=none;intel.com; dmarc=none action=none header.from=arm.com; x-originating-ip: [107.77.221.39] x-ms-publictraffictype: Email X-MS-Office365-Filtering-HT: Tenant X-MS-Office365-Filtering-Correlation-Id: 386b645c-ceff-474c-25a4-08d855280848 x-ms-traffictypediagnostic: DB6PR08MB2646:|DB6PR0801MB1989: x-ms-exchange-transport-forked: True X-Microsoft-Antispam-PRVS: x-checkrecipientrouted: true nodisclaimer: true x-ms-oob-tlc-oobclassifiers: OLM:8882;OLM:8882; X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam-Untrusted: BCL:0; X-Microsoft-Antispam-Message-Info-Original: SkYmLw0HOZjPKTNWfEztoxyISqBYglFJwfX2PbPCEQjyiFSwJf8EcNqcEIvXbCQFxOxQrM6XYdbxbRa6rBGcbsM8s33KdfxlWOdpZ8ZLWi/byP/durAWdbL2kOJISFQy0+FqPs/bkbN5MvA6Bxd3G755RoKGRd9gz3/4V8dDG36ErzFvPGxHcAqbXEmEUXUO1P/656ncWLazcmyyiihYdqV43F6/sdEJHlfrBvxah8Yu0GzSeLuoUp0DeKqVF5VjkL4J6khGKokPVdLVU7Zn+PkCSmOp47HdAYCyf1bSSawIKBjrI3zBTusH6hU1hBhMWJeLhZju5PFf7e9i+E47RAvBgfZxW4+pr8MPK1SASgD4ZwbHQ8FnbDnodzuiyPk+ X-Forefront-Antispam-Report-Untrusted: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:DBAPR08MB5814.eurprd08.prod.outlook.com; PTR:; CAT:NONE; SFS:(4636009)(396003)(366004)(136003)(346002)(376002)(39860400002)(64756008)(66476007)(66446008)(66946007)(8936002)(478600001)(71200400001)(9686003)(4326008)(5660300002)(33656002)(52536014)(76116006)(55016002)(83380400001)(86362001)(6506007)(7696005)(66556008)(186003)(110136005)(54906003)(26005)(316002)(2906002); DIR:OUT; SFP:1101; x-ms-exchange-antispam-messagedata: WDuY/dSCXAnhkWdsfTo2K8uVbxDCg7XLOHiENKJGfFcOBpylM2x399Hzv9WBbFKX8zji6aQF5Vy4T8PRgGmZP43YcFhq2FZqTeQCYGmNp2yCDE7scagGDT29jtYlL6wr2TzgZYMVgnHc89vnGb74SHDHnOOb6eHfHhMmIVft6OF4fjJVLd2zr5njCh/QEyPa7b01o5Y5CyIfWzlatCfa/EKLYnCuInsYCrdXt3ZE2j/MpnhNKn318eSwWtRdc2ppT5YmSzZi4o22c2Pfch6SJRuWg4vFD8hmgHXiVlwgewA0bietegP1FyAONDyJNnM7MbWaZGrY15BGUVZhP3NSQKcRS22hlY4/d2StMoSvvrfHOkZPxLFytFci7y9Gh8LKgR0sSJYyxU4LCJhkuWqizr/2/klTsHueayIU3B+Y4uc+x0idJU37ngZufr7XVEXJD6qJoJjyFVnVwTapBiG/cgM9TRIujuYQF39IS3wUm9fzL2dAO3ic3VWxVNhyE/L9lhWSUMNlvrEtrkRpoc5AbUDNXDndOCd1TfKnpfop5318LrPyeZ3DBfNZUZRv2SYidblpypdZKkrDmVIJC2GlyoAFEMuUp5wDHWf749iaZCsDKR4KHfAq8hAVezAjN3JRvPdo/jvZCA3ldJDT4Hb4Ow== Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-MS-Exchange-Transport-CrossTenantHeadersStamped: DB6PR08MB2646 Original-Authentication-Results: intel.com; dkim=none (message not signed) header.d=none;intel.com; dmarc=none action=none header.from=arm.com; X-EOPAttributedMessage: 0 X-MS-Exchange-Transport-CrossTenantHeadersStripped: AM5EUR03FT011.eop-EUR03.prod.protection.outlook.com X-MS-Office365-Filtering-Correlation-Id-Prvs: 3b425cf7-4455-466a-d989-08d85528040c X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: FEu3W2A9pK6tg8xgu7UBylV4SAlq3tPGHp4oWwtM3SSLJITB3ed5Xy80Lsht01rKCLJ84ESREMzRLs/r7tQ9eReKERloQtG6SJZwn2re1P3Cwq3QKBatVfV5rGxCUjPznE+2eYaKtck2gL/2D9/Ybu9BOesCUUtjJZto0krWeWSGdZEN1s0zIi1FHApm/NWa78bGswcgAjvGXskxRme7X0o6NWI6X+qY0eXU0cSDfQrHjy2wbhNPeO/ExKfjusdyBIzvcWs3Vw/utis4Aq70cfwkZ8SIa0ftg55sx8maTp2z+qHE7c06kYtVUt66RQ4OV+ZKr6d7Z2z+v/NzWABwlWxDLfpXQsYmf39vavBBKgbnAHB0wWcf2Hiyi455oO2qp6z5jgZt7uSzHjqMYLuPCw== X-Forefront-Antispam-Report: CIP:63.35.35.123; CTRY:IE; LANG:en; SCL:1; SRV:; IPV:CAL; SFV:NSPM; H:64aa7808-outbound-1.mta.getcheckrecipient.com; PTR:ec2-63-35-35-123.eu-west-1.compute.amazonaws.com; CAT:NONE; SFS:(4636009)(376002)(346002)(136003)(396003)(39860400002)(46966005)(86362001)(450100002)(8936002)(110136005)(33656002)(70586007)(70206006)(2906002)(54906003)(36906005)(5660300002)(55016002)(336012)(316002)(9686003)(186003)(52536014)(4326008)(6506007)(26005)(7696005)(82740400003)(47076004)(81166007)(356005)(82310400003)(478600001)(83380400001); DIR:OUT; SFP:1101; X-OriginatorOrg: arm.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 10 Sep 2020 01:22:49.8074 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 386b645c-ceff-474c-25a4-08d855280848 X-MS-Exchange-CrossTenant-Id: f34e5979-57d9-4aaa-ad4d-b122a662184d X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=f34e5979-57d9-4aaa-ad4d-b122a662184d; Ip=[63.35.35.123]; Helo=[64aa7808-outbound-1.mta.getcheckrecipient.com] X-MS-Exchange-CrossTenant-AuthSource: AM5EUR03FT011.eop-EUR03.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: DB6PR0801MB1989 Subject: Re: [dpdk-stable] [dpdk-dev] [PATCH 1/1] timer: add limitation note for sync stop and reset X-BeenThere: stable@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: patches for DPDK stable branches List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: stable-bounces@dpdk.org Sender: "stable" >=20 > 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. >=20 > 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 callb= ack > 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. >=20 > 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. >=20 > Bugzilla ID: 491 > Cc: stable@dpdk.org >=20 > Signed-off-by: Erik Gabriel Carrillo Looks good. Reviewed-by: Honnappa Nagarahalli > --- > lib/librte_timer/rte_timer.h | 12 ++++++++++++ > 1 file changed, 12 insertions(+) >=20 > 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. Inst= ead, > + * the rte_timer_reset() API can be called directly and its return cod= e > + * 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. Inste= ad, > 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); >=20 > -- > 2.6.4