From mboxrd@z Thu Jan  1 00:00:00 1970
Return-Path: <thomas@monjalon.net>
Received: from out2-smtp.messagingengine.com (out2-smtp.messagingengine.com
 [66.111.4.26]) by dpdk.org (Postfix) with ESMTP id 0B5AD7CB6
 for <dev@dpdk.org>; Wed, 13 Sep 2017 14:18:13 +0200 (CEST)
Received: from compute1.internal (compute1.nyi.internal [10.202.2.41])
 by mailout.nyi.internal (Postfix) with ESMTP id 5F4C120C0B;
 Wed, 13 Sep 2017 08:18:13 -0400 (EDT)
Received: from frontend2 ([10.202.2.161])
 by compute1.internal (MEProxy); Wed, 13 Sep 2017 08:18:13 -0400
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=monjalon.net; h=
 cc:content-transfer-encoding:content-type:date:from:in-reply-to
 :message-id:mime-version:references:subject:to:x-me-sender
 :x-me-sender:x-sasl-enc:x-sasl-enc; s=mesmtp; bh=VuX9gKOTib8DZ+T
 UTJNJF13iY7VDwZArb/Ecm+xYCR4=; b=FHRewV7IATc/ig9B4+QrvvZJUrWJrKF
 CEx4eM6PNl03Ub3UTgnmtvcnv7s98Wdy4Ur6ADweCKldBCVRTrMUuNt1Hvo51fvO
 95+ujmWjJlEDp7i2aaXTt7NSqGUphtTYajAPylBVHMzCEOQFnZwOtOEPgsDnC6xl
 GW032CO6YzQk=
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=
 messagingengine.com; h=cc:content-transfer-encoding:content-type
 :date:from:in-reply-to:message-id:mime-version:references
 :subject:to:x-me-sender:x-me-sender:x-sasl-enc:x-sasl-enc; s=
 fm1; bh=VuX9gKOTib8DZ+TUTJNJF13iY7VDwZArb/Ecm+xYCR4=; b=dhlOFgX/
 4jO3qKqeg3iM7PWUwxJ8EtIOICrgvkLeRFofb5aOUZ53J+au3+TNIS+bXouvo+9U
 dtaak2xdGlXQS+OG7K0dwGRw4IG8O8JM8ot/m84n3GlFTFZ/I0YayQ7+jL1nVsgt
 YsdGKCeMl32KEGwIqDqK7H2csoXrFugjfUWN8vS8PXEqbAVqdR7vMopyzgJzN17q
 nFTEWOObE0CggBMkxYCXYiaYzzWCpxdPpCoD4PoVweGimpGZwJFH0EVx2mCKBeiB
 9/jLXuDLAERap6yID4G99+5F1KR0PCsS8PXJ9dwN0Ls6ailiyXdSEMIx93pjUZ86
 JZk6NUG/S2BDog==
X-ME-Sender: <xms:BSK5WfQB4Hh6I29gfpLUMVJcy0UdtEi6S9hBU-K0O1bFh8I34tAg1A>
X-Sasl-enc: QUSLHkQpdTBN/GyGppPBEVZpX+6gPInn0QhGxWg+Y5Yv 1505305093
Received: from xps.localnet (184.203.134.77.rev.sfr.net [77.134.203.184])
 by mail.messagingengine.com (Postfix) with ESMTPA id 0D8D7248E6;
 Wed, 13 Sep 2017 08:18:13 -0400 (EDT)
From: Thomas Monjalon <thomas@monjalon.net>
To: Ferruh Yigit <ferruh.yigit@intel.com>
Cc: "Yang, Zhiyong" <zhiyong.yang@intel.com>, dev@dpdk.org, "Doherty,
 Declan" <declan.doherty@intel.com>, "Lu, Wenzhuo" <wenzhuo.lu@intel.com>,
 "hemant.agrawal@nxp.com" <hemant.agrawal@nxp.com>, "Hunt,
 David" <david.hunt@intel.com>, "Richardson,
 Bruce" <bruce.richardson@intel.com>, "Ananyev,
 Konstantin" <konstantin.ananyev@intel.com>
Date: Wed, 13 Sep 2017 14:18:12 +0200
Message-ID: <2082709.2bg3ojJAuc@xps>
In-Reply-To: <6c65bf3c-b434-93a0-6c9e-776461181150@intel.com>
References: <20170904055734.21354-1-zhiyong.yang@intel.com>
 <E182254E98A5DA4EB1E657AC7CB9BD2A8AF132E4@BGSMSX101.gar.corp.intel.com>
 <6c65bf3c-b434-93a0-6c9e-776461181150@intel.com>
MIME-Version: 1.0
Content-Transfer-Encoding: 7Bit
Content-Type: text/plain; charset="us-ascii"
Subject: Re: [dpdk-dev] [PATCH v3 1/4] ethdev: increase port_id range
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: Wed, 13 Sep 2017 12:18:14 -0000

13/09/2017 13:56, Ferruh Yigit:
> On 9/13/2017 3:26 AM, Yang, Zhiyong wrote:
> > From: Yigit, Ferruh
> >> On 9/9/2017 3:47 PM, Zhiyong Yang wrote:
> >>> Extend port_id definition from uint8_t to uint16_t in lib and drivers
> >>> data structures, specifically rte_eth_dev_data.
> >>> Modify the APIs, drivers and app using port_id at the same time.
> >>>
> >>> Fix some checkpatch issues from the original code and remove some
> >>> unnecessary cast operations.
> >>>
> >>> Signed-off-by: Zhiyong Yang <zhiyong.yang@intel.com>
> >>
> >> <...>
> >>
> >>> @@ -283,7 +283,7 @@ enum dcb_mode_enable  #define
> >>> MAX_RX_QUEUE_STATS_MAPPINGS 4096 /* MAX_PORT of 32 @ 128
> >>> rx_queues/port */
> >>>
> >>>  struct queue_stats_mappings {
> >>> -	uint8_t port_id;
> >>> +	uint16_t port_id;
> >>
> >> Can this be "portid_t port_id;" ? For testpmd, portid_t can be used for all port_id
> >> declarations.
> >>
> > 
> > Ferruh, the suggestion has been discussed in the following thread. Most of people agree on
> > The basic type uint16_t. :).  Your suggestion was my preference  previously.
> > At last, I make this decision to use uint16_t.  You know, whatever I use, some ones will stand out and
> > Say the other is better.  :)
> > http://www.dpdk.org/dev/patchwork/patch/23208/
> 
> This discussion was whole dpdk, my comment is for testpmd only.
> 
> Testpmd already defines "portid_t" and uses it in many places [1]. I am
> saying why keep using "uint16_t" in some places in testpmd? Lets switch
> all to "portid_t" while we are touching them all.
> 
> [1]
>   -typedef uint8_t  portid_t;
>   +typedef uint16_t portid_t;

Or the reverse, we can drop portid_t from testpmd, especially if it is
not used everywhere in testpmd.
Note: this typedef hides the size of the port, which may be important
when optimizing code.