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 1CAB0A00C5; Thu, 7 May 2020 22:54:08 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 8E9931DC03; Thu, 7 May 2020 22:54:07 +0200 (CEST) Received: from mail-lf1-f66.google.com (mail-lf1-f66.google.com [209.85.167.66]) by dpdk.org (Postfix) with ESMTP id 2342B1DC00 for ; Thu, 7 May 2020 22:54:06 +0200 (CEST) Received: by mail-lf1-f66.google.com with SMTP id t11so5671099lfe.4 for ; Thu, 07 May 2020 13:54:06 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=date:from:to:cc:subject:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=TCh6Ww6TRrd3pZZIuCgu0deiUAaYFIFockJHapWfhpk=; b=RCyjK/RJW1boDz2EF6ZSDu7lwszXYKMkqMSBJF3md1WuIKcpZwoQdnCS1Gq9lW86fr BJQ7XFZ6g28mWo39NWJ4qpMfCfIwHteFDE1IoNm0obo3Atxzgg/uDbbYch++/dW/Py68 qhRpe/m0SuOX0MVdaKu1A0fJI55c1uoJAl7xwNR+nJuwAj0TcHjB6B5VaNM55/3xVA4F Dab6GoVy5wuDBMqp7kXW9wFBahNrSkWrRgEGqyFW/98Yz0jsXtLhIGW/EgcHMFPMux8a srnStG6hrh1JMhu05p5OOF0UOVDWNTzm93zugqm5NTnlQl6d7z7+WPHbG80+pGbDXwpI PbeQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=TCh6Ww6TRrd3pZZIuCgu0deiUAaYFIFockJHapWfhpk=; b=Vm4sMobklYiOuMt0gO43JWW8KFWu7asUg40YsjE7BeVXjETTw3lH44HlyHUg3EaqeD 1Wg7LSEdK7b7kbvlZZNsLFFVI+oxQyh8lF0UMwRSUVV4ILATwt3d6PvpUA6JAym1lmwE UIzSeE8x3zAy+5tmLLX95jh2JbJF7kAVwOieWY3ZQZRUjfHrvfL59OMaeng0z9Cq1wOQ beX8XzzFxeyJJheUUPr14GTEFUTmdyYyE5Fof+HvYj2XwSpFnOQxXuPYNfHYW0WlrKvP IcoB13PMFSRJ8BOogGRHDzFfY4OHMa5EVyuIBgyCvXAm5ny1RcGoJ9ZaS8kZgwWhMQOU LsZQ== X-Gm-Message-State: AOAM532WI1ZC3/gBtWAEJBv4em5jb5L6MxxEfnQ3hMHJOmj/pxUUhbH3 CetN7HENbthUNlS/jhuf0ZU= X-Google-Smtp-Source: ABdhPJycewDGaBZDWrooZDUhb5CihuLSDQMF1AVuPsF6MYuDZL3NZxiA3ry4oWa0ADU0fqGh8Yt6gQ== X-Received: by 2002:a19:c6c5:: with SMTP id w188mr411235lff.65.1588884845527; Thu, 07 May 2020 13:54:05 -0700 (PDT) Received: from Sovereign (broadband-37-110-65-23.ip.moscow.rt.ru. [37.110.65.23]) by smtp.gmail.com with ESMTPSA id a26sm4515769ljm.45.2020.05.07.13.54.04 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 07 May 2020 13:54:04 -0700 (PDT) Date: Thu, 7 May 2020 23:54:04 +0300 From: Dmitry Kozlyuk To: Fady Bader Cc: dev@dpdk.org, thomas@monjalon.net, talshn@mellanox.com, dmitry.kozliuk@gmail.com, yohadt@mellanox.com, harini.ramakrishnan@microsoft.com, ocardona@microsoft.com, anand.rawat@intel.com, ranjit.menon@intel.com Message-ID: <20200507235404.46605f64@Sovereign> In-Reply-To: <20200507130531.624-4-fady@mellanox.com> References: <20200507130531.624-1-fady@mellanox.com> <20200507130531.624-4-fady@mellanox.com> X-Mailer: Claws Mail 3.17.5 (GTK+ 2.24.32; x86_64-pc-linux-gnu) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Subject: Re: [dpdk-dev] [PATCH v5 3/3] timer: support EAL functions on Windows 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: , Errors-To: dev-bounces@dpdk.org Sender: "dev" On 2020-05-07 16:05 GMT+0300 Fady Bader wrote: > Implemented the needed Windows eal timer functions. [snip] > +void > +rte_delay_us_sleep(unsigned int us) > +{ > + LARGE_INTEGER start, end; > + LARGE_INTEGER freq; > + > + QueryPerformanceCounter(&start); > + QueryPerformanceFrequency(&freq); > + > + LARGE_INTEGER ticks; > + ticks.QuadPart = freq.QuadPart * us / US_PER_SEC; > + > + QueryPerformanceCounter(&end); > + while ((end.QuadPart - start.QuadPart) < ticks.QuadPart) { > + rte_pause(); > + QueryPerformanceCounter(&end); > + } > +} Your previous implementation was correct, this one is not. Per documentation, rte_delay_us_sleep() should *sleep* in an OS-dependent way, like you did with waitable timers previously, while rte_delay_us() does a busy loop like this. Please restore this function from v4, the rest LGTM. P.S. Fixed my email in Cc. -- Dmitry Kozlyuk