DPDK patches and discussions
 help / color / mirror / Atom feed
* [dpdk-dev] [PATCH] arm64: change rte_memcpy to inline function
@ 2016-05-10  8:31 Jianbo Liu
  2016-05-13  9:12 ` Jerin Jacob
  2016-05-13 15:49 ` Thomas Monjalon
  0 siblings, 2 replies; 7+ messages in thread
From: Jianbo Liu @ 2016-05-10  8:31 UTC (permalink / raw)
  To: dev, jerin.jacob; +Cc: Jianbo Liu

Other APP may call rte_memcpy by function pointer,
so change it to an inline function.

Signed-off-by: Jianbo Liu <jianbo.liu@linaro.org>
---
 lib/librte_eal/common/include/arch/arm/rte_memcpy_64.h | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/lib/librte_eal/common/include/arch/arm/rte_memcpy_64.h b/lib/librte_eal/common/include/arch/arm/rte_memcpy_64.h
index 917cdc1..3abe7cd 100644
--- a/lib/librte_eal/common/include/arch/arm/rte_memcpy_64.h
+++ b/lib/librte_eal/common/include/arch/arm/rte_memcpy_64.h
@@ -78,7 +78,11 @@ rte_mov256(uint8_t *dst, const uint8_t *src)
 	memcpy(dst, src, 256);
 }
 
-#define rte_memcpy(d, s, n)	memcpy((d), (s), (n))
+static inline void *
+rte_memcpy(void *dst, const void *src, size_t n)
+{
+	return memcpy(dst, src, n);
+}
 
 static inline void *
 rte_memcpy_func(void *dst, const void *src, size_t n)
-- 
2.4.11

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

* Re: [dpdk-dev] [PATCH] arm64: change rte_memcpy to inline function
  2016-05-10  8:31 [dpdk-dev] [PATCH] arm64: change rte_memcpy to inline function Jianbo Liu
@ 2016-05-13  9:12 ` Jerin Jacob
  2016-05-13 15:49 ` Thomas Monjalon
  1 sibling, 0 replies; 7+ messages in thread
From: Jerin Jacob @ 2016-05-13  9:12 UTC (permalink / raw)
  To: Jianbo Liu; +Cc: dev

On Tue, May 10, 2016 at 02:01:04PM +0530, Jianbo Liu wrote:
> Other APP may call rte_memcpy by function pointer,

Instead of "Other APP" may be better to use DPDK application

> so change it to an inline function.
> 
> Signed-off-by: Jianbo Liu <jianbo.liu@linaro.org>

Acked-by: Jerin Jacob <jerin.jacob@caviumnetworks.com>

> ---
>  lib/librte_eal/common/include/arch/arm/rte_memcpy_64.h | 6 +++++-
>  1 file changed, 5 insertions(+), 1 deletion(-)
> 
> diff --git a/lib/librte_eal/common/include/arch/arm/rte_memcpy_64.h b/lib/librte_eal/common/include/arch/arm/rte_memcpy_64.h
> index 917cdc1..3abe7cd 100644
> --- a/lib/librte_eal/common/include/arch/arm/rte_memcpy_64.h
> +++ b/lib/librte_eal/common/include/arch/arm/rte_memcpy_64.h
> @@ -78,7 +78,11 @@ rte_mov256(uint8_t *dst, const uint8_t *src)
>  	memcpy(dst, src, 256);
>  }
>  
> -#define rte_memcpy(d, s, n)	memcpy((d), (s), (n))
> +static inline void *
> +rte_memcpy(void *dst, const void *src, size_t n)
> +{
> +	return memcpy(dst, src, n);
> +}
>  
>  static inline void *
>  rte_memcpy_func(void *dst, const void *src, size_t n)
> -- 
> 2.4.11
> 

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

