From mboxrd@z Thu Jan 1 00:00:00 1970 From: Thomas Monjalon Subject: Re: [PATCH] kni: fix build on Linux < 3.14 Date: Fri, 26 Oct 2018 23:56:53 +0200 Message-ID: <4880956.RWMF3eIYHy@xps> References: <20181026214027.29465-1-thomas@monjalon.net> Mime-Version: 1.0 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Cc: dev@dpdk.org, phil.yang@arm.com, gavin.hu@arm.com, honnappa.nagarahalli@arm.com To: Ferruh Yigit Return-path: Received: from out3-smtp.messagingengine.com (out3-smtp.messagingengine.com [66.111.4.27]) by dpdk.org (Postfix) with ESMTP id 7D4F84CC7 for ; Fri, 26 Oct 2018 23:56:49 +0200 (CEST) In-Reply-To: <20181026214027.29465-1-thomas@monjalon.net> List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" 26/10/2018 23:40, Thomas Monjalon: > The atomic functions smp_load_acquire() and smp_store_release() > were introduced in Linux 3.14. Older kernels miss the functions: >=20 > kni_fifo.h:19:2: error: > implicit declaration of function =E2=80=98smp_load_acquire=E2=80=99 > kni_fifo.h:30:2: error: > implicit declaration of function =E2=80=98smp_store_release=E2=80=99 >=20 > The fallback is to drop the atomic barrier, as it was before > the commit below. >=20 > Fixes: 711859cd0d07 ("kni: fix kernel FIFO synchronization") >=20 > Signed-off-by: Thomas Monjalon > --- > kernel/linux/kni/kni_fifo.h | 7 +++++++ > 1 file changed, 7 insertions(+) >=20 > --- a/kernel/linux/kni/kni_fifo.h > +++ b/kernel/linux/kni/kni_fifo.h We could add a comment here: /* Skip some memory barriers on Linux < 3.14 */ > +#ifndef smp_load_acquire > +#define smp_load_acquire(a) (*(a)) > +#endif > +#ifndef smp_store_release > +#define smp_store_release(a, b) *(a) =3D (b) > +#endif