From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-wr0-f178.google.com (mail-wr0-f178.google.com [209.85.128.178]) by dpdk.org (Postfix) with ESMTP id 15007201 for ; Fri, 17 Feb 2017 14:38:32 +0100 (CET) Received: by mail-wr0-f178.google.com with SMTP id c4so30078071wrd.2 for ; Fri, 17 Feb 2017 05:38:32 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:sender:in-reply-to:references:from:date:message-id :subject:to:cc; bh=LgezMSQNUGDdtE7s4/DNhbTpcIPDnhorh8pmT0exCno=; b=Pv0EyoVXDzKordYkmY+GUEmv96EhXeawRZvVo9HJaTD6TWc/fGRwPZsBqn6maEIAQy ROMcAF0P6rQF1Nc10ZcBwxQYvs9KbMo8TcH249TTPJ5H5IGOcbohSGZtl2n+PYReku3A m+GpjtH1lcllqyPoOGaPDJP0vCO5pgj2RNLFMG7JoX3qR1tifFyWcje3Jn8i8/eAzNtK rLSW1J1GyZdVYy75b5laS7eoBkF5BzM76NmzFvBk20Hq6bu6Vy1HHUBV/z6ExFh+Odvm t2PEEAzDKRqrY1BrNPR8m8OEKrMnhm9i9rwTQv8JA3VFcTaZq9l/DhfHl/e62rljXlkO TKQw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:sender:in-reply-to:references:from :date:message-id:subject:to:cc; bh=LgezMSQNUGDdtE7s4/DNhbTpcIPDnhorh8pmT0exCno=; b=srWu6/zeP7vyl3k+DYa6Y0J8CtawUdrcubyKZzZxof2ETQTM2KtXpZp9LhzduEJHA+ hvqIMbsXbBlJl+VyDWt8cQHOQyJy2pDKh4zjuZfPeOMlO4pjOaais4euljCBRsMnowb/ pY606h+nAHoDNuERctghkoqU6Iyhml38Lk4nZITO8g2rfRZGGJb+8xAONi9YmNS/qqn4 VSRRpQwQBHMr/ClBX0ZWKrzXdMkRnc9KgQO9YcYA/S2nJSCucfQpyOiCoDWAmsO5iCus 1ostX8BTc8fsMUa+Ri+dtZT2429+U7nDE+vD/IDHL0qN8PInhYxaVdkjATaxal1cR8Uj xpXg== X-Gm-Message-State: AMke39nqrNRRejoNfDpH2SZpAeMsh/WKtCc3GNDf88oJSL/kX2IsggHfRXsX3K2+9k05VOzG8Eeek8XZUsTX6w== X-Received: by 10.223.170.221 with SMTP id i29mr7600540wrc.131.1487338712669; Fri, 17 Feb 2017 05:38:32 -0800 (PST) MIME-Version: 1.0 Sender: jblunck@gmail.com Received: by 10.28.211.20 with HTTP; Fri, 17 Feb 2017 05:38:32 -0800 (PST) In-Reply-To: <20170217115153.0afeb061@platinum> References: <1485271173-13408-1-git-send-email-olivier.matz@6wind.com> <2601191342CEEE43887BDE71AB9772583F111A29@irsmsx105.ger.corp.intel.com> <20170216144807.7add2c71@platinum> <20170217115153.0afeb061@platinum> From: Jan Blunck Date: Fri, 17 Feb 2017 14:38:32 +0100 X-Google-Sender-Auth: _MJMbIR8u-YN2gCAIzmAea3vajM Message-ID: To: Olivier Matz Cc: "Ananyev, Konstantin" , "dev@dpdk.org" Content-Type: text/plain; charset=UTF-8 Subject: Re: [dpdk-dev] [RFC 0/8] mbuf: structure reorganization 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: , X-List-Received-Date: Fri, 17 Feb 2017 13:38:33 -0000 On Fri, Feb 17, 2017 at 11:51 AM, Olivier Matz wrote: > Hi Jan, > > On Thu, 16 Feb 2017 18:26:39 +0100, Jan Blunck > wrote: >> On Thu, Feb 16, 2017 at 2:48 PM, Olivier Matz >> wrote: >> > On Mon, 6 Feb 2017 18:41:27 +0000, "Ananyev, Konstantin" >> > wrote: >> >> > >> >> > The main changes are: >> >> > - reorder structure to increase vector performance on some non-ia >> >> > platforms. >> >> > - add a 64bits timestamp field in the 1st cache line >> >> >> >> Wonder why it deserves to be in first cache line? >> >> How it differs from seqn below (pure SW stuff right now). >> > >> > In case the timestamp is set from a NIC value, it is set in the Rx >> > path. So that's why I think it deserve to be located in the 1st >> > cache line. >> > >> > As you said, the seqn is a pure sw stuff right: it is set in a lib, >> > not in a PMD rx path. >> > >> >> If we talk about setting the timestamp value in the RX path this >> implicitly means software timestamps. Hardware timestamping usually >> works by letting the hardware inject sync events for coarse time >> tracking and additionally injecting fine granular per-packet ticks at >> a specific offset in the packet. Out of performance reasons I don't >> think it makes sense to extract this during the burst and write it >> into the mbuf again. > > From what I've understand, at least it does not work like this for > mellanox NICs: timestamp is a metadata attached to a rx packet. But > maybe they (and other NIC vendors interrested in the feature) can > confirm or not. > Mellanox NICs use a 48bit cycle counter split into a high and low part. To convert the cycle values into a timestamp you need to initialize and maintainer a timecounter that shifts the cycle count e.g. nanosecs. IIRC Mellanox doesn't generate explicit clock events but the cycle counter is large enough so that the user can easily maintain the timecounter by manually updating it. >> >> The problem with timestamps is to get the abstraction right wrt the >> correction factors and the size of the tick vs. the timestamp in the >> events injected. From my perspective it would be better to extract the >> handling of timestamp data into a library with PMD specific >> implementation of the conversions. That way the normalized timestamp >> values can get extracted if they are present. The mbuf itself would >> only indicate the presence of timestamp metadata in that case. > > I agree however that we need to properly define the meaning of this > field. My idea is: > > - the timestamp is in nanosecond > - the reference is always the same for a given path: if the timestamp is > set in a PMD, all the packets for this PMD will have the same > reference, but for 2 different PMDs (or a sw lib), the reference > would not be the same. > > I think it's enough for many use cases. > We can later add helpers to compare timestamps with different > references. My point is that I still doubt that it belongs into the first cacheline. It requires accessing other structures for converting into nanoseconds anyway. Optimally I would like to see this happening on access instead but if that isn't achievable at least in a second step.