From mboxrd@z Thu Jan  1 00:00:00 1970
Return-Path: <dev-bounces@dpdk.org>
Received: from dpdk.org (dpdk.org [92.243.14.124])
	by dpdk.space (Postfix) with ESMTP id 9BAE3A0679
	for <public@inbox.dpdk.org>; Mon,  1 Apr 2019 21:23:08 +0200 (CEST)
Received: from [92.243.14.124] (localhost [127.0.0.1])
	by dpdk.org (Postfix) with ESMTP id A81533576;
	Mon,  1 Apr 2019 21:23:07 +0200 (CEST)
Received: from mga12.intel.com (mga12.intel.com [192.55.52.136])
 by dpdk.org (Postfix) with ESMTP id 92E2934F3
 for <dev@dpdk.org>; Mon,  1 Apr 2019 21:23:05 +0200 (CEST)
X-Amp-Result: SKIPPED(no attachment in message)
X-Amp-File-Uploaded: False
Received: from orsmga006.jf.intel.com ([10.7.209.51])
 by fmsmga106.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384;
 01 Apr 2019 12:23:04 -0700
X-ExtLoop1: 1
X-IronPort-AV: E=Sophos;i="5.60,297,1549958400"; d="scan'208";a="132046668"
Received: from fmsmsx103.amr.corp.intel.com ([10.18.124.201])
 by orsmga006.jf.intel.com with ESMTP; 01 Apr 2019 12:23:03 -0700
Received: from fmsmsx161.amr.corp.intel.com (10.18.125.9) by
 FMSMSX103.amr.corp.intel.com (10.18.124.201) with Microsoft SMTP Server (TLS)
 id 14.3.408.0; Mon, 1 Apr 2019 12:23:03 -0700
Received: from fmsmsx108.amr.corp.intel.com ([169.254.9.216]) by
 FMSMSX161.amr.corp.intel.com ([169.254.12.31]) with mapi id 14.03.0415.000;
 Mon, 1 Apr 2019 12:23:03 -0700
From: "Eads, Gage" <gage.eads@intel.com>
To: Stephen Hemminger <stephen@networkplumber.org>
CC: "dev@dpdk.org" <dev@dpdk.org>, "olivier.matz@6wind.com"
 <olivier.matz@6wind.com>, "arybchenko@solarflare.com"
 <arybchenko@solarflare.com>, "Richardson, Bruce"
 <bruce.richardson@intel.com>, "Ananyev, Konstantin"
 <konstantin.ananyev@intel.com>, "jerinj@marvell.com" <jerinj@marvell.com>,
 "mczekaj@marvell.com" <mczekaj@marvell.com>, "nd@arm.com" <nd@arm.com>,
 "Ola.Liljedahl@arm.com" <Ola.Liljedahl@arm.com>
Thread-Topic: [PATCH v7 0/6] Add lock-free ring and mempool handler
Thread-Index: AQHU3dM7C6Byp72AjU6cIT29UTs4q6YR7JYAgAGkUICAFAahwA==
Date: Mon, 1 Apr 2019 19:23:02 +0000
Message-ID:
 <9184057F7FC11744A2107296B6B8EB1E5420E60C@FMSMSX108.amr.corp.intel.com>
References: <20190306150342.2894-1-gage.eads@intel.com>
 <20190318213555.17345-1-gage.eads@intel.com>
 <9184057F7FC11744A2107296B6B8EB1E54207FC7@FMSMSX108.amr.corp.intel.com>
 <20190319085123.00df99c2@shemminger-XPS-13-9360>