* Re: [dpdk-dev] [PATCH] arm64: change rte_memcpy to inline function
  2016-05-10  8:31 [dpdk-dev] [PATCH] arm64: change rte_memcpy to inline function Jianbo Liu
  2016-05-13  9:12 ` Jerin Jacob
@ 2016-05-13 15:49 ` Thomas Monjalon
  2016-05-19 13:48   ` Jianbo Liu
  1 sibling, 1 reply; 7+ messages in thread
From: Thomas Monjalon @ 2016-05-13 15:49 UTC (permalink / raw)
  To: Jianbo Liu; +Cc: dev, jerin.jacob

2016-05-10 14:01, Jianbo Liu:
> Other APP may call rte_memcpy by function pointer,
> so change it to an inline function.

Any example in mind?

> --- a/lib/librte_eal/common/include/arch/arm/rte_memcpy_64.h
> +++ b/lib/librte_eal/common/include/arch/arm/rte_memcpy_64.h
> -#define rte_memcpy(d, s, n)	memcpy((d), (s), (n))
> +static inline void *
> +rte_memcpy(void *dst, const void *src, size_t n)
> +{
> +	return memcpy(dst, src, n);
> +}

It has no sense if other archs (arm32, ppc64, tile) are not updated.

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

* Re: [dpdk-dev] [PATCH] arm64: change rte_memcpy to inline function
  2016-05-13 15:49 ` Thomas Monjalon
@ 2016-05-19 13:48   ` Jianbo Liu
  2016-05-19 15:56     ` Thomas Monjalon
  0 siblings, 1 reply; 7+ messages in thread
From: Jianbo Liu @ 2016-05-19 13:48 UTC (permalink / raw)
  To: Thomas Monjalon; +Cc: dev, Jerin Jacob

On 13 May 2016 at 23:49, Thomas Monjalon <thomas.monjalon@6wind.com> wrote:
> 2016-05-10 14:01, Jianbo Liu:
>> Other APP may call rte_memcpy by function pointer,
>> so change it to an inline function.
>
> Any example in mind?
>
It's for ODP-DPDK.
>> --- a/lib/librte_eal/common/include/arch/arm/rte_memcpy_64.h
>> +++ b/lib/librte_eal/common/include/arch/arm/rte_memcpy_64.h
>> -#define rte_memcpy(d, s, n)  memcpy((d), (s), (n))
>> +static inline void *
>> +rte_memcpy(void *dst, const void *src, size_t n)
>> +{
>> +     return memcpy(dst, src, n);
>> +}
>
> It has no sense if other archs (arm32, ppc64, tile) are not updated.
>
But it also an inline function on x86.
Sorry for my late reply...

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

* Re: [dpdk-dev] [PATCH] arm64: change rte_memcpy to inline function
  2016-05-19 13:48   ` Jianbo Liu
@ 2016-05-19 15:56     ` Thomas Monjalon
  2016-06-17 10:30       ` Thomas Monjalon
  0 siblings, 1 reply; 7+ messages in thread
From: Thomas Monjalon @ 2016-05-19 15:56 UTC (permalink / raw)
  To: Jianbo Liu; +Cc: dev, Jerin Jacob

2016-05-19 21:48, Jianbo Liu:
> On 13 May 2016 at 23:49, Thomas Monjalon <thomas.monjalon@6wind.com> wrote:
> > 2016-05-10 14:01, Jianbo Liu:
> >> Other APP may call rte_memcpy by function pointer,
> >> so change it to an inline function.
> >
> > Any example in mind?
> >
> It's for ODP-DPDK.

Given that ODP is open (dataplane), you should also consider ppc64 and tile.

> >> --- a/lib/librte_eal/common/include/arch/arm/rte_memcpy_64.h
> >> +++ b/lib/librte_eal/common/include/arch/arm/rte_memcpy_64.h
> >> -#define rte_memcpy(d, s, n)  memcpy((d), (s), (n))
> >> +static inline void *
> >> +rte_memcpy(void *dst, const void *src, size_t n)
> >> +{
> >> +     return memcpy(dst, src, n);
> >> +}
> >
> > It has no sense if other archs (arm32, ppc64, tile) are not updated.
> >
> But it also an inline function on x86.

In x86, it was implemented as a function because there is some code.
If you want to make sure it is always a function, even in the case
of just calling memcpy from libc, you should put a doxygen comment in
the generic part and adapt every archs.

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

* Re: [dpdk-dev] [PATCH] arm64: change rte_memcpy to inline function
  2016-05-19 15:56     ` Thomas Monjalon
@ 2016-06-17 10:30       ` Thomas Monjalon
  2016-06-22  8:10         ` Jianbo Liu
  0 siblings, 1 reply; 7+ messages in thread
From: Thomas Monjalon @ 2016-06-17 10:30 UTC (permalink / raw)
  To: Jianbo Liu; +Cc: dev, Jerin Jacob

2016-05-19 17:56, Thomas Monjalon:
> 2016-05-19 21:48, Jianbo Liu:
> > On 13 May 2016 at 23:49, Thomas Monjalon <thomas.monjalon@6wind.com> wrote:
> > > 2016-05-10 14:01, Jianbo Liu:
> > >> Other APP may call rte_memcpy by function pointer,
> > >> so change it to an inline function.
> > >
> > > Any example in mind?
> > >
> > It's for ODP-DPDK.
> 
> Given that ODP is open (dataplane), you should also consider ppc64 and tile.
> 
> > >> --- a/lib/librte_eal/common/include/arch/arm/rte_memcpy_64.h
> > >> +++ b/lib/librte_eal/common/include/arch/arm/rte_memcpy_64.h
> > >> -#define rte_memcpy(d, s, n)  memcpy((d), (s), (n))
> > >> +static inline void *
> > >> +rte_memcpy(void *dst, const void *src, size_t n)
> > >> +{
> > >> +     return memcpy(dst, src, n);
> > >> +}
> > >
> > > It has no sense if other archs (arm32, ppc64, tile) are not updated.
> > >
> > But it also an inline function on x86.
> 
> In x86, it was implemented as a function because there is some code.
> If you want to make sure it is always a function, even in the case
> of just calling memcpy from libc, you should put a doxygen comment in
> the generic part and adapt every archs.

no news?
a v2 would be welcome

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

* Re: [dpdk-dev] [PATCH] arm64: change rte_memcpy to inline function
  2016-06-17 10:30       ` Thomas Monjalon
@ 2016-06-22  8:10         ` Jianbo Liu
  0 siblings, 0 replies; 7+ messages in thread
From: Jianbo Liu @ 2016-06-22  8:10 UTC (permalink / raw)
  To: Thomas Monjalon; +Cc: dev, Jerin Jacob

On 17 June 2016 at 18:30, Thomas Monjalon <thomas.monjalon@6wind.com> wrote:
> 2016-05-19 17:56, Thomas Monjalon:
>> 2016-05-19 21:48, Jianbo Liu:
>> > On 13 May 2016 at 23:49, Thomas Monjalon <thomas.monjalon@6wind.com> wrote:
>> > > 2016-05-10 14:01, Jianbo Liu:
>> > >> Other APP may call rte_memcpy by function pointer,
>> > >> so change it to an inline function.
>> > >
>> > > Any example in mind?
>> > >
>> > It's for ODP-DPDK.
>>
>> Given that ODP is open (dataplane), you should also consider ppc64 and tile.
>>
>> > >> --- a/lib/librte_eal/common/include/arch/arm/rte_memcpy_64.h
>> > >> +++ b/lib/librte_eal/common/include/arch/arm/rte_memcpy_64.h
>> > >> -#define rte_memcpy(d, s, n)  memcpy((d), (s), (n))
>> > >> +static inline void *
>> > >> +rte_memcpy(void *dst, const void *src, size_t n)
>> > >> +{
>> > >> +     return memcpy(dst, src, n);
>> > >> +}
>> > >
>> > > It has no sense if other archs (arm32, ppc64, tile) are not updated.
>> > >
>> > But it also an inline function on x86.
>>
>> In x86, it was implemented as a function because there is some code.
>> If you want to make sure it is always a function, even in the case
>> of just calling memcpy from libc, you should put a doxygen comment in
>> the generic part and adapt every archs.
>
> no news?
> a v2 would be welcome

Hi Thomas,
Please close it, since there is already a solution to this issue in odp-dpdk.

Thanks!
Jianbo

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

end of thread, other threads:[~2016-06-22  8:10 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-05-10  8:31 [dpdk-dev] [PATCH] arm64: change rte_memcpy to inline function Jianbo Liu
2016-05-13  9:12 ` Jerin Jacob
2016-05-13 15:49 ` Thomas Monjalon
2016-05-19 13:48   ` Jianbo Liu
2016-05-19 15:56     ` Thomas Monjalon
2016-06-17 10:30       ` Thomas Monjalon
2016-06-22  8:10         ` Jianbo Liu

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).