DPDK patches and discussions
 help / color / mirror / Atom feed
* [dpdk-dev] [PATCH] kni: fix build on Linux < 3.14
@ 2018-10-26 21:40 Thomas Monjalon
  2018-10-26 21:56 ` Thomas Monjalon
  0 siblings, 1 reply; 4+ messages in thread
From: Thomas Monjalon @ 2018-10-26 21:40 UTC (permalink / raw)
  To: Ferruh Yigit; +Cc: dev, phil.yang, gavin.hu

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 <thomas@monjalon.net>
---
 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 <exec-env/rte_kni_common.h>
 
+#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

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [dpdk-dev] [PATCH] kni: fix build on Linux < 3.14
  2018-10-26 21:40 [dpdk-dev] [PATCH] kni: fix build on Linux < 3.14 Thomas Monjalon
@ 2018-10-26 21:56 ` Thomas Monjalon
  2018-10-26 22:42   ` Ferruh Yigit
  0 siblings, 1 reply; 4+ messages in thread
From: Thomas Monjalon @ 2018-10-26 21:56 UTC (permalink / raw)
  To: Ferruh Yigit; +Cc: dev, phil.yang, gavin.hu, honnappa.nagarahalli

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:
> 
> 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 <thomas@monjalon.net>
> ---
>  kernel/linux/kni/kni_fifo.h | 7 +++++++
>  1 file changed, 7 insertions(+)
> 
> --- 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) = (b)
> +#endif

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [dpdk-dev] [PATCH] kni: fix build on Linux < 3.14
  2018-10-26 21:56 ` Thomas Monjalon
@ 2018-10-26 22:42   ` Ferruh Yigit
  2018-10-26 23:25     ` Thomas Monjalon
  0 siblings, 1 reply; 4+ messages in thread
From: Ferruh Yigit @ 2018-10-26 22:42 UTC (permalink / raw)
  To: Thomas Monjalon; +Cc: dev, phil.yang, gavin.hu, honnappa.nagarahalli

On 10/26/2018 10:56 PM, Thomas Monjalon wrote:
> 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:
>>
>> 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 <thomas@monjalon.net>

Tested-by: Ferruh Yigit <ferruh.yigit@intel.com>

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [dpdk-dev] [PATCH] kni: fix build on Linux < 3.14
  2018-10-26 22:42   ` Ferruh Yigit
@ 2018-10-26 23:25     ` Thomas Monjalon
  0 siblings, 0 replies; 4+ messages in thread
From: Thomas Monjalon @ 2018-10-26 23:25 UTC (permalink / raw)
  To: dev; +Cc: Ferruh Yigit, phil.yang, gavin.hu, honnappa.nagarahalli

27/10/2018 00:42, Ferruh Yigit:
> On 10/26/2018 10:56 PM, Thomas Monjalon wrote:
> > 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:
> >>
> >> 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 <thomas@monjalon.net>
> 
> Tested-by: Ferruh Yigit <ferruh.yigit@intel.com>

Applied

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2018-10-26 23:25 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-10-26 21:40 [dpdk-dev] [PATCH] kni: fix build on Linux < 3.14 Thomas Monjalon
2018-10-26 21:56 ` Thomas Monjalon
2018-10-26 22:42   ` Ferruh Yigit
2018-10-26 23:25     ` Thomas Monjalon

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).