From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from EUR01-DB5-obe.outbound.protection.outlook.com (mail-db5eur01on0074.outbound.protection.outlook.com [104.47.2.74]) by dpdk.org (Postfix) with ESMTP id 2C3E15679 for ; Thu, 20 Oct 2016 10:03:47 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=Mellanox.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version; bh=eKftYQU1v7Zq2Ywz1UZmbaFBuHwmEZ8QPFStKuw2y4E=; b=fPX6NepdAQsQ94V7cqTTr7UCrXyQyAgss7GTuXlT/Uy5xA5MLlG5YdZ6fb6i3AcHGy/zgJ6ZtMXaf8jzCHS1HdG8WYs/J8lejRT7iK6E5Wqm49FUb7PWOU2kfRFKHhjf5+6o2PDiEdcQ2WOxprG93h49P8n5fjBTIvIQWOmKu7k= Received: from AM4PR0501MB2785.eurprd05.prod.outlook.com (10.172.216.17) by AM4PR0501MB2785.eurprd05.prod.outlook.com (10.172.216.17) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P384) id 15.1.659.11; Thu, 20 Oct 2016 08:03:46 +0000 Received: from AM4PR0501MB2785.eurprd05.prod.outlook.com ([10.172.216.17]) by AM4PR0501MB2785.eurprd05.prod.outlook.com ([10.172.216.17]) with mapi id 15.01.0659.025; Thu, 20 Oct 2016 08:03:46 +0000 From: Oleg Kuporosov To: "Ananyev, Konstantin" , Olivier Matz , "dev@dpdk.org" Thread-Topic: [dpdk-dev] [PATCH 1/3] mbuf: embedding timestamp into the packet Thread-Index: AQHSJV8MMXGUm6DqMkSJqHfcr2VXyKCuYhiAgAFtRwCAAEbLIA== Date: Thu, 20 Oct 2016 08:03:46 +0000 Message-ID: References: <1476369308-17021-1-git-send-email-olegk@mellanox.com> <1476369308-17021-2-git-send-email-olegk@mellanox.com> <2601191342CEEE43887BDE71AB9772583F0C3319@irsmsx105.ger.corp.intel.com> In-Reply-To: <2601191342CEEE43887BDE71AB9772583F0C3319@irsmsx105.ger.corp.intel.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: authentication-results: spf=none (sender IP is ) smtp.mailfrom=olegk@mellanox.com; x-originating-ip: [82.208.101.48] x-ms-office365-filtering-correlation-id: 21d8962a-4352-4b1e-893a-08d3f8bf9e23 x-microsoft-exchange-diagnostics: 1; AM4PR0501MB2785; 7:X2rRtC0MqQU3sMzqCU72WgnYapJB6vhat4zjxFtfeqwJ2EDSpVzobi9OMyT3AjnzxnkHHtEBhQjlFoATNAKSOGHE43rPmHx1VFVO93e0x6NzlNH5tZD/dOSJg06TrISeOe/CSmqSY4Lml1ecVyo2VmlZrxFA679pTe31MQuvMK8x//V46c4oSrTA6tZK42Tx2+CnkcQ6wdVj0SwNpeqJ5Ar6Niyxb23Uz32e01ikOr7AqmqgnzQlGTVvV1KlhNwwKUK5Vc9Wm/sNifOlt+hbT+v31UwVXQACyqAdwm6i+QA/H6BI6TIj58Cydy1cIR1fKecqojkFXOpCGLZ5fzx16uWdUrf312dFg+/rKeTuP2U= x-microsoft-antispam: UriScan:;BCL:0;PCL:0;RULEID:;SRVR:AM4PR0501MB2785; x-microsoft-antispam-prvs: x-exchange-antispam-report-test: UriScan:(278428928389397); x-exchange-antispam-report-cfa-test: BCL:0; PCL:0; RULEID:(6040176)(601004)(2401047)(5005006)(8121501046)(3002001)(10201501046)(6055026); SRVR:AM4PR0501MB2785; BCL:0; PCL:0; RULEID:; SRVR:AM4PR0501MB2785; x-forefront-prvs: 01018CB5B3 x-forefront-antispam-report: SFV:NSPM; SFS:(10009020)(6009001)(7916002)(189002)(199003)(106356001)(50986999)(101416001)(107886002)(189998001)(97736004)(106116001)(3660700001)(105586002)(68736007)(2501003)(3280700002)(2950100002)(76576001)(7846002)(54356999)(76176999)(5001770100001)(7736002)(586003)(77096005)(305945005)(3846002)(6116002)(92566002)(93886004)(102836003)(2900100001)(66066001)(5002640100001)(10400500002)(74316002)(11100500001)(2906002)(9686002)(8936002)(81156014)(86362001)(122556002)(8676002)(87936001)(81166006)(5660300001)(7696004)(33656002); DIR:OUT; SFP:1101; SCL:1; SRVR:AM4PR0501MB2785; H:AM4PR0501MB2785.eurprd05.prod.outlook.com; FPR:; SPF:None; PTR:InfoNoRecords; MX:1; A:1; LANG:en; received-spf: None (protection.outlook.com: mellanox.com does not designate permitted sender hosts) spamdiagnosticoutput: 1:99 spamdiagnosticmetadata: NSPM Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-OriginatorOrg: Mellanox.com X-MS-Exchange-CrossTenant-originalarrivaltime: 20 Oct 2016 08:03:46.3071 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: a652971c-7d2e-4d9b-a6a4-d149256f461b X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM4PR0501MB2785 Subject: Re: [dpdk-dev] [PATCH 1/3] mbuf: embedding timestamp into the packet X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: patches and discussions about DPDK List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 20 Oct 2016 08:03:47 -0000 Hello Konstantin, >=20 > My vote also would be to have timestamp in the second cache line. > About moving seqn to the 2-nd cache line too - that's probably a fair poi= nt. It may impact throughput till ~6% for applications required such embedded=20 Timestamps. =20 > About the rest of the patch: > Do you really need to put that code into the PMDs itself? > Can't the same result be achieved by using RX callbacks? > Again that approach would work with any PMD and there would be no need > to modify PMD code itself. Correct, the approach with using callbacs (rte_eth_timesync_read_[r|t]x_tim= estamp()) Has also some Cons for this use case: - FSI needs the most accurate stamping as possible by reasons were describe= d in Cover letter - callback will be called from user app and so you have to take into accoun= t=20 Difference between time when packet was released by NIC and callback call - such difference is not easy to estimate correctly due to dependency on CP= U type, Its frequency and current load conditions - even estimated it would be hard without additional performance penalty to= align Packet with timestamp, taking account that call may actually placed from Different thread or even process. It looks the least impacting and correct way is to have timestamp in rte_mb= uf and fill It in Rx burst procedure. > Another thing, that I am in doubt why to use system time? > Wouldn't raw HW TSC value (rte_rdtsc()) do here? System time is being used for periodic clock synchronization between wall clock and NIC to estimate NIC clock deviation. It is in assumption the syst= em itself is synchronized by PTP from master clock. It is run on context of control thre= ad. Thanks, Oleg.