From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mx1.redhat.com (mx1.redhat.com [209.132.183.28]) by dpdk.org (Postfix) with ESMTP id 6397A137C for ; Tue, 8 Mar 2016 10:06:07 +0100 (CET) Received: from int-mx09.intmail.prod.int.phx2.redhat.com (int-mx09.intmail.prod.int.phx2.redhat.com [10.5.11.22]) by mx1.redhat.com (Postfix) with ESMTPS id 9915C8F4ED; Tue, 8 Mar 2016 09:06:06 +0000 (UTC) Received: from sopuli.koti.laiskiainen.org (vpn1-4-52.ams2.redhat.com [10.36.4.52]) by int-mx09.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id u289640d022282; Tue, 8 Mar 2016 04:06:05 -0500 To: "Dumitrescu, Cristian" , Thomas Monjalon , "Zhang, Roy Fan" References: <1455707490-13826-1-git-send-email-roy.fan.zhang@intel.com> <1455707490-13826-2-git-send-email-roy.fan.zhang@intel.com> <8203471.f1i4Yl96V2@xps13> <3EB4FA525960D640B5BDFFD6A3D8912647968D3E@IRSMSX108.ger.corp.intel.com> From: Panu Matilainen Message-ID: <56DE95FC.3000201@redhat.com> Date: Tue, 8 Mar 2016 11:06:04 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101 Thunderbird/38.6.0 MIME-Version: 1.0 In-Reply-To: <3EB4FA525960D640B5BDFFD6A3D8912647968D3E@IRSMSX108.ger.corp.intel.com> Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit X-Scanned-By: MIMEDefang 2.68 on 10.5.11.22 Cc: "dev@dpdk.org" Subject: Re: [dpdk-dev] [PATCH v2 1/4] lib/librte_port: add PCAP file support to source port 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, 08 Mar 2016 09:06:07 -0000 On 03/08/2016 10:36 AM, Dumitrescu, Cristian wrote: > > >> -----Original Message----- >> From: Thomas Monjalon [mailto:thomas.monjalon@6wind.com] >> Sent: Monday, March 7, 2016 11:18 AM >> To: Zhang, Roy Fan >> Cc: dev@dpdk.org; Panu Matilainen ; Dumitrescu, >> Cristian >> Subject: Re: [dpdk-dev] [PATCH v2 1/4] lib/librte_port: add PCAP file support >> to source port >> >> 2016-02-17 11:11, Fan Zhang: >>> --- a/lib/librte_port/rte_port_source_sink.h >>> +++ b/lib/librte_port/rte_port_source_sink.h >>> @@ -53,6 +53,13 @@ extern "C" { >>> struct rte_port_source_params { >>> /** Pre-initialized buffer pool */ >>> struct rte_mempool *mempool; >>> + /** The full path of the pcap file to read packets from */ >>> + char *file_name; >>> + /** The number of bytes to be read from each packet in the >>> + * pcap file. If this value is 0, the whole packet is read; >>> + * if it is bigger than packet size, the generated packets >>> + * will contain the whole packet */ >>> + uint32_t n_bytes_per_pkt; >>> }; >> >> If this struct is used in a table, changing its size will break the ABI. > > This structure is already present in the API of the source port in file librte_port/rte_port_source_sink.h, this patch is simply adding two new fields at the end of it. I think we accepted adding parameters at the end of the API parameter structures in other parts of DPDK without considering them ABI breakages? > > Per Panu's previous comment, this structure is indeed used within an array of unions in the ip_pipeline application, but (1) it is very unlikely a "regular" user application will use it this same way; and (2) somebody using the ip_pipeline application will upgrade both the library and the application at the same time. > > If you guys still think this is breaking the ABI, please let us know asap and we'll go with your suggestion. That it breaks ip_pipeline means it quite obviously is an ABI break. Adding elements to end of struct might be borderline okay in some limited cases but in general, who's to say a struct is not embedded in somebody elses struct in some other program, or in an array? There's no room for such guessing if ABI compatibility is to mean anything at all. Explicitly breaking the ABI is not a bad thing, lying about it is. - Panu - >