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 ACD82A04E0 for ; Wed, 27 Nov 2019 15:49:45 +0100 (CET) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id B4B641B9A9; Wed, 27 Nov 2019 15:49:43 +0100 (CET) Received: from smtp-3.sys.kth.se (smtp-3.sys.kth.se [130.237.48.192]) by dpdk.org (Postfix) with ESMTP id C1A512B9C; Wed, 27 Nov 2019 15:49:40 +0100 (CET) Received: from smtp-3.sys.kth.se (localhost.localdomain [127.0.0.1]) by smtp-3.sys.kth.se (Postfix) with ESMTP id 7119B59CD; Wed, 27 Nov 2019 15:49:40 +0100 (CET) X-Virus-Scanned: by amavisd-new at kth.se Received: from smtp-3.sys.kth.se ([127.0.0.1]) by smtp-3.sys.kth.se (smtp-3.sys.kth.se [127.0.0.1]) (amavisd-new, port 10024) with LMTP id FDwWSB6P3L5V; Wed, 27 Nov 2019 15:49:39 +0100 (CET) X-KTH-Auth: barbette [2a02:a03f:4075:6000:ed8c:20a3:119e:2074] DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kth.se; s=default; t=1574866179; bh=gnIXURD0B2Iu+2B/r0k2jNEZzW0Jdaz0nYXGwvY2Vww=; h=Subject:To:Cc:References:From:Date:In-Reply-To; b=Y1TqORHbWdFMUQIai/QjZUYMFOKF3vcxhjNgGaeGo/ugT2/uzm82Nt4yoFq3wf0pI T+MpTrFXSS66sj2Ztr6feYJAA87hRjGDUqBgV7c++bofGvbQNAswG0+rahHxHSpjxz tsY2b3+PUtXdpcUYxLMQDLu+vaMY8IBofeo7fQq0= X-KTH-mail-from: barbette@kth.se Received: from [IPv6:2a02:a03f:4075:6000:ed8c:20a3:119e:2074] (unknown [IPv6:2a02:a03f:4075:6000:ed8c:20a3:119e:2074]) by smtp-3.sys.kth.se (Postfix) with ESMTPSA id 862B65784; Wed, 27 Nov 2019 15:49:38 +0100 (CET) To: Gokul Bargaje , Ferruh Yigit Cc: dev@dpdk.org, users@dpdk.org References: <6a0d3205-e506-c0cb-3482-3224b875c650@intel.com> From: Tom Barbette Message-ID: <96ea0210-3a6f-9f77-8924-6e14df5785b4@kth.se> Date: Wed, 27 Nov 2019 15:49:37 +0100 User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:68.0) Gecko/20100101 Thunderbird/68.2.2 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: fr Content-Transfer-Encoding: 8bit Subject: Re: [dpdk-users] What is the 'unit of timestamp' assigned to mbuf packet in DPDK? X-BeenThere: users@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: DPDK usage discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: users-bounces@dpdk.org Sender: "users" Hi Gokul, As Setphen said, only Mellanox sets the hardware timestamp. If you have a Mellanox card, you can actually follow the example given in the rxtx_callback sample application that precisely gives the number of CPU cycles a packet spent into the queue. Tom Le 22/11/2019 à 18:00, Gokul Bargaje a écrit : > Thank you for the clarification. But I am still unable to understand how > exactly timestamp is calculated before assigning to a timestamp field. > Could you please tell me the steps to calculate the timestamp in DPDK? > > I have to implement the PIE AQM algorithm in DPDK and for that, I need to > calculate the total time spent by the packet waiting in queue (i.e. the > difference between enqueue time and dequeue time). > > Thanks, > Gokul > > On Fri, Nov 22, 2019 at 8:18 PM Ferruh Yigit wrote: > >> On 11/18/2019 2:29 PM, Gokul Bargaje wrote: >>> Hi, >>> >>> The timestamp assigned to packet at the time of enqueue (value of >> timestamp >>> field in mbuf), is it in milliseconds or microseconds or in cpu cycles? >> >> The unit is not defined [1]. 'rte_eth_read_clock()' was added [2] to help >> converting it to time when it is clock counter. >> >> [1] >> 918ae9dc775e ("mbuf: add a timestamp field") >> >> [2] >> 5e741377657c ("ethdev: add API to read device clock") >> >>> >>> How this timestamp is calculated? Is it calculated using the >> *rte_cycles.h*? >>> >> >> >> >> >> >>