Re: [lng-odp] [PATCHv3] test: skip pktio_perf tests on 1 and 2 cpus machines

2016-10-24 Thread Maxim Uvarov

Merged,
Maxim.

On 10/21/16 17:12, Mike Holmes wrote:

On 14 October 2016 at 07:51, Maxim Uvarov  wrote:

Make check should skip the test instead of failing it.
Test splits RX and TX cores for packet processing. Core
0 bind to control thread. So running machine should have
at least 2 worker threads which is not enough on 1 and 2
cpus machine. CUnit uses special value 77 to mark test as
SKIPPED and not fail on it.

Signed-off-by: Maxim Uvarov 

Reviewed-by: Mike Holmes 


---

  v3: update if logic (found just after apply.)
  v2: update description (Mike)
  test/common_plat/performance/odp_pktio_perf.c | 16 +++-
  1 file changed, 11 insertions(+), 5 deletions(-)

diff --git a/test/common_plat/performance/odp_pktio_perf.c 
b/test/common_plat/performance/odp_pktio_perf.c
index f041b13..483f067 100644
--- a/test/common_plat/performance/odp_pktio_perf.c
+++ b/test/common_plat/performance/odp_pktio_perf.c
@@ -34,6 +34,8 @@
  #include 
  #include 

+#define TEST_SKIP 77
+
  #define PKT_BUF_NUM   8192
  #define MAX_NUM_IFACES2
  #define TEST_HDR_MAGIC0x92749451