In-Reply-To: <20190319085123.00df99c2@shemminger-XPS-13-9360>
Accept-Language: en-US
Content-Language: en-US
X-MS-Has-Attach: 
X-MS-TNEF-Correlator: 
x-titus-metadata-40: eyJDYXRlZ29yeUxhYmVscyI6IiIsIk1ldGFkYXRhIjp7Im5zIjoiaHR0cDpcL1wvd3d3LnRpdHVzLmNvbVwvbnNcL0ludGVsMyIsImlkIjoiZWE4ZTE5OWYtMDk3YS00Nzc3LTlkYTctNDc5YzA3MGNjNGU2IiwicHJvcHMiOlt7Im4iOiJDVFBDbGFzc2lmaWNhdGlvbiIsInZhbHMiOlt7InZhbHVlIjoiQ1RQX05UIn1dfV19LCJTdWJqZWN0TGFiZWxzIjpbXSwiVE1DVmVyc2lvbiI6IjE3LjEwLjE4MDQuNDkiLCJUcnVzdGVkTGFiZWxIYXNoIjoidkNPWW5FaFpnQWhJdXBnc0VcL0JLSDRsOENEdDRzS2dCYWV2alhSNzEyZm5NdDExMCszU1BjcjZpTktRQjlZaGMifQ==
x-ctpclassification: CTP_NT
dlp-product: dlpe-windows
dlp-version: 11.0.400.15
dlp-reaction: no-action
x-originating-ip: [10.1.200.106]
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable
MIME-Version: 1.0
Subject: Re: [dpdk-dev] [PATCH v7 0/6] Add lock-free ring and mempool handler
X-BeenThere: dev@dpdk.org
X-Mailman-Version: 2.1.15
Precedence: list
List-Id: DPDK patches and discussions <dev.dpdk.org>
List-Unsubscribe: <https://mails.dpdk.org/options/dev>,
 <mailto:dev-request@dpdk.org?subject=unsubscribe>
List-Archive: <http://mails.dpdk.org/archives/dev/>
List-Post: <mailto:dev@dpdk.org>
List-Help: <mailto:dev-request@dpdk.org?subject=help>
List-Subscribe: <https://mails.dpdk.org/listinfo/dev>,
 <mailto:dev-request@dpdk.org?subject=subscribe>
Errors-To: dev-bounces@dpdk.org
Sender: "dev" <dev-bounces@dpdk.org>
Message-ID: <20190401192302.HIpl2a1K-eb9knv2Ta1pJU1TZJPqO8199n3nC8hIm1k@z>

>=20
> On Mon, 18 Mar 2019 21:49:44 +0000
> "Eads, Gage" <gage.eads@intel.com> wrote:
>=20
> > Hi all,
> >
> > Friendly reminder that in order to get this feature into 19.08 (assumin=
g
> folks also want that :)), the API deprecation notice needs to be merged i=
nto
> 19.05.
> >
> > Thanks,
> > Gage
>=20
> Given the recent API/ABI stability discussion, this is the kind of patch =
that
> really needs to be examined and justified.

Can you point me to the discussion (assuming it was on the ML)? I'm aware o=
f Ferruh's changes to the docs, but not the discussion you referenced.

The lock-free ring functionality itself is a valuable addition to DPDK, pri=
marily because it lacks the standard ring's non-preemptive constraint. The =
non-preemptive constraint is important in an application with both high pri=
ority, performance-sensitive data-plane components and low-priority control=
-plane components. This was important enough to warrant further clarificati=
on recently[1], and has been a discussion topic for some time[2][3].

The modified API, rte_ring_get_memsize(), was added to allow users to initi=
alize rings in separately allocated memory. This function isn't called in D=
PDK's examples/apps/drivers, and a quick google search didn't turn up any o=
pen source projects that call the function, so I suspect that a majority of=
 ring code uses rte_ring_create() instead of rte_ring_get_memsize() + rte_r=
ing_init(). So I suspect this interface change will affect a small percenta=
ge of DPDK users.

As a straw-man counter-proposal, we could instead introduce a lock-free spe=
cific function rte_lf_ring_get_memsize() that lock-free ring users would ca=
ll instead of rte_ring_get_memsize(). This would avoid the API modification=
, but:
- It's awkward to have one rte_lf_ring_* function and otherwise access the =
lock-free ring through rte_ring_* functions.
- It's also easy to envision a user incorrectly calling rte_ring_get_memsiz=
e() rather than rte_lf_ring_get_memsize() for a lock-free ring, since other=
wise rte_ring_* functions are used. DPDK would have no way to detect that t=
he allocated memory is too small, and if such a bug occurs it would manifes=
t itself as memory corruption.
- Changing rte_ring_get_memsize() to take a flags argument may be the bette=
r long-term design, if another flag is introduced that likewise uses a diff=
erent ring size.

Another approach is to break out the lock-free ring into a fully separate A=
PI. One of the goals of my patchset was to allow applications to switch to =
lock-free rings with minimal code change; I think the value of the lock-fre=
e ring warrants such an approach.

(Unfortunately without hard numbers on the cost or benefit of such a change=
, these arguments are fairly subjective.)

Thanks,
Gage

[1] https://patches.dpdk.org/patch/43122/
[2] http://mails.dpdk.org/archives/dev/2013-November/000714.html
[3] http://mails.dpdk.org/archives/dev/2014-January/001163.html