From mboxrd@z Thu Jan  1 00:00:00 1970
Return-Path: <konstantin.ananyev@intel.com>
Received: from mga05.intel.com (mga05.intel.com [192.55.52.43])
 by dpdk.org (Postfix) with ESMTP id ABCAA2E81
 for <dev@dpdk.org>; Tue, 28 Feb 2017 11:30:03 +0100 (CET)
Received: from fmsmga005.fm.intel.com ([10.253.24.32])
 by fmsmga105.fm.intel.com with ESMTP; 28 Feb 2017 02:30:02 -0800
X-ExtLoop1: 1
X-IronPort-AV: E=Sophos;i="5.35,219,1484035200"; d="scan'208";a="70440685"
Received: from irsmsx106.ger.corp.intel.com ([163.33.3.31])
 by fmsmga005.fm.intel.com with ESMTP; 28 Feb 2017 02:29:42 -0800
Received: from irsmsx105.ger.corp.intel.com ([169.254.7.38]) by
 IRSMSX106.ger.corp.intel.com ([169.254.8.197]) with mapi id 14.03.0248.002;
 Tue, 28 Feb 2017 10:29:42 +0000
From: "Ananyev, Konstantin" <konstantin.ananyev@intel.com>
To: Olivier Matz <olivier.matz@6wind.com>
CC: Jan Blunck <jblunck@infradead.org>, "Richardson, Bruce"
 <bruce.richardson@intel.com>, "dev@dpdk.org" <dev@dpdk.org>
Thread-Topic: [dpdk-dev] [RFC 0/8] mbuf: structure reorganization
Thread-Index: AQHSdlXOvL8VQlbyOU+/T85mDKip26FcYNGAgA9pHoCAAD0PgIABJAiAgAAukACAAArJAIAEZh4AgAGZsQCAAGmrAIAAB0CAgAAHcgCAAANakIAAIcgAgAARDkCABE1sgIAF9CCAgAABN2CAAAaegIAADv0Q
Date: Tue, 28 Feb 2017 10:29:41 +0000
Message-ID: <2601191342CEEE43887BDE71AB9772583F11EA11@irsmsx105.ger.corp.intel.com>
References: <1485271173-13408-1-git-send-email-olivier.matz@6wind.com>
 <20170217115153.0afeb061@platinum>
 <CALe+Z03QtPVmZ39bCaqGvmdsSipKftA_sZqc5K2F1WDjkEUrsg@mail.gmail.com>
 <20170217151708.20bf4a49@platinum>
 <CALe+Z01vzfLsCuy8vvVMyoOPU72NwKK0fPmMcxAbRYXx+g6kPg@mail.gmail.com>
 <20170221105400.2eba4747@glumotte.dev.6wind.com>
 <CALe+Z03meh2od13-pfnFh0SpmCqxgKLD5MG2MF5Bj9Q8EtS=Hw@mail.gmail.com>
 <20170221163808.GA213576@bricha3-MOBL3.ger.corp.intel.com>
 <CALe+Z01pVFdEckOUabXTnh1q-xEOmJajTagEB1hvqYZazrG7iA@mail.gmail.com>
 <2601191342CEEE43887BDE71AB9772583F11B4CC@irsmsx105.ger.corp.intel.com>
 <CALe+Z01ozmTdWwxcc7mG+NhSV16K4+-Pe5uDWASzBBs5oMyh1g@mail.gmail.com>
 <2601191342CEEE43887BDE71AB9772583F11B633@irsmsx105.ger.corp.intel.com>
 <20170224150053.279e718d@platinum>
 <CALe+Z01+K8Odpz3oqk672qsKnjVAXif0TJCwsuPhbcwX+Z11Sg@mail.gmail.com>
 <2601191342CEEE43887BDE71AB9772583F11E992@irsmsx105.ger.corp.intel.com>
 <20170228102359.5d601797@platinum>
In-Reply-To: <20170228102359.5d601797@platinum>
Accept-Language: en-IE, en-US
Content-Language: en-US
X-MS-Has-Attach: 
X-MS-TNEF-Correlator: 
x-originating-ip: [163.33.239.181]
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: quoted-printable
MIME-Version: 1.0
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 <dev.dpdk.org>
List-Unsubscribe: <http://dpdk.org/ml/options/dev>,
 <mailto:dev-request@dpdk.org?subject=unsubscribe>
List-Archive: <http://dpdk.org/ml/archives/dev/>
List-Post: <mailto:dev@dpdk.org>
List-Help: <mailto:dev-request@dpdk.org?subject=help>
List-Subscribe: <http://dpdk.org/ml/listinfo/dev>,
 <mailto:dev-request@dpdk.org?subject=subscribe>
X-List-Received-Date: Tue, 28 Feb 2017 10:30:04 -0000



>=20
> Hi,
>=20
> On Tue, 28 Feb 2017 09:05:07 +0000, "Ananyev, Konstantin"
> <konstantin.ananyev@intel.com> wrote:
> > Hi everyone,
> >
> > > >
> > > > In my opinion, if we have the room in the first cache line, we
> > > > should put it there. The only argument I see against is "we may
> > > > find something more important in the future, and we won't have
> > > > room for it in the first cache line". I don't feel we should
> > > > penalize today's use cases for hypothetic future use cases.
> > > >
> > > >
> > > >
> > > >> 2. timestamp normalization point
> > > >>      inside PMD RX vs somewhere later as user needs it (extra
> > > >> function in dev_ops?).
> > > >
> > > > This point could be changed. My initial proposition tries to
> > > > provide a generic API for timestamp. Let me remind it here:
> > > >
> > > > a- the timestamp is in nanosecond
> > > > b- 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.
> > > >
> > > > We may remove a-, and just have:
> > > >  - the reference and the unit are 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 and unit, but for 2 different
> > > > PMDs (or a sw lib), they would not be the same.
> > > >
> > > > In both cases, we would need a conversion code (maybe in a
> > > > library) if the application wants to work with timestamps from
> > > > several sources. The second solution removes the normalization
> > > > code in the PMD when not needed, it is probably better.
> > >
> > > I agree.
> >
> > One question - does that mean that application would need to
> > keep a track from what PMD each particular packet came to do the
> > normalization? Konstantin
>=20
> I'd say yes. It does not look very difficult to do, since the mbuf
> contains the input port id.
>=20

I understand that we can use mbuf->port here, but it means that we'll
introduce new implicit dependency between timestamp and port values.
>>From my point that introduces new implications:
1. all PMDs that do set a timestamp would also have to set port value too.
    Probably not a big deal as most of PMDs do set port value anyway right =
now,
    but it means it would be hard to get rid/change mbuf->port in future.
2. Applications would not allowed to change mbuf->port value before normali=
zation is done
    (from what I heard some apps do update mbuf->port to store routing deci=
sions). =20
    BTW, how the app would keep track which mbufs were already normalized, =
and which were not?
3. In theory with eth_dev_detach() - mbuf->port value might be not valid at=
 the point when application
     would decide to do normalization.=20

So to me all that approach with delayed normalization seems unnecessary ove=
rcomplicated.
Original one suggested by Olivier, when normalization is done in PMD at RX =
look
much cleaner and more manageable.=20
Konstantin