From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from dpdk.org (dpdk.org [92.243.14.124]) by dpdk.space (Postfix) with ESMTP id 17BB5A05D3 for ; Wed, 24 Apr 2019 10:50:02 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id D663B2F42; Wed, 24 Apr 2019 10:50:01 +0200 (CEST) Received: from mga05.intel.com (mga05.intel.com [192.55.52.43]) by dpdk.org (Postfix) with ESMTP id C7EF529D2 for ; Wed, 24 Apr 2019 10:49:59 +0200 (CEST) X-Amp-Result: UNKNOWN X-Amp-Original-Verdict: FILE UNKNOWN X-Amp-File-Uploaded: False Received: from fmsmga008.fm.intel.com ([10.253.24.58]) by fmsmga105.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 24 Apr 2019 01:49:58 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.60,389,1549958400"; d="scan'208";a="143176205" Received: from bricha3-mobl.ger.corp.intel.com ([10.237.221.48]) by fmsmga008.fm.intel.com with SMTP; 24 Apr 2019 01:49:56 -0700 Received: by (sSMTP sendmail emulation); Wed, 24 Apr 2019 09:49:55 +0100 Date: Wed, 24 Apr 2019 09:49:55 +0100 From: Bruce Richardson To: Honnappa Nagarahalli Cc: "dev@dpdk.org" , Stephen Hemminger , "Ananyev, Konstantin" , "thomas@monjalon.net" , Ray Kinsella , nd Message-ID: <20190424084954.GA1871@bricha3-MOBL.ger.corp.intel.com> References: <20190417083637.GB1890@bricha3-MOBL.ger.corp.intel.com> <20190418102811.GB1817@bricha3-MOBL.ger.corp.intel.com> MIME-Version: 1.0 Content-Type: text/plain; charset="UTF-8" Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.11.4 (2019-03-13) Subject: Re: [dpdk-dev] ABI and inline functions 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" Message-ID: <20190424084955.1Y8ePeN9zWxVEzv19TSz1Z0FG-7WOvElKODyTbSN9vk@z> On Wed, Apr 24, 2019 at 05:08:46AM +0000, Honnappa Nagarahalli wrote: > > > > On Wed, Apr 17, 2019 at 05:12:43AM +0000, Honnappa Nagarahalli > > wrote: > > > > > Hello, > > > > > > > > 2. If the situation is as in #1, but the structures in question are > > > > passed to non-inline DPDK functions. In this case, any changes to > > > > the structures require those functions taking the structures to be > > > > versioned for old and new structures > > > I think this can get complicated on the inline function side. The application > > and the DPDK library will end up having different inline functions. The > > changed inline function needs to be aware of 2 structure formats or the inline > > function needs to be duplicated (one for each version of the structure). I > > guess these are the workarounds we have to do. > > > > > No, there is never any need for two versions of the inline functions, only the > > newest version is needed. This is because in the case of a newly compiled > > application only the newest version of the non-inline functions is ever used. > > The other older versions are only used at runtime for compatilibity with pre- > > compiled apps with the older inlines. > > > Since the inline function is used in the application and the DPDK (say a library), we have 2 copies of the same inline function in the final binary (1 with the application and 2nd one behind DPDK non-inline functions). When the DPDK non-inline functions are versioned, the older version of the functions have to support the old structures for the old application to work with the new DPDK. i.e. both copies of the inline function have to be the same. > Ok, if the inline function is used both in DPDK libs and apps, then indeed we have a slightly more complex problem. I was mostly assuming the inlines were for app use only, but you are right that we have internally used ones also. However, I expect this only makes the problem a little harder rather than impossible - we would need two versions of the inline function, however, only one needs to be exposed publically. Really, the main upshot is that we need to reduce use of inline functions except where absolutely necessary, and then hide structures as much as possible. I don't see anyone disagreeing with that goal. :-) /Bruce