From mboxrd@z Thu Jan 1 00:00:00 1970 From: Thomas Monjalon Subject: [PATCH] kni: fix build on Linux < 3.14 Date: Fri, 26 Oct 2018 23:40:27 +0200 Message-ID: <20181026214027.29465-1-thomas@monjalon.net> Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: dev@dpdk.org, phil.yang@arm.com, gavin.hu@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 498364C99 for ; Fri, 26 Oct 2018 23:40:28 +0200 (CEST) List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" The atomic functions smp_load_acquire() and smp_store_release() were introduced in Linux 3.14. Older kernels miss the functions: kni_fifo.h:19:2: error: implicit declaration of function ‘smp_load_acquire’ kni_fifo.h:30:2: error: implicit declaration of function ‘smp_store_release’ The fallback is to drop the atomic barrier, as it was before the commit below. Fixes: 711859cd0d07 ("kni: fix kernel FIFO synchronization") Signed-off-by: Thomas Monjalon --- kernel/linux/kni/kni_fifo.h | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/kernel/linux/kni/kni_fifo.h b/kernel/linux/kni/kni_fifo.h index 2cb3a4a7b..3c0be311f 100644 --- a/kernel/linux/kni/kni_fifo.h +++ b/kernel/linux/kni/kni_fifo.h @@ -8,6 +8,13 @@ #include +#ifndef smp_load_acquire +#define smp_load_acquire(a) (*(a)) +#endif +#ifndef smp_store_release +#define smp_store_release(a, b) *(a) = (b) +#endif + /** * Adds num elements into the fifo. Return the number actually written */ -- 2.19.0