From mboxrd@z Thu Jan 1 00:00:00 1970 From: Thomas Monjalon Subject: Re: [PATCH v2 6/8] mbuf: use 2 bytes for port and nb segments Date: Tue, 11 Jul 2017 17:05:57 +0200 Message-ID: <53564501.0VCaTE2lYi@xps> References: <1488966121-22853-1-git-send-email-olivier.matz@6wind.com> <130C769A-180F-4C74-A974-EA51E7FAD1EC@intel.com> <98CBD80474FA8B44BF855DF32C47DC359EB27E@smartserver.smartshare.dk> Mime-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable Cc: dev@dpdk.org, "Wiles, Keith" , Olivier Matz , "Wang, Zhihong" , Yuanhan Liu , "Ananyev, Konstantin" , "Richardson, Bruce" , "Chilikin, Andrey" , Jan Blunck , nelio.laranjeiro@6wind.com, arybchenko@solarflare.com, jerin.jacob@caviumnetworks.com To: Morten =?ISO-8859-1?Q?Br=F8rup?= Return-path: Received: from out3-smtp.messagingengine.com (out3-smtp.messagingengine.com [66.111.4.27]) by dpdk.org (Postfix) with ESMTP id 01E3E3250 for ; Tue, 11 Jul 2017 17:05:58 +0200 (CEST) In-Reply-To: <98CBD80474FA8B44BF855DF32C47DC359EB27E@smartserver.smartshare.dk> List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" 11/07/2017 15:30, Morten Br=F8rup: > Morten Br=F8rup wrote: > > Olivier Matz wrote: > > > As I said in a previous message, I think a good first step would be to > > > introduce a typedef for the port number: rte_eth_port_num_t. > > > It can still be uint8_t for now, and can be switched to 16 bits in one > > > step when everyone uses this new type. > >=20 > > I think that DPDK follows the Linux tradition of exposing the variable > > types, as opposed to hiding them behind typedefs. This has the > > unfortunate consequence that when a variable type changes, it has to be > > changed everywhere. > >=20 > > Introducing a rte_eth_port_num_t will require changing the same files > > at the same locations everywhere, so not even as a temporary solution > > will it be beneficial. [...] > What I was trying to communicate with my long argument about type definit= ions was: When the type changed from 8 bit to 16 bit, the type needs to cha= nge from uint8_t to uint16_t everywhere too, including in the ethdev APIs. >=20 > Don't start breaking coding conventions here by hiding the type of this v= ariable. So, Morten, you are against the typedef, right? Because we need to change it everywhere anyway, right? Note: I have no strong opinion.