From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id 585B542833; Fri, 24 Mar 2023 17:00:11 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 31BA1406B8; Fri, 24 Mar 2023 17:00:11 +0100 (CET) Received: from smartserver.smartsharesystems.com (smartserver.smartsharesystems.com [77.243.40.215]) by mails.dpdk.org (Postfix) with ESMTP id 937934021F for ; Fri, 24 Mar 2023 17:00:09 +0100 (CET) Content-class: urn:content-classes:message Subject: RE: [RFC v2 2/2] eal: add high-performance timer facility MIME-Version: 1.0 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: base64 Date: Fri, 24 Mar 2023 17:00:07 +0100 Message-ID: <98CBD80474FA8B44BF855DF32C47DC35D87809@smartserver.smartshare.dk> X-MimeOLE: Produced By Microsoft Exchange V6.5 In-Reply-To: <20230315170342.214127-3-mattias.ronnblom@ericsson.com> X-MS-Has-Attach: X-MS-TNEF-Correlator: Thread-Topic: [RFC v2 2/2] eal: add high-performance timer facility Thread-Index: AdlXYPtYFxcYG4bATfqvx9F5GRi2EQHAgzMg References: <20230228093916.87206-1-mattias.ronnblom@ericsson.com> <20230315170342.214127-1-mattias.ronnblom@ericsson.com> <20230315170342.214127-3-mattias.ronnblom@ericsson.com> From: =?UTF-8?B?TW9ydGVuIEJyw7hydXA=?= To: =?UTF-8?B?TWF0dGlhcyBSw7ZubmJsb20=?= , Cc: "Erik Gabriel Carrillo" , "David Marchand" , , "Stefan Sundkvist" , "Stephen Hemminger" , "Tyler Retzlaff" X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org PiBGcm9tOiBNYXR0aWFzIFLDtm5uYmxvbSBbbWFpbHRvOm1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