From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mailout1.w1.samsung.com (mailout1.w1.samsung.com [210.118.77.11]) by dpdk.org (Postfix) with ESMTP id C55BE4C91 for ; Mon, 10 Sep 2018 17:09:32 +0200 (CEST) Received: from eucas1p2.samsung.com (unknown [182.198.249.207]) by mailout1.w1.samsung.com (KnoxPortal) with ESMTP id 20180910150932euoutp01c73f559128e7d71d4b54839126b5f0af~TEnCAewGN1247612476euoutp01B for ; Mon, 10 Sep 2018 15:09:32 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 mailout1.w1.samsung.com 20180910150932euoutp01c73f559128e7d71d4b54839126b5f0af~TEnCAewGN1247612476euoutp01B DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=samsung.com; s=mail20170921; t=1536592172; bh=zrZQV2O9F0mBx7tDTmj6HH6qr71Utyc6+Lvhem8p3js=; h=Subject:To:Cc:From:Date:In-Reply-To:References:From; b=F9KooZlU5BdpQp32Ed9HWRnAUA20Bpr3uLfcZkqZs7GzSRVVLirsy0qOMH6eZi+1i fE/tT2xfY6Jui52IQnqKAWWfKG/duHJmC+vcg+zykeD2iPG25+Ve8s23XUuJX6V+o8 PjOON3WJ0dSp8tycfuJZGwMDK+WW9dn7PGJqqm54= Received: from eusmges2new.samsung.com (unknown [203.254.199.244]) by eucas1p2.samsung.com (KnoxPortal) with ESMTP id 20180910150930eucas1p2f0783261fe1b501c642a227b69b4172b~TEnAY1z280172401724eucas1p2y; Mon, 10 Sep 2018 15:09:30 +0000 (GMT) Received: from eucas1p2.samsung.com ( [182.198.249.207]) by eusmges2new.samsung.com (EUCPMTA) with SMTP id 80.6D.04294.A29869B5; Mon, 10 Sep 2018 16:09:30 +0100 (BST) Received: from eusmtrp2.samsung.com (unknown [182.198.249.139]) by eucas1p1.samsung.com (KnoxPortal) with ESMTPA id 20180910150929eucas1p13e835c21a7285d438ab0316af442af48~TEm-Zmdn72278922789eucas1p1X; Mon, 10 Sep 2018 15:09:29 +0000 (GMT) Received: from eusmgms1.samsung.com (unknown [182.198.249.179]) by eusmtrp2.samsung.com (KnoxPortal) with ESMTP id 20180910150929eusmtrp2cb0e4b4c11a2e01c646bd49abffda044~TEm-IMVJt0245002450eusmtrp2G; Mon, 10 Sep 2018 15:09:29 +0000 (GMT) X-AuditID: cbfec7f4-835ff700000010c6-94-5b96892ae499 Received: from eusmtip1.samsung.com ( [203.254.199.221]) by eusmgms1.samsung.com (EUCPMTA) with SMTP id C4.0A.04284.929869B5; Mon, 10 Sep 2018 16:09:29 +0100 (BST) Received: from [106.109.129.180] (unknown [106.109.129.180]) by eusmtip1.samsung.com (KnoxPortal) with ESMTPA id 20180910150928eusmtip1ffe386c0caa60b9c3da2dd8ef1790e35~TEm_j41fj1776417764eusmtip1V; Mon, 10 Sep 2018 15:09:28 +0000 (GMT) To: Stephen Hemminger Cc: dev@dpdk.org, Jingjing Wu , Konstantin Ananyev , Wenzhuo Lu , Beilei Xing , Qi Zhang , Xiao Wang , Bruce Richardson From: Ilya Maximets Date: Mon, 10 Sep 2018 18:11:10 +0300 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.9.1 MIME-Version: 1.0 In-Reply-To: <20180905141059.5218b455@shemminger-XPS-13-9360> Content-Language: en-GB Content-Transfer-Encoding: 7bit X-Brightmail-Tracker: H4sIAAAAAAAAA02Se0hTYRjG+c45285GW8dp7UXLYhmULE0pOETOrjCCwKJAkqiZJ125KZuX jEApzVulFG1zipckL5Mo8jKVVFzDpUb5h6GWkaQp85qXgbc0t2Pkf7/3ed7vfd8HPhIX13K8 SZUmgdFqlLFSroBo6Fj6fMg/Wx9xeLCfT+f+TsfofnMoPT1nwejezCUeXVA6j+iZ1RcEbXiT x6XLB33p+o9/EN029p53QqBYLn3JUZS/c2CKR53FmOJJnRmFEVcEx6OYWFUSow2UXxfEDHUV EvG/OHcM7R1YGmoichCfBOoI6HttGywgxVQVggpjH4ctFhBkL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+QtWiBpBiZMz n4DVcArYSpye8ZsJYr66xJ95l5ghbHGJpi8rWSFseYntb+cwT2AUmoWkfRaSlllIWmYhaVnA yLKKUSS1tDg3PbfYUK84Mbe4NC9dLzk/dxMjMAa3Hfu5eQfjpY3BhxgFOBiVeHgvZE2LFmJN LCuuzD3EKMHBrCTCu0sHKMSbklhZlVqUH19UmpNafIjRFOi5icxSosn5wPSQVxJvaGpobmFp aG5sbmxmoSTOe96gMkpIID2xJDU7NbUgtQimj4mDU6qBcerEhLALeg9K5zmV/ZwTFpOTyLqq 7b+UC9sMq5PHX4YvbudMVfvfnvE+v99lZtOy7n+WWwW/HZXk1+U7s+5Bd11chu/7lXrX/hT8 U5P5+M5lu7TNxaCXCy/Yfz/Zncy4nuXT4u/ztJerJ+2/EP99usHf/3bO3QV9bNI3sz7nnZ1d neK3/MTbKiWW4oxEQy3mouJEACd0YCHXAgAA Message-Id: <20180910150929eucas1p13e835c21a7285d438ab0316af442af48~TEm-Zmdn72278922789eucas1p1X@eucas1p1.samsung.com> X-CMS-MailID: 20180910150929eucas1p13e835c21a7285d438ab0316af442af48 X-Msg-Generator: CA Content-Type: text/plain; charset="utf-8" X-RootMTR: 20180903144615eucas1p1d7377fa285a86f522f29c2a9528a638e X-EPHeader: CA CMS-TYPE: 201P X-CMS-RootMailID: 20180903144615eucas1p1d7377fa285a86f522f29c2a9528a638e References: <20180903144311eucas1p2b6499c49dbd0d54334e973113cdc5ad6~Q6vBsFYRm1033710337eucas1p2D@eucas1p2.samsung.com> <20180903144615eucas1p1d7377fa285a86f522f29c2a9528a638e~Q6xtl-i3s2361123611eucas1p1Q@eucas1p1.samsung.com> <20180905141059.5218b455@shemminger-XPS-13-9360> Subject: Re: [dpdk-dev] [PATCH v1 1/2] eal: add nanosleep based delay function X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 10 Sep 2018 15:09:32 -0000 On 05.09.2018 16:10, Stephen Hemminger wrote: > On Mon, 3 Sep 2018 17:47:42 +0300 > Ilya Maximets wrote: > >> >> +void __rte_experimental >> +rte_delay_us_sleep(unsigned int us) >> +{ >> + struct timespec wait[2]; >> + int ind = 0; >> + >> + wait[0].tv_sec = 0; >> + if (us >= US_PER_S) { >> + wait[0].tv_sec = us / US_PER_S; >> + us -= wait[0].tv_sec * US_PER_S; >> + } >> + wait[0].tv_nsec = 1000 * us; >> + >> + while (nanosleep(&wait[ind], &wait[1 - ind]) == EINTR) >> + ind = 1 - ind; >> +} >> + > > This seems like a complex/tricky way to handle the case where > nanosleep is interrupted. It needs a comment. OK. I can add some comment here. Best regards, Ilya Maximets.