From mboxrd@z Thu Jan  1 00:00:00 1970
Return-Path: <olivier.matz@6wind.com>
Received: from mail-wr0-f170.google.com (mail-wr0-f170.google.com
 [209.85.128.170]) by dpdk.org (Postfix) with ESMTP id 898116932
 for <dev@dpdk.org>; Tue, 21 Feb 2017 10:54:14 +0100 (CET)
Received: by mail-wr0-f170.google.com with SMTP id 89so74078584wrr.3
 for <dev@dpdk.org>; Tue, 21 Feb 2017 01:54:14 -0800 (PST)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=6wind-com.20150623.gappssmtp.com; s=20150623;
 h=from:date:to:cc:subject:message-id:in-reply-to:references
 :mime-version:content-transfer-encoding;
 bh=HENfT3dOYiU4vQzK2lG27e9Y+XxPLiGc79hM0Vpcquc=;
 b=wVXDGeFnsPwOsj3Hz6DBdGK9M3QJZP1u6F9bBZZUtbkJFUsoE04rX9MfdyK/RPoTqq
 Fxl5MmAICVuCs4HsZX27C8ir43VdYgi6X8HegixZuNl/zXkiTbwKWpXg2U4BuXzd36vV
 nPR3tXYjVbycfTikOTUgh0cdNf0vwVNhsmK9HDvQHr0FKgFUSyoIPyj2M33d9nsSyqJo
 OhO1ZbpnMRhfA7A2YxanywN5kqk7xhAiFkVByhBvkP9O7LB6kfEZ0okwoWCRguKqME+N
 LSVN1WcQXNp6zaHC+a5ZsojWspDL/nw6OR8aWEWCzlJdaz5ChdbOj6yDusp9MXPIIo38
 Ugvg==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=1e100.net; s=20161025;
 h=x-gm-message-state:from:date:to:cc:subject:message-id:in-reply-to
 :references:mime-version:content-transfer-encoding;
 bh=HENfT3dOYiU4vQzK2lG27e9Y+XxPLiGc79hM0Vpcquc=;
 b=CT+jl8RrsD6HOQVbacY/c55vfwWzMwkraqjrZb8Y7fdnUqaV8YSpZOUOII+ytDv10U
 mMn8rWfDHZAKpzPapGTGOi5G8Xx/rnJt1qFZrp6gWo2aiIzcY+7bApElIhpGhgmHDWPC
 Cmzzu3w7lu/k8UNCuzYiYPlGRCqCsmD6qSwREX3dsDX49sCiJWrgZipDth8fcH1BmdXu
 RHa6GYaz9hPONn6xQiWLavCtz9YQiEtXZu4eZwSqZILdR+HjH0kdp8brtAnBBASS/4Gw
 75CClqBcpM/FDDSGYmU6a27BjDbccCqfz7kj+ho+6MPWOFVADiMPJRWuliObvWxnaccP
 AkEw==
X-Gm-Message-State: AMke39ntYnb4zQoSaE6ol+1iwUu8sq54Vorn5SQGNvGmGyVwG3EyGhWLG+Qsyo009mvy3DOp
X-Received: by 10.223.142.107 with SMTP id n98mr16780667wrb.11.1487670854321; 
 Tue, 21 Feb 2017 01:54:14 -0800 (PST)
Received: from glumotte.dev.6wind.com (host.78.145.23.62.rev.coltfrance.com.
 [62.23.145.78])
 by smtp.gmail.com with ESMTPSA id e73sm16945617wmi.32.2017.02.21.01.54.14
 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256);
 Tue, 21 Feb 2017 01:54:14 -0800 (PST)
From: Olivier MATZ <olivier.matz@6wind.com>
X-Google-Original-From: Olivier MATZ <olivier.matz@dev.6wind.com>
Date: Tue, 21 Feb 2017 10:54:06 +0100
To: Morten =?UTF-8?B?QnLDuHJ1cA==?= <mb@smartsharesystems.com>
Cc: "Olivier Matz" <olivier.matz@6wind.com>, <dev@dpdk.org>
Message-ID: <20170221105406.39045e99@glumotte.dev.6wind.com>
In-Reply-To: <98CBD80474FA8B44BF855DF32C47DC359EAD04@smartserver.smartshare.dk>
References: <1485271173-13408-1-git-send-email-olivier.matz@6wind.com>
 <2601191342CEEE43887BDE71AB9772583F111A29@irsmsx105.ger.corp.intel.com>
 <20170216144807.7add2c71@platinum>
 <98CBD80474FA8B44BF855DF32C47DC359EAD04@smartserver.smartshare.dk>
X-Mailer: Claws Mail 3.14.1 (GTK+ 2.24.30; x86_64-pc-linux-gnu)
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: quoted-printable
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, 21 Feb 2017 09:54:14 -0000

Hi Morten,

On Tue, 21 Feb 2017 10:22:57 +0100, Morten Br=C3=B8rup
<mb@smartsharesystems.com> wrote:
> Hi Olivier,
>=20
> There has been a lot of debate about the size and location (1st or
> 2nd cache line) of the mbuf fields.
>=20
> May I suggest that you add a comment to each field briefly mentioning
> why it has a specific size (8 or 16 bits) (e.g. by example use case),
> and optionally also why it deserves to be in the first cache line. (A
> comment to the mbuf structure can say that fields manipulated by PMDs
> on ingress generally belong in the 1st cache line.)
>=20
> It's not necessary for all fields, just the non-obvious ones (the
> ones discussed here on the mailing list). It will make the
> information more easily accessible to avoid repeating the same
> discussions in the future.
>=20
> E.g. the port field is 16 bits because a hypervisor can serve more
> than 256 virtual machines. And it is in the 1st cache line because a
> PMD for a multi-port NIC with a shared ingress queue needs to set it
> on ingress.
>=20
> And the refcnt field has the same size as the port field to support
> L3 multicast and L2 port flooding on all ports.
>=20

I understand your point about not rediscussing things several times. I
don't think having a comment for fields is really relevant because it
would add many info that are not useful for the user of the structure,
but I think adding something in the API documentation of the rte_mbuf
structure itself makes sense to me.

I'll add something in the next version of the patch.

Thanks,
Olivier