From mboxrd@z Thu Jan 1 00:00:00 1970 From: "Dumitrescu, Cristian" Subject: Re: [PATCH v5 01/13] port: added structures for port stats and config option Date: Tue, 23 Jun 2015 14:30:14 +0000 Message-ID: <3EB4FA525960D640B5BDFFD6A3D891263238FA63@IRSMSX108.ger.corp.intel.com> References: <1434706885-4519-1-git-send-email-maciejx.t.gajdzica@intel.com> <1434706885-4519-2-git-send-email-maciejx.t.gajdzica@intel.com> <2173119.kJ61eenqfH@xps13> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable Cc: "dev@dpdk.org" To: Thomas Monjalon , "Gajdzica, MaciejX T" Return-path: Received: from mga01.intel.com (mga01.intel.com [192.55.52.88]) by dpdk.org (Postfix) with ESMTP id 88088C618 for ; Tue, 23 Jun 2015 16:30:18 +0200 (CEST) In-Reply-To: <2173119.kJ61eenqfH@xps13> Content-Language: en-US List-Id: patches and discussions about DPDK List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" > -----Original Message----- > From: dev [mailto:dev-bounces@dpdk.org] On Behalf Of Thomas Monjalon > Sent: Tuesday, June 23, 2015 2:55 PM > To: Gajdzica, MaciejX T > Cc: dev@dpdk.org > Subject: Re: [dpdk-dev] [PATCH v5 01/13] port: added structures for port > stats and config option >=20 > 2015-06-19 11:41, Maciej Gajdzica: > > /** Input port interface defining the input port operation */ > > struct rte_port_in_ops { > > rte_port_in_op_create f_create; /**< Create */ > > rte_port_in_op_free f_free; /**< Free */ > > rte_port_in_op_rx f_rx; /**< Packet RX (packet burst) */ > > + rte_port_in_op_stats_read f_stats; /**< Stats */ > > }; >=20 > Isn't it breaking an ABI? This is simply adding a field at the end of the API structure. This structu= re is instantiated per each port type and its role is very similar to a dr= iver ops structure, for example: in file "rte_port_ethdev.h": extern struct rte_port_out_ops rte_port_ethde= v_writer_ops; in file "rte_port_ring.h": extern struct rte_port_out_ops rte_port_ring_wr= iter_nodrop_ops; Typically, instances of these structures are only referenced through pointe= rs by application code (and other libraries, like librte_pipeline), so code= that is not aware of this last field in the structure will still continue = to work. The only case I see possible when code will break is if somebody would crea= te an array of such structures, but I think this is not a realistic scenari= o. Instances of this structure are infrequent: once per port type in librte= _port, and new instances are only created when the user wants to create new= port type. Basically, instances of this structure are created in isolation= and not in bulk (arrays). Due to this, I do not see this as breaking the API. I think this is the mos= t it could be done to minimize the effect on the ABI will still adding new = functionality. Please let me know what you think. >=20 > > struct rte_port_out_ops { > > - rte_port_out_op_create f_create; /**< Create */ > > - rte_port_out_op_free f_free; /**< Free */ > > - rte_port_out_op_tx f_tx; /**< Packet TX (single packet) */ > > - rte_port_out_op_tx_bulk f_tx_bulk; /**< Packet TX (packet burst) > */ > > - rte_port_out_op_flush f_flush; /**< Flush */ > > + rte_port_out_op_create f_create; /**< Create */ > > + rte_port_out_op_free f_free; /**< Free */ > > + rte_port_out_op_tx f_tx; /**< Packet > TX (single packet) */ > > + rte_port_out_op_tx_bulk f_tx_bulk; /**< Packet TX > (packet burst) */ > > + rte_port_out_op_flush f_flush; /**< Flush */ >=20 > What is the goal of this change? Breaking the alignment? Shall we submit a new patch revision to fix the alignment of the comments? >=20 > > + rte_port_out_op_stats_read f_stats; /**< Stats */