From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from dpdk.org (dpdk.org [92.243.14.124]) by inbox.dpdk.org (Postfix) with ESMTP id 88E35A053A; Tue, 4 Aug 2020 16:25:13 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 5C1D41C025; Tue, 4 Aug 2020 16:25:13 +0200 (CEST) Received: from mga11.intel.com (mga11.intel.com [192.55.52.93]) by dpdk.org (Postfix) with ESMTP id D16A129D2 for ; Tue, 4 Aug 2020 16:25:11 +0200 (CEST) IronPort-SDR: utNGMofS/Rpoh2neLsBhwFc7IBVgSGaJXv7HIGDKjxiS1Kjqb6AR7G68ik9teoSoa9W57h4+nJ G9d1OB/rQYbQ== X-IronPort-AV: E=McAfee;i="6000,8403,9703"; a="150108620" X-IronPort-AV: E=Sophos;i="5.75,434,1589266800"; d="scan'208";a="150108620" X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga005.jf.intel.com ([10.7.209.41]) by fmsmga102.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 04 Aug 2020 07:25:10 -0700 IronPort-SDR: NVgdUl5kBlbjhT+uaJVIwDsaJ55G8IAGHF3ZpWAN4NS9ZvBTBxVbRLHx15NGEwM8VwlDuA0tJT Rv7niIu5kSSw== X-IronPort-AV: E=Sophos;i="5.75,434,1589266800"; d="scan'208";a="467085414" Received: from mschunte-mobl1.ger.corp.intel.com (HELO bricha3-MOBL.ger.corp.intel.com) ([10.252.38.45]) by orsmga005-auth.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-SHA; 04 Aug 2020 07:25:08 -0700 Date: Tue, 4 Aug 2020 15:24:51 +0100 From: Bruce Richardson To: Jerin Jacob Cc: Pavan Nikhilesh , Jerin Jacob , Ray Kinsella , Neil Horman , John McNamara , Marko Kovacevic , dpdk-dev , Thomas Monjalon , David Marchand Message-ID: <20200804142451.GA1704@bricha3-MOBL.ger.corp.intel.com> References: <20200802105137.1666-1-pbhagavatula@marvell.com> <20200803072903.1209-1-pbhagavatula@marvell.com> <20200804104153.GA1464@bricha3-MOBL.ger.corp.intel.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: Subject: Re: [dpdk-dev] [PATCH v2] doc: add reserve fields to eventdev public structures X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" On Tue, Aug 04, 2020 at 05:07:12PM +0530, Jerin Jacob wrote: > On Tue, Aug 4, 2020 at 4:12 PM Bruce Richardson > wrote: > > > > On Mon, Aug 03, 2020 at 12:59:03PM +0530, pbhagavatula@marvell.com wrote: > > > From: Pavan Nikhilesh > > > > > > Add 64 byte padding at the end of event device public structure to allow > > > future extensions. > > > > > > Signed-off-by: Pavan Nikhilesh > > > Acked-by: Jerin Jacob > > > --- > > > v2 Changes: > > > - Modify commit title. > > > - Add patch reference to doc. > > > > > > doc/guides/rel_notes/deprecation.rst | 11 +++++++++++ > > > 1 file changed, 11 insertions(+) > > > > > > diff --git a/doc/guides/rel_notes/deprecation.rst b/doc/guides/rel_notes/deprecation.rst > > > index ea4cfa7a4..ec5db68e9 100644 > > > --- a/doc/guides/rel_notes/deprecation.rst > > > +++ b/doc/guides/rel_notes/deprecation.rst > > > @@ -151,3 +151,14 @@ Deprecation Notices > > > Python 2 support will be completely removed in 20.11. > > > In 20.08, explicit deprecation warnings will be displayed when running > > > scripts with Python 2. > > > + > > > +* eventdev: A 64 byte padding is added at the end of the following structures > > > + in event device library to support future extensions: > > > + ``rte_event_crypto_adapter_conf``, ``rte_event_eth_rx_adapter_conf``, > > > + ``rte_event_eth_rx_adapter_queue_conf``, ``rte_event_eth_tx_adapter_conf``, > > > + ``rte_event_timer_adapter_conf``, ``rte_event_timer_adapter_info``, > > > + ``rte_event_dev_info``, ``rte_event_dev_config``, ``rte_event_queue_conf``, > > > + ``rte_event_port_conf``, ``rte_event_timer_adapter``, > > > + ``rte_event_timer_adapter_data``. > > > + Reference: > > > + http://patches.dpdk.org/project/dpdk/list/?series=10728&archive=both&state=* > > > -- > > > > I don't like this idea of adding lots of padding to the ends of these > > structures. For some structures, such as the public arrays for devices it > > may be necessary, but for all the conf structures passed as parameters to > > functions I think we can do better. Since these structures are passed by > > the user to various functions, function versioning can be used to ensure > > that the correct function in eventdev is always called. From there to the > > individual PMDs, we can implement ABI compatibility by either: > > 1. including the length of the struct as a parameter to the driver. (This is > > a bit similar to my proposal for rawdev [1]) > > 2. including the ABI version as a parameter to the driver. > > But, Will the above solution work if the application is dependent on > struct size? > i.e change of s1 size will change offset of s3 i.e > app_sepecific_struct_s3. Right? > i.e DPDK version should not change the offset of s3. Right? > > example, > struct app_struct { > struct dpdk_public_struct_s1 s1; > struct dpdk_public_struct_s2 s2; > struct app_sepecific_struct_s3 s3; > } > Not sure what exactly you mean here. The actual offsets and sizes of the structs will obviously change as you change the struct, but the end compiled app has no idea of structs, all it knows of is offsets, which is why you provide ABI compatible versions of the functions which use "legacy" copies of the structs to ensure correct offsets. It's pretty much standard practice for ABI versioning. The real complication arises because the actual eventdev driver functions are not called directly with the linker resolving symbol versioning. Instead they are called using function pointers from the code. This is why one needs to add in the additional parameter to the driver APIs so that the ABI info - be it struct size or version - can be passed from the versioned eventdev library function through to the driver. Regards, /Bruce