@@ -558,7 +560,7 @@ static int setup_txrx_masks(odp_cpumask_t *thd_mask_tx,
gbl_args->args.cpu_count);
 if (num_workers < 2) {
 LOG_ERR("Need at least two cores\n");
-   return -1;
+   return TEST_SKIP;
 }

 if (gbl_args->args.num_tx_workers) {
@@ -659,7 +661,7 @@ static int run_test_single(odp_cpumask_t *thd_mask_tx,

  static int run_test(void)
  {
-   int ret = 1;
+   int ret;
 int i;
 odp_cpumask_t txmask, rxmask;
 test_status_t status = {
@@ -669,8 +671,9 @@ static int run_test(void)
 .warmup = 1,
 };

-   if (setup_txrx_masks(, ) != 0)
-   return -1;
+   ret = setup_txrx_masks(, );
+   if (ret)
+   return ret;

 printf("Starting test with params:\n");
 printf("\tTransmit workers: \t%d\n", odp_cpumask_count());
@@ -691,8 +694,11 @@ static int run_test(void)
 run_test_single(, , );
 status.warmup = 0;

-   while (ret > 0)
+   while (1) {
 ret = run_test_single(, , );
+   if (ret <= 0)
+   break;
+   }

 return ret;
  }
--
2.7.1.250.gff4ea60








Re: [lng-odp] [PATCHv3] test: skip pktio_perf tests on 1 and 2 cpus machines

2016-10-21 Thread Mike Holmes
On 14 October 2016 at 07:51, Maxim Uvarov  wrote:
> Make check should skip the test instead of failing it.
> Test splits RX and TX cores for packet processing. Core
> 0 bind to control thread. So running machine should have
> at least 2 worker threads which is not enough on 1 and 2
> cpus machine. CUnit uses special value 77 to mark test as
> SKIPPED and not fail on it.
>
> Signed-off-by: Maxim Uvarov 

Reviewed-by: Mike Holmes 

> ---
>
>  v3: update if logic (found just after apply.)
>  v2: update description (Mike)
>  test/common_plat/performance/odp_pktio_perf.c | 16 +++-
>  1 file changed, 11 insertions(+), 5 deletions(-)
>
> diff --git a/test/common_plat/performance/odp_pktio_perf.c 
> b/test/common_plat/performance/odp_pktio_perf.c
> index f041b13..483f067 100644
> --- a/test/common_plat/performance/odp_pktio_perf.c
> +++ b/test/common_plat/performance/odp_pktio_perf.c
> @@ -34,6 +34,8 @@
>  #include 
>  #include 
>
> +#define TEST_SKIP 77
> +
>  #define PKT_BUF_NUM   8192
>  #define MAX_NUM_IFACES2
>  #define TEST_HDR_MAGIC0x92749451
> @@ -558,7 +560,7 @@ static int setup_txrx_masks(odp_cpumask_t *thd_mask_tx,
>gbl_args->args.cpu_count);
> if (num_workers < 2) {
> LOG_ERR("Need at least two cores\n");
> -   return -1;
> +   return TEST_SKIP;
> }
>
> if (gbl_args->args.num_tx_workers) {
> @@ -659,7 +661,7 @@ static int run_test_single(odp_cpumask_t *thd_mask_tx,
>
>  static int run_test(void)
>  {
> -   int ret = 1;
> +   int ret;
> int i;
> odp_cpumask_t txmask, rxmask;
> test_status_t status = {
> @@ -669,8 +671,9 @@ static int run_test(void)
> .warmup = 1,
> };
>
> -   if (setup_txrx_masks(, ) != 0)
> -   return -1;
> +   ret = setup_txrx_masks(, );
> +   if (ret)
> +   return ret;
>
> printf("Starting test with params:\n");
> printf("\tTransmit workers: \t%d\n", odp_cpumask_count());
> @@ -691,8 +694,11 @@ static int run_test(void)
> run_test_single(, , );
> status.warmup = 0;
>
> -   while (ret > 0)
> +   while (1) {
> ret = run_test_single(, , );
> +   if (ret <= 0)
> +   break;
> +   }
>
> return ret;
>  }
> --
> 2.7.1.250.gff4ea60
>



-- 
Mike Holmes
Program Manager - Linaro Networking Group
Linaro.org │ Open source software for ARM SoCs
"Work should be fun and collaborative, the rest follows"


Re: [lng-odp] [PATCHv3] test: skip pktio_perf tests on 1 and 2 cpus machines

2016-10-21 Thread Maxim Uvarov

please review v3.

Maxim.

On 10/14/16 14:51, Maxim Uvarov wrote:

Make check should skip the test instead of failing it.
Test splits RX and TX cores for packet processing. Core
0 bind to control thread. So running machine should have
at least 2 worker threads which is not enough on 1 and 2
cpus machine. CUnit uses special value 77 to mark test as
SKIPPED and not fail on it.

Signed-off-by: Maxim Uvarov 
---

  v3: update if logic (found just after apply.)
  v2: update description (Mike)
  test/common_plat/performance/odp_pktio_perf.c | 16 +++-
  1 file changed, 11 insertions(+), 5 deletions(-)

diff --git a/test/common_plat/performance/odp_pktio_perf.c 
b/test/common_plat/performance/odp_pktio_perf.c
index f041b13..483f067 100644
--- a/test/common_plat/performance/odp_pktio_perf.c
+++ b/test/common_plat/performance/odp_pktio_perf.c
@@ -34,6 +34,8 @@
  #include 
  #include 
  
+#define TEST_SKIP 77

+
  #define PKT_BUF_NUM   8192
  #define MAX_NUM_IFACES2
  #define TEST_HDR_MAGIC0x92749451
@@ -558,7 +560,7 @@ static int setup_txrx_masks(odp_cpumask_t *thd_mask_tx,
   gbl_args->args.cpu_count);
if (num_workers < 2) {
LOG_ERR("Need at least two cores\n");
-   return -1;
+   return TEST_SKIP;
}
  
  	if (gbl_args->args.num_tx_workers) {

@@ -659,7 +661,7 @@ static int run_test_single(odp_cpumask_t *thd_mask_tx,
  
  static int run_test(void)

  {
-   int ret = 1;
+   int ret;
int i;
odp_cpumask_t txmask, rxmask;
test_status_t status = {
@@ -669,8 +671,9 @@ static int run_test(void)
.warmup = 1,
};
  
-	if (setup_txrx_masks(, ) != 0)

-   return -1;
+   ret = setup_txrx_masks(, );
+   if (ret)
+   return ret;
  
  	printf("Starting test with params:\n");

printf("\tTransmit workers: \t%d\n", odp_cpumask_count());
@@ -691,8 +694,11 @@ static int run_test(void)
run_test_single(, , );
status.warmup = 0;
  
-	while (ret > 0)

+   while (1) {
ret = run_test_single(, , );
+   if (ret <= 0)
+   break;
+   }
  
  	return ret;

  }




[lng-odp] [PATCHv3] test: skip pktio_perf tests on 1 and 2 cpus machines

2016-10-14 Thread Maxim Uvarov
Make check should skip the test instead of failing it.
Test splits RX and TX cores for packet processing. Core
0 bind to control thread. So running machine should have
at least 2 worker threads which is not enough on 1 and 2
cpus machine. CUnit uses special value 77 to mark test as
SKIPPED and not fail on it.

Signed-off-by: Maxim Uvarov 
---

 v3: update if logic (found just after apply.)
 v2: update description (Mike)
 test/common_plat/performance/odp_pktio_perf.c | 16 +++-
 1 file changed, 11 insertions(+), 5 deletions(-)

diff --git a/test/common_plat/performance/odp_pktio_perf.c 
b/test/common_plat/performance/odp_pktio_perf.c
index f041b13..483f067 100644
--- a/test/common_plat/performance/odp_pktio_perf.c
+++ b/test/common_plat/performance/odp_pktio_perf.c
@@ -34,6 +34,8 @@
 #include 
 #include 
 
+#define TEST_SKIP 77
+
 #define PKT_BUF_NUM   8192
 #define MAX_NUM_IFACES2
 #define TEST_HDR_MAGIC0x92749451
@@ -558,7 +560,7 @@ static int setup_txrx_masks(odp_cpumask_t *thd_mask_tx,
   gbl_args->args.cpu_count);
if (num_workers < 2) {
LOG_ERR("Need at least two cores\n");
-   return -1;
+   return TEST_SKIP;
}
 
if (gbl_args->args.num_tx_workers) {
@@ -659,7 +661,7 @@ static int run_test_single(odp_cpumask_t *thd_mask_tx,
 
 static int run_test(void)
 {
-   int ret = 1;
+   int ret;
int i;
odp_cpumask_t txmask, rxmask;
test_status_t status = {
@@ -669,8 +671,9 @@ static int run_test(void)
.warmup = 1,
};
 
-   if (setup_txrx_masks(, ) != 0)
-   return -1;
+   ret = setup_txrx_masks(, );
+   if (ret)
+   return ret;
 
printf("Starting test with params:\n");
printf("\tTransmit workers: \t%d\n", odp_cpumask_count());
@@ -691,8 +694,11 @@ static int run_test(void)
run_test_single(, , );
status.warmup = 0;
 
-   while (ret > 0)
+   while (1) {
ret = run_test_single(, , );
+   if (ret <= 0)
+   break;
+   }
 
return ret;
 }
-- 
2.7.1.250.gff4ea60