DPDK patches and discussions
 help / color / mirror / Atom feed
* [dpdk-dev] [PATCH 0/3] fix build issues with librte_sched, test_red on non x86 platform
@ 2015-08-18 12:40 Jerin Jacob
  2015-08-18 12:40 ` [dpdk-dev] [PATCH 1/3] sched: remove unused inclusion of tmmintrin.h Jerin Jacob
  0 siblings, 1 reply; 8+ messages in thread
From: Jerin Jacob @ 2015-08-18 12:40 UTC (permalink / raw)
  To: dev

This patch set enable librte_sched, app/test/test_sched and app/test/test_red
to build on non x86 platform

Jerin Jacob (3):
  sched: remove unused inclusion of tmmintrin.h
  app/test: test_sched: fix needless build dependency on
    CONFIG_RTE_ARCH_X86_64
  app/test: enable test_red to build on non x86 platform

 app/test/Makefile             | 2 +-
 app/test/test_red.c           | 2 ++
 lib/librte_sched/rte_bitmap.h | 3 ---
 3 files changed, 3 insertions(+), 4 deletions(-)

-- 
2.1.0

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

* [dpdk-dev] [PATCH 1/3] sched: remove unused inclusion of tmmintrin.h
  2015-08-18 12:40 [dpdk-dev] [PATCH 0/3] fix build issues with librte_sched, test_red on non x86 platform Jerin Jacob
@ 2015-08-18 12:40 ` Jerin Jacob
  2015-08-18 12:40   ` [dpdk-dev] [PATCH 2/3] app/test: test_sched: fix needless build dependency on CONFIG_RTE_ARCH_X86_64 Jerin Jacob
  0 siblings, 1 reply; 8+ messages in thread
From: Jerin Jacob @ 2015-08-18 12:40 UTC (permalink / raw)
  To: dev

SSSE3 intrinsics not used in rte_bitmap.h

Signed-off-by: Jerin Jacob <jerin.jacob@caviumnetworks.com>
---
 lib/librte_sched/rte_bitmap.h | 3 ---
 1 file changed, 3 deletions(-)

diff --git a/lib/librte_sched/rte_bitmap.h b/lib/librte_sched/rte_bitmap.h
index 216a344..3d911e4 100644
--- a/lib/librte_sched/rte_bitmap.h
+++ b/lib/librte_sched/rte_bitmap.h
@@ -73,9 +73,6 @@ extern "C" {
 #ifndef RTE_BITMAP_OPTIMIZATIONS
 #define RTE_BITMAP_OPTIMIZATIONS		         1
 #endif
-#if RTE_BITMAP_OPTIMIZATIONS
-#include <tmmintrin.h>
-#endif
 
 /* Slab */
 #define RTE_BITMAP_SLAB_BIT_SIZE                 64
-- 
2.1.0

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

* [dpdk-dev] [PATCH 2/3] app/test: test_sched: fix needless build dependency on CONFIG_RTE_ARCH_X86_64
  2015-08-18 12:40 ` [dpdk-dev] [PATCH 1/3] sched: remove unused inclusion of tmmintrin.h Jerin Jacob
@ 2015-08-18 12:40   ` Jerin Jacob
  2015-08-18 12:40     ` [dpdk-dev] [PATCH 3/3] app/test: enable test_red to build on non x86 platform Jerin Jacob
  0 siblings, 1 reply; 8+ messages in thread
From: Jerin Jacob @ 2015-08-18 12:40 UTC (permalink / raw)
  To: dev

Signed-off-by: Jerin Jacob <jerin.jacob@caviumnetworks.com>
---
 app/test/Makefile | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/app/test/Makefile b/app/test/Makefile
index e7f148f..43429b9 100644
--- a/app/test/Makefile
+++ b/app/test/Makefile
@@ -115,7 +115,7 @@ SRCS-$(CONFIG_RTE_LIBRTE_CMDLINE) += test_cmdline_lib.c
 
 ifeq ($(CONFIG_RTE_LIBRTE_SCHED),y)
 SRCS-y += test_red.c
-SRCS-$(CONFIG_RTE_ARCH_X86_64) += test_sched.c
+SRCS-y += test_sched.c
 endif
 
 SRCS-$(CONFIG_RTE_LIBRTE_METER) += test_meter.c
-- 
2.1.0

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

* [dpdk-dev] [PATCH 3/3] app/test: enable test_red to build on non x86 platform
  2015-08-18 12:40   ` [dpdk-dev] [PATCH 2/3] app/test: test_sched: fix needless build dependency on CONFIG_RTE_ARCH_X86_64 Jerin Jacob
@ 2015-08-18 12:40     ` Jerin Jacob
  2015-08-25 12:03       ` Thomas Monjalon
  0 siblings, 1 reply; 8+ messages in thread
From: Jerin Jacob @ 2015-08-18 12:40 UTC (permalink / raw)
  To: dev

Signed-off-by: Jerin Jacob <jerin.jacob@caviumnetworks.com>
---
 app/test/test_red.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/app/test/test_red.c b/app/test/test_red.c
index 262df72..813c508 100644
--- a/app/test/test_red.c
+++ b/app/test/test_red.c
@@ -146,6 +146,7 @@ static void rdtsc_prof_init(struct rdtsc_prof *p, const char *name)
 
 static inline void rdtsc_prof_start(struct rdtsc_prof *p)
 {
+#if defined(RTE_ARCH_X86_64) || defined(RTE_ARCH_I686) || defined(RTE_ARCH_X86_X32)
 #ifdef __PIC__
     asm volatile (
     "mov %%ebx, %%edi\n"
@@ -155,6 +156,7 @@ static inline void rdtsc_prof_start(struct rdtsc_prof *p)
 #else
 	asm( "cpuid" : : : "%eax", "%ebx", "%ecx", "%edx" );
 #endif
+#endif
 	p->clk_start = rte_rdtsc();
 }
 
-- 
2.1.0

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

* Re: [dpdk-dev] [PATCH 3/3] app/test: enable test_red to build on non x86 platform
  2015-08-18 12:40     ` [dpdk-dev] [PATCH 3/3] app/test: enable test_red to build on non x86 platform Jerin Jacob
@ 2015-08-25 12:03       ` Thomas Monjalon
  2015-08-27  4:08         ` Jerin Jacob
  0 siblings, 1 reply; 8+ messages in thread
From: Thomas Monjalon @ 2015-08-25 12:03 UTC (permalink / raw)
  To: dev, Jerin Jacob

2015-08-18 18:10, Jerin Jacob:
> --- a/app/test/test_red.c
> +++ b/app/test/test_red.c
> +#if defined(RTE_ARCH_X86_64) || defined(RTE_ARCH_I686) || defined(RTE_ARCH_X86_X32)
>  #ifdef __PIC__
>      asm volatile (
>      "mov %%ebx, %%edi\n"
> @@ -155,6 +156,7 @@ static inline void rdtsc_prof_start(struct rdtsc_prof *p)
>  #else
>  	asm( "cpuid" : : : "%eax", "%ebx", "%ecx", "%edx" );
>  #endif
> +#endif
>  	p->clk_start = rte_rdtsc();

The right fix would be to move that arch-specific code into an EAL abstraction.

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

* Re: [dpdk-dev] [PATCH 3/3] app/test: enable test_red to build on non x86 platform
  2015-08-25 12:03       ` Thomas Monjalon
@ 2015-08-27  4:08         ` Jerin Jacob
  2015-08-27  9:04           ` Thomas Monjalon
  0 siblings, 1 reply; 8+ messages in thread
From: Jerin Jacob @ 2015-08-27  4:08 UTC (permalink / raw)
  To: Thomas Monjalon; +Cc: dev

On Tue, Aug 25, 2015 at 02:03:13PM +0200, Thomas Monjalon wrote:
> 2015-08-18 18:10, Jerin Jacob:
> > --- a/app/test/test_red.c
> > +++ b/app/test/test_red.c
> > +#if defined(RTE_ARCH_X86_64) || defined(RTE_ARCH_I686) || defined(RTE_ARCH_X86_X32)
> >  #ifdef __PIC__
> >      asm volatile (
> >      "mov %%ebx, %%edi\n"
> > @@ -155,6 +156,7 @@ static inline void rdtsc_prof_start(struct rdtsc_prof *p)
> >  #else
> >  	asm( "cpuid" : : : "%eax", "%ebx", "%ecx", "%edx" );
> >  #endif
> > +#endif
> >  	p->clk_start = rte_rdtsc();
> 
> The right fix would be to move that arch-specific code into an EAL abstraction.

I agree. I thought the same. But I am not able to understand why 'cpuid'
instruction used here without any input/output parameters. What is the
role of 'cpuid' instruction in this specific function and what to
abstract in eal ?
 
> 

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

* Re: [dpdk-dev] [PATCH 3/3] app/test: enable test_red to build on non x86 platform
  2015-08-27  4:08         ` Jerin Jacob
@ 2015-08-27  9:04           ` Thomas Monjalon
  0 siblings, 0 replies; 8+ messages in thread
From: Thomas Monjalon @ 2015-08-27  9:04 UTC (permalink / raw)
  To: Jerin Jacob; +Cc: dev

2015-08-27 09:38, Jerin Jacob:
> On Tue, Aug 25, 2015 at 02:03:13PM +0200, Thomas Monjalon wrote:
> > 2015-08-18 18:10, Jerin Jacob:
> > > --- a/app/test/test_red.c
> > > +++ b/app/test/test_red.c
> > > +#if defined(RTE_ARCH_X86_64) || defined(RTE_ARCH_I686) || defined(RTE_ARCH_X86_X32)
> > >  #ifdef __PIC__
> > >      asm volatile (
> > >      "mov %%ebx, %%edi\n"
> > > @@ -155,6 +156,7 @@ static inline void rdtsc_prof_start(struct rdtsc_prof *p)
> > >  #else
> > >  	asm( "cpuid" : : : "%eax", "%ebx", "%ecx", "%edx" );
> > >  #endif
> > > +#endif
> > >  	p->clk_start = rte_rdtsc();
> > 
> > The right fix would be to move that arch-specific code into an EAL abstraction.
> 
> I agree. I thought the same. But I am not able to understand why 'cpuid'
> instruction used here without any input/output parameters. What is the
> role of 'cpuid' instruction in this specific function and what to
> abstract in eal ?

It is explained here:
	http://dpdk.org/ml/archives/dev/2014-January/001182.html

I think it can be replaced by rte_rdtsc_precise() which was implemented
after the above discussion. It uses rte_mb instead of cpuid.

As explained in the following thread, memory fence can be used instead of cpuid:
	http://stackoverflow.com/a/12634857
As showed in the following threads, rdtscp can also be used:
	http://stackoverflow.com/a/27697754
	http://dpdk.org/ml/archives/dev/2015-April/016770.html

It reminds me that we should deprecate rte_rdtsc() and rte_get_tsc_cycles() in
favor of a more generic name, e.g. rte_get_clock_cycles().

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

* [dpdk-dev] [PATCH 1/3] sched: remove unused inclusion of tmmintrin.h
  2015-08-30  8:55 [dpdk-dev] [PATCH v2 0/3] fix build issues with librte_sched, test_red " Jerin Jacob
@ 2015-08-30  8:55 ` Jerin Jacob
  0 siblings, 0 replies; 8+ messages in thread
From: Jerin Jacob @ 2015-08-30  8:55 UTC (permalink / raw)
  To: dev

SSSE3 intrinsics not used in rte_bitmap.h

Signed-off-by: Jerin Jacob <jerin.jacob@caviumnetworks.com>
---
 lib/librte_sched/rte_bitmap.h | 3 ---
 1 file changed, 3 deletions(-)

diff --git a/lib/librte_sched/rte_bitmap.h b/lib/librte_sched/rte_bitmap.h
index 216a344..3d911e4 100644
--- a/lib/librte_sched/rte_bitmap.h
+++ b/lib/librte_sched/rte_bitmap.h
@@ -73,9 +73,6 @@ extern "C" {
 #ifndef RTE_BITMAP_OPTIMIZATIONS
 #define RTE_BITMAP_OPTIMIZATIONS		         1
 #endif
-#if RTE_BITMAP_OPTIMIZATIONS
-#include <tmmintrin.h>
-#endif
 
 /* Slab */
 #define RTE_BITMAP_SLAB_BIT_SIZE                 64
-- 
2.1.0

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

end of thread, other threads:[~2015-08-30  8:56 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-08-18 12:40 [dpdk-dev] [PATCH 0/3] fix build issues with librte_sched, test_red on non x86 platform Jerin Jacob
2015-08-18 12:40 ` [dpdk-dev] [PATCH 1/3] sched: remove unused inclusion of tmmintrin.h Jerin Jacob
2015-08-18 12:40   ` [dpdk-dev] [PATCH 2/3] app/test: test_sched: fix needless build dependency on CONFIG_RTE_ARCH_X86_64 Jerin Jacob
2015-08-18 12:40     ` [dpdk-dev] [PATCH 3/3] app/test: enable test_red to build on non x86 platform Jerin Jacob
2015-08-25 12:03       ` Thomas Monjalon
2015-08-27  4:08         ` Jerin Jacob
2015-08-27  9:04           ` Thomas Monjalon
2015-08-30  8:55 [dpdk-dev] [PATCH v2 0/3] fix build issues with librte_sched, test_red " Jerin Jacob
2015-08-30  8:55 ` [dpdk-dev] [PATCH 1/3] sched: remove unused inclusion of tmmintrin.h Jerin Jacob

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