From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-wg0-f47.google.com (mail-wg0-f47.google.com [74.125.82.47]) by dpdk.org (Postfix) with ESMTP id E3297C5C8 for ; Tue, 23 Jun 2015 16:55:35 +0200 (CEST) Received: by wguu7 with SMTP id u7so11991041wgu.3 for ; Tue, 23 Jun 2015 07:55:34 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:subject:date:message-id:organization :user-agent:in-reply-to:references:mime-version :content-transfer-encoding:content-type; bh=t2ftlIG/sjgko/xmzwocWnm6aARfIstQeLdqeJ9F1UY=; b=AfjJjz8PjIiqpdFivKIuCOKRBBhy/pz/gfRxaH1eteFTPWW8Z5Sd9ryPB01bQlbT/l njnb1yTgQ8VoM5WIpppqfwa0owkbKbTOo6lJu/jUvpo3BnqSjaXBeLvn+vfvkKz1AVKV UUkEx0cCeMoTDykwl4ipGmSRjWVjU5iWl+OnPUE8FuuDRGdqeL4FS2dtJEfjtxvlU60n HyuaciioThZYmvA15IfY+M0VNdzB+TZxMX7nDg+3S6DVFmjkH32uPei/QcvaTOdEv/V0 NcCLqzZXTo0YWaLWOZbkPHn2E1uy2+0gA7VP7TQ9fh1fRBRWZg1ckqPsl+/icgkUESRU Xb3A== X-Gm-Message-State: ALoCoQmQgQ2YpMVaZUpCf1FzKClrlLnVmqsDEbPHLEjp1eH1kpr5xfgsczb9nw4YbhT879BRrL7j X-Received: by 10.194.78.175 with SMTP id c15mr11360706wjx.136.1435071334748; Tue, 23 Jun 2015 07:55:34 -0700 (PDT) Received: from xps13.localnet (136-92-190-109.dsl.ovh.fr. [109.190.92.136]) by mx.google.com with ESMTPSA id jy6sm31180247wjc.4.2015.06.23.07.55.33 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 23 Jun 2015 07:55:33 -0700 (PDT) From: Thomas Monjalon To: "Dumitrescu, Cristian" Date: Tue, 23 Jun 2015 16:54:31 +0200 Message-ID: <2132356.WZTODM8iGX@xps13> Organization: 6WIND User-Agent: KMail/4.14.8 (Linux/4.0.4-2-ARCH; KDE/4.14.8; x86_64; ; ) In-Reply-To: <3EB4FA525960D640B5BDFFD6A3D891263238FA63@IRSMSX108.ger.corp.intel.com> References: <1434706885-4519-1-git-send-email-maciejx.t.gajdzica@intel.com> <2173119.kJ61eenqfH@xps13> <3EB4FA525960D640B5BDFFD6A3D891263238FA63@IRSMSX108.ger.corp.intel.com> MIME-Version: 1.0 Content-Transfer-Encoding: 7Bit Content-Type: text/plain; charset="us-ascii" Cc: dev@dpdk.org Subject: Re: [dpdk-dev] [PATCH v5 01/13] port: added structures for port stats and config option X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: patches and discussions about DPDK List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 23 Jun 2015 14:55:36 -0000 2015-06-23 14:30, Dumitrescu, Cristian: > From: dev [mailto:dev-bounces@dpdk.org] On Behalf Of Thomas Monjalon > > 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 */ > > > }; > > > > Isn't it breaking an ABI? > > This is simply adding a field at the end of the API structure. This structure is instantiated per each port type and its role is very similar to a driver ops structure, for example: > > in file "rte_port_ethdev.h": extern struct rte_port_out_ops rte_port_ethdev_writer_ops; > in file "rte_port_ring.h": extern struct rte_port_out_ops rte_port_ring_writer_nodrop_ops; > > Typically, instances of these structures are only referenced through pointers 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 create an array of such structures, but I think this is not a realistic scenario. 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). Why wouldn't it be a problem even for single instance? If the application allocates one with old sizeof and the lib is trying to write in the new field, there can be a problem, no? Maybe Neil has an opinion? > Due to this, I do not see this as breaking the API. I think this is the most it could be done to minimize the effect on the ABI will still adding new functionality. Please let me know what you think. > > > > > > 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 */ > > > > What is the goal of this change? Breaking the alignment? > > Shall we submit a new patch revision to fix the alignment of the comments? Yes using spaces for alignment would be better.