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 50F44A04DD for ; Thu, 28 Nov 2019 09:28:50 +0100 (CET) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 98BBF1BF70; Thu, 28 Nov 2019 09:28:47 +0100 (CET) Received: from mx0b-0016f401.pphosted.com (mx0b-0016f401.pphosted.com [67.231.156.173]) by dpdk.org (Postfix) with ESMTP id 2B1212C52; Thu, 28 Nov 2019 09:28:44 +0100 (CET) Received: from pps.filterd (m0045851.ppops.net [127.0.0.1]) by mx0b-0016f401.pphosted.com (8.16.0.42/8.16.0.42) with SMTP id xAS8QDMi000687; Thu, 28 Nov 2019 00:28:43 -0800 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=marvell.com; h=from : to : cc : subject : date : message-id : references : in-reply-to : content-type : content-id : content-transfer-encoding : mime-version; s=pfpt0818; bh=rZYOYsQ9gqduUT0If3k7WPkV73V7whMlqzjYN9AlhKU=; b=CbVkgxgcrwEzXULNfAAoq8CI0yObVR5vXo1gl/h4proQwTMaaPl110qgkXYkXDDtjLsC 5OdoNtZnOOYTWAxO2as1E0dncofj34VX3MjOgfwYR/xgJbGP0cdEyGvSVs8kJCisJHMB 4VybIMAo6L2h5Karb3lh/93aPqBQrUoTHQUQNFn+VP86aFGRTVLkQdZ0fPghb4/A9U6M 9t9FJXtMO76L6AQP5dTaHcGsA7RiBf2Htu42T048hjjitZFX239Sj4faWNCmMUmP+6x2 2o4tUpBAiA9OciTp7BVdQkqJaFjLkR+nGTr/j37cd+FVMyuqu6734TRfpBSAjCMwembL 7w== Received: from sc-exch03.marvell.com ([199.233.58.183]) by mx0b-0016f401.pphosted.com with ESMTP id 2whd08pgb9-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-SHA384 bits=256 verify=NOT); Thu, 28 Nov 2019 00:28:43 -0800 Received: from SC-EXCH01.marvell.com (10.93.176.81) by SC-EXCH03.marvell.com (10.93.176.83) with Microsoft SMTP Server (TLS) id 15.0.1367.3; Thu, 28 Nov 2019 00:28:40 -0800 Received: from NAM04-CO1-obe.outbound.protection.outlook.com (104.47.45.50) by SC-EXCH01.marvell.com (10.93.176.81) with Microsoft SMTP Server (TLS) id 15.0.1367.3 via Frontend Transport; Thu, 28 Nov 2019 00:28:39 -0800 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=WDOw/fIoV9YOfdJ65R6UDabZCy/zS3rEUkzyX/ml2Mz1lfjBZlkDoadEwz+5Uf/FTlL7B6zA+ztF6k2mN3JKhIN7/O2K7KM66cnMzmx2xVuUMuF9ou4b89J0bQAXBcUxsixV8OQihraKz4y5mVe6BxPRmjcSwqRSWHODYUziHg7m2LmQstCNAzqsBbFoChIY7ZvwYnT4hUvVv5zmrVYp5yc3RYFIotudwPDq+bbecZoHgq1ulpSjtvbjvXxQbodfeRWBlcIY0DiViJWnL87GyR+LACUdk1UBgpQ92sxIqSzG9egbD/8h9lHPlCu/fAnAqZgrg376DGki/IBqDLuJZg== 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=rZYOYsQ9gqduUT0If3k7WPkV73V7whMlqzjYN9AlhKU=; b=A/IPojbTgnVUXlPk5ImIsnxNJ5hcKw4Nj8zMJWx1Hmz39HTo5bq6pn0aqjZt8O3fPBB1GEeWbr2R1wcY9714qdpBw/lbn+157jKtAoSTl5t1tWWu0k58OR2G5OB4fL+8qBGzUsqjYZRKt5UNeJlsqdjVp29DJsTE/aa7QlbNl9SkXvTXe0B/qCG95+VZfs3hHXMQhYY+83l03PMUVY37oVc7xmhae62wXyzTD6JT+cPC6i9UxyLrenTA+N8FZBK1f95PB/M30mlUw2kp1qsCt5j8JXqJjnBbpCQuv4M38msoG9DrmdkmXOVvkctoksid3JZS9gbgzFPhNirpt0EO0Q== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=marvell.com; dmarc=pass action=none header.from=marvell.com; dkim=pass header.d=marvell.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=marvell.onmicrosoft.com; s=selector1-marvell-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=rZYOYsQ9gqduUT0If3k7WPkV73V7whMlqzjYN9AlhKU=; b=Ivz+Cym8DpzM+ZsYc4XDCBaHsNfd/k6PgBcE6JlAY/JZkjQX/za9wqGGllTBCSmoMKMWcyVNQF+pOrvBuPrRmVvkgZ+snBg7WLXwgGQ2QQmzuRfU/EDLNx7QmYvabdoBXh9A12KQl2ez57uh4+gBxHthy9FGlKmq5tPjcZNla+U= Received: from MN2PR18MB2848.namprd18.prod.outlook.com (20.179.21.149) by MN2PR18MB2925.namprd18.prod.outlook.com (20.179.20.17) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2495.19; Thu, 28 Nov 2019 08:28:38 +0000 Received: from MN2PR18MB2848.namprd18.prod.outlook.com ([fe80::a8a7:cb5b:a6a6:9693]) by MN2PR18MB2848.namprd18.prod.outlook.com ([fe80::a8a7:cb5b:a6a6:9693%7]) with mapi id 15.20.2474.023; Thu, 28 Nov 2019 08:28:38 +0000 From: Harman Kalra To: Gokul Bargaje CC: Ferruh Yigit , "dev@dpdk.org" , "users@dpdk.org" Thread-Topic: [dpdk-dev] [dpdk-users] What is the 'unit of timestamp' assigned to mbuf packet in DPDK? Thread-Index: AQHVoUP1KG4W7MFnPkCCD9cD179lx6eXahKAgAje/oA= Date: Thu, 28 Nov 2019 08:28:38 +0000 Message-ID: <20191128082822.GA55554@outlook.office365.com> References: <6a0d3205-e506-c0cb-3482-3224b875c650@intel.com> In-Reply-To: Accept-Language: en-GB, en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-clientproxiedby: BM1PR01CA0116.INDPRD01.PROD.OUTLOOK.COM (2603:1096:b00::32) To MN2PR18MB2848.namprd18.prod.outlook.com (2603:10b6:208:3e::21) x-ms-exchange-messagesentrepresentingtype: 1 x-originating-ip: [115.113.156.2] x-ms-publictraffictype: Email x-ms-office365-filtering-correlation-id: 683ddf78-5a5f-4808-d40f-08d773dcf7a3 x-ms-traffictypediagnostic: MN2PR18MB2925: x-microsoft-antispam-prvs: x-ms-oob-tlc-oobclassifiers: OLM:10000; x-forefront-prvs: 0235CBE7D0 x-forefront-antispam-report: SFV:NSPM; SFS:(10009020)(4636009)(396003)(376002)(366004)(39860400002)(136003)(346002)(199004)(189003)(81166006)(229853002)(66946007)(66556008)(64756008)(66476007)(99286004)(6486002)(5660300002)(66446008)(54906003)(478600001)(14454004)(6916009)(305945005)(25786009)(71190400001)(7736002)(256004)(71200400001)(1076003)(2906002)(11346002)(8676002)(33656002)(8936002)(66066001)(4326008)(81156014)(6512007)(9686003)(3846002)(52116002)(6246003)(316002)(2171002)(86362001)(296002)(186003)(102836004)(26005)(53546011)(76176011)(55236004)(386003)(6116002)(446003)(6506007)(6436002); DIR:OUT; SFP:1101; SCL:1; SRVR:MN2PR18MB2925; H:MN2PR18MB2848.namprd18.prod.outlook.com; FPR:; SPF:None; LANG:en; PTR:InfoNoRecords; A:1; MX:1; received-spf: None (protection.outlook.com: marvell.com does not designate permitted sender hosts) x-ms-exchange-senderadcheck: 1 x-microsoft-antispam: BCL:0; x-microsoft-antispam-message-info: 9ln+oCC3FzQK7HTGgk3NHM5O2jSo46+0x/aL4GmNLlreG2BAGyQN4zOwHFkkPSx/d8iZ27Wjfk/4hQtEObQQDGuexGvvtEfPruBPkjF/59wagGhhnCan27Ld3OaDrfSNKfPk4VQfAyN2NUznE5Ka1WVZJpqPFDM2crmcP4I3/H8gOfHPyFJye87VJFUBfW6jUSqzyoGGbFuZQyh1J3yf3vZ4viFFLkDT1JPbHPpKDvtfcdCRdW0y+6nTp8k4oAR9i0LiO6uAma/kd683QSJ8rft+B9IGBYhk7bAn4IQQekdgnx9VW8cP8x2HyFRqN+frm4fSItXZ3kCMfQIveyJQnFPUx8MidHdLb2U8nR7+FaoHx/eQfgJw562c4JgacXCIx4UiQLxOQSikKAUBGSB0xWseJl3ZnCIny9TzTUVOrmPMHvoclKMmaTwcws5qiE52 x-ms-exchange-transport-forked: True Content-Type: text/plain; charset="us-ascii" Content-ID: <5ED42D66A2F29C448C193E5109FC37FE@namprd18.prod.outlook.com> Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-MS-Exchange-CrossTenant-Network-Message-Id: 683ddf78-5a5f-4808-d40f-08d773dcf7a3 X-MS-Exchange-CrossTenant-originalarrivaltime: 28 Nov 2019 08:28:38.4940 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 70e1fb47-1155-421d-87fc-2e58f638b6e0 X-MS-Exchange-CrossTenant-mailboxtype: HOSTED X-MS-Exchange-CrossTenant-userprincipalname: ixRKePnXF5RqeyyqbbtZKOZsprKWGmQzgJCA0bpg4hherNB4+NSgqbSPPZWshlbesNDVfAi1VS+QCPHKTf/pPg== X-MS-Exchange-Transport-CrossTenantHeadersStamped: MN2PR18MB2925 X-OriginatorOrg: marvell.com X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10434:6.0.95,18.0.572 definitions=2019-11-28_01:2019-11-28,2019-11-28 signatures=0 Subject: Re: [dpdk-users] [dpdk-dev] 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" On Fri, Nov 22, 2019 at 10:30:11PM +0530, Gokul Bargaje wrote: > 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? >=20 > 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). >=20 > Thanks, > Gokul Hi Gokul octeontx2 also suports hardware timestamping, as soon as packet enter the NIC queue, MAC writes the timestamp value to a memory location (which is later read in mbuf->timestamp). Later using 'rte_eth_read_clock()' one can read the timestamp clock. Hence "mbuf->timestamp - rte_eth_read_clock()" gives the time spent by packet when it entered the queue to that point. As everybody suggested you can refer rxtx_callback for more clarity.=20 Octeontx2 driver also has 'rte_eth_read_clock()' eth op implemented Thanks Harman >=20 > On Fri, Nov 22, 2019 at 8:18 PM Ferruh Yigit wro= te: >=20 > > 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 cycle= s? > > > > The unit is not defined [1]. 'rte_eth_read_clock()' was added [2] to he= lp > > 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*? > > > > > > > > > > > > > > >