diff mbox

[PATCHv2] test: skip pktio_perf tests on 1 and 2 cpus machines

Message ID 1476376645-12029-1-git-send-email-maxim.uvarov@linaro.org
State Superseded
Headers show

Commit Message

Maxim Uvarov Oct. 13, 2016, 4:37 p.m. UTC
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 <maxim.uvarov@linaro.org>

---

 v2: update description (Mike)

 test/common_plat/performance/odp_pktio_perf.c | 14 ++++++++++----
 1 file changed, 10 insertions(+), 4 deletions(-)

-- 
2.7.1.250.gff4ea60

Comments

Mike Holmes Oct. 13, 2016, 8:57 p.m. UTC | #1
On 13 October 2016 at 12:37, Maxim Uvarov <maxim.uvarov@linaro.org> 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 <maxim.uvarov@linaro.org



Reviewed-and-tested-by: Mike Holmes <mike.holmes@linaro.org>

Using .travis.yml script added to the root of odp  to get github to run on
every push you make to git hub.

before
https://travis-ci.org/mike-holmes-linaro/odp/builds/167472534#L1595
after
https://travis-ci.org/mike-holmes-linaro/odp/builds/167474316



>


---
>

>  v2: update description (Mike)

>

>  test/common_plat/performance/odp_pktio_perf.c | 14 ++++++++++----

>  1 file changed, 10 insertions(+), 4 deletions(-)

>

> diff --git a/test/common_plat/performance/odp_pktio_perf.c

> b/test/common_plat/performance/odp_pktio_perf.c

> index f041b13..846dfaa 100644

> --- a/test/common_plat/performance/odp_pktio_perf.c

> +++ b/test/common_plat/performance/odp_pktio_perf.c

> @@ -34,6 +34,8 @@

>  #include <inttypes.h>

>  #include <test_debug.h>

>

> +#define TEST_SKIP 77

> +

>  #define PKT_BUF_NUM       8192

>  #define MAX_NUM_IFACES    2

>  #define TEST_HDR_MAGIC    0x92749451

> @@ -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) {

> @@ -669,8 +671,9 @@ static int run_test(void)

>                 .warmup = 1,

>         };

>

> -       if (setup_txrx_masks(&txmask, &rxmask) != 0)

> -               return -1;

> +       ret = setup_txrx_masks(&txmask, &rxmask);

> +       if (ret)

> +               return ret;

>

>         printf("Starting test with params:\n");

>         printf("\tTransmit workers:     \t%d\n",

> odp_cpumask_count(&txmask));

> @@ -691,8 +694,11 @@ static int run_test(void)

>         run_test_single(&txmask, &rxmask, &status);

>         status.warmup = 0;

>

> -       while (ret > 0)

> +       while (1) {

>                 ret = run_test_single(&txmask, &rxmask, &status);

> +               if (ret)

> +                       break;

> +       }

>

>         return ret;

>  }

> --

> 2.7.1.250.gff4ea60

>

>



-- 
Mike Holmes
Program Manager - Linaro Networking Group
Linaro.org <http://www.linaro.org/> *│ *Open source software for ARM SoCs
"Work should be fun and collaborative, the rest follows"
Maxim Uvarov Oct. 14, 2016, 11:02 a.m. UTC | #2
Merged.

I think it will be good to commit .travis.yml into repo. So that any git 
push to github will run tests.

Maxim.

On 10/13/16 23:57, Mike Holmes wrote:
>

>

> On 13 October 2016 at 12:37, Maxim Uvarov <maxim.uvarov@linaro.org 

> <mailto:maxim.uvarov@linaro.org>> 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 <maxim.uvarov@linaro.org

>     <mailto:maxim.uvarov@linaro.org>

>

>

> Reviewed-and-tested-by: Mike Holmes <mike.holmes@linaro.org 

> <mailto:mike.holmes@linaro.org>>

>

> Using .travis.yml script added to the root of odp  to get github to 

> run on every push you make to git hub.

>

> before

> https://travis-ci.org/mike-holmes-linaro/odp/builds/167472534#L1595

> after

> https://travis-ci.org/mike-holmes-linaro/odp/builds/167474316

>

>     ---

>

>      v2: update description (Mike)

>

>      test/common_plat/performance/odp_pktio_perf.c | 14 ++++++++++----

>      1 file changed, 10 insertions(+), 4 deletions(-)

>

>     diff --git a/test/common_plat/performance/odp_pktio_perf.c

>     b/test/common_plat/performance/odp_pktio_perf.c

>     index f041b13..846dfaa 100644

>     --- a/test/common_plat/performance/odp_pktio_perf.c

>     +++ b/test/common_plat/performance/odp_pktio_perf.c

>     @@ -34,6 +34,8 @@

>      #include <inttypes.h>

>      #include <test_debug.h>

>

>     +#define TEST_SKIP 77

>     +

>      #define PKT_BUF_NUM       8192

>      #define MAX_NUM_IFACES    2

>      #define TEST_HDR_MAGIC    0x92749451

>     @@ -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) {

>     @@ -669,8 +671,9 @@ static int run_test(void)

>                     .warmup = 1,

>             };

>

>     -       if (setup_txrx_masks(&txmask, &rxmask) != 0)

>     -               return -1;

>     +       ret = setup_txrx_masks(&txmask, &rxmask);

>     +       if (ret)

>     +               return ret;

>

>             printf("Starting test with params:\n");

>             printf("\tTransmit workers:     \t%d\n",

>     odp_cpumask_count(&txmask));

>     @@ -691,8 +694,11 @@ static int run_test(void)

>             run_test_single(&txmask, &rxmask, &status);

>             status.warmup = 0;

>

>     -       while (ret > 0)

>     +       while (1) {

>                     ret = run_test_single(&txmask, &rxmask, &status);

>     +               if (ret)

>     +                       break;

>     +       }

>

>             return ret;

>      }

>     --

>     2.7.1.250.gff4ea60

>

>

>

>

> -- 

> Mike Holmes

> Program Manager - Linaro Networking Group

> Linaro.org <http://www.linaro.org/>***│ *Open source software for ARM SoCs

> "Work should be fun and collaborative, the rest follows"

>
Maxim Uvarov Oct. 14, 2016, 11:27 a.m. UTC | #3
Reverted patch.

I must be more careful with review my own patches.

On 10/13/16 23:57, Mike Holmes wrote:
>

>

> On 13 October 2016 at 12:37, Maxim Uvarov <maxim.uvarov@linaro.org 

> <mailto:maxim.uvarov@linaro.org>> 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 <maxim.uvarov@linaro.org

>     <mailto:maxim.uvarov@linaro.org>

>

>

> Reviewed-and-tested-by: Mike Holmes <mike.holmes@linaro.org 

> <mailto:mike.holmes@linaro.org>>

>

> Using .travis.yml script added to the root of odp  to get github to 

> run on every push you make to git hub.

>

> before

> https://travis-ci.org/mike-holmes-linaro/odp/builds/167472534#L1595

> after

> https://travis-ci.org/mike-holmes-linaro/odp/builds/167474316

>

>     ---

>

>      v2: update description (Mike)

>

>      test/common_plat/performance/odp_pktio_perf.c | 14 ++++++++++----

>      1 file changed, 10 insertions(+), 4 deletions(-)

>

>     diff --git a/test/common_plat/performance/odp_pktio_perf.c

>     b/test/common_plat/performance/odp_pktio_perf.c

>     index f041b13..846dfaa 100644

>     --- a/test/common_plat/performance/odp_pktio_perf.c

>     +++ b/test/common_plat/performance/odp_pktio_perf.c

>     @@ -34,6 +34,8 @@

>      #include <inttypes.h>

>      #include <test_debug.h>

>

>     +#define TEST_SKIP 77

>     +

>      #define PKT_BUF_NUM       8192

>      #define MAX_NUM_IFACES    2

>      #define TEST_HDR_MAGIC    0x92749451

>     @@ -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) {

>     @@ -669,8 +671,9 @@ static int run_test(void)

>                     .warmup = 1,

>             };

>

>     -       if (setup_txrx_masks(&txmask, &rxmask) != 0)

>     -               return -1;

>     +       ret = setup_txrx_masks(&txmask, &rxmask);

>     +       if (ret)

>     +               return ret;

>

>             printf("Starting test with params:\n");

>             printf("\tTransmit workers:     \t%d\n",

>     odp_cpumask_count(&txmask));

>     @@ -691,8 +694,11 @@ static int run_test(void)

>             run_test_single(&txmask, &rxmask, &status);

>             status.warmup = 0;

>

>     -       while (ret > 0)

>     +       while (1) {

>                     ret = run_test_single(&txmask, &rxmask, &status);

>     +               if (ret)

>     +                       break;

>


has to be if (ret <= 0)



>     +       }

>

>             return ret;

>      }

>     --

>     2.7.1.250.gff4ea60

>

>

>

>

> -- 

> Mike Holmes

> Program Manager - Linaro Networking Group

> Linaro.org <http://www.linaro.org/>***│ *Open source software for ARM SoCs

> "Work should be fun and collaborative, the rest follows"

>
Mike Holmes Oct. 14, 2016, 12:05 p.m. UTC | #4
On 14 October 2016 at 07:02, Maxim Uvarov <maxim.uvarov@linaro.org> wrote:

> Merged.

>

> I think it will be good to commit .travis.yml into repo. So that any git

> push to github will run tests.

>



The travis will be pushed as a patch, a second one for coverity als.
We have to alter how we do the version numbers and make them follow the
normal pattern so that github can build ODP, you can see the basic patch
for that there also.
Essentially you cant run script, it needs to be in configure and that has
some ripples that need cleaning as you can see in the patch.



>

> Maxim.

>

> On 10/13/16 23:57, Mike Holmes wrote:

>

>>

>>

>> On 13 October 2016 at 12:37, Maxim Uvarov <maxim.uvarov@linaro.org

>> <mailto:maxim.uvarov@linaro.org>> 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 <maxim.uvarov@linaro.org

>>     <mailto:maxim.uvarov@linaro.org>

>>

>>

>> Reviewed-and-tested-by: Mike Holmes <mike.holmes@linaro.org <mailto:

>> mike.holmes@linaro.org>>

>>

>>

>> Using .travis.yml script added to the root of odp  to get github to run

>> on every push you make to git hub.

>>

>> before

>> https://travis-ci.org/mike-holmes-linaro/odp/builds/167472534#L1595

>> after

>> https://travis-ci.org/mike-holmes-linaro/odp/builds/167474316

>>

>>     ---

>>

>>      v2: update description (Mike)

>>

>>      test/common_plat/performance/odp_pktio_perf.c | 14 ++++++++++----

>>      1 file changed, 10 insertions(+), 4 deletions(-)

>>

>>     diff --git a/test/common_plat/performance/odp_pktio_perf.c

>>     b/test/common_plat/performance/odp_pktio_perf.c

>>     index f041b13..846dfaa 100644

>>     --- a/test/common_plat/performance/odp_pktio_perf.c

>>     +++ b/test/common_plat/performance/odp_pktio_perf.c

>>     @@ -34,6 +34,8 @@

>>      #include <inttypes.h>

>>      #include <test_debug.h>

>>

>>     +#define TEST_SKIP 77

>>     +

>>      #define PKT_BUF_NUM       8192

>>      #define MAX_NUM_IFACES    2

>>      #define TEST_HDR_MAGIC    0x92749451

>>     @@ -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) {

>>     @@ -669,8 +671,9 @@ static int run_test(void)

>>                     .warmup = 1,

>>             };

>>

>>     -       if (setup_txrx_masks(&txmask, &rxmask) != 0)

>>     -               return -1;

>>     +       ret = setup_txrx_masks(&txmask, &rxmask);

>>     +       if (ret)

>>     +               return ret;

>>

>>             printf("Starting test with params:\n");

>>             printf("\tTransmit workers:     \t%d\n",

>>     odp_cpumask_count(&txmask));

>>     @@ -691,8 +694,11 @@ static int run_test(void)

>>             run_test_single(&txmask, &rxmask, &status);

>>             status.warmup = 0;

>>

>>     -       while (ret > 0)

>>     +       while (1) {

>>                     ret = run_test_single(&txmask, &rxmask, &status);

>>     +               if (ret)

>>     +                       break;

>>     +       }

>>

>>             return ret;

>>      }

>>     --

>>     2.7.1.250.gff4ea60

>>

>>

>>

>>

>> --

>> Mike Holmes

>> Program Manager - Linaro Networking Group

>> Linaro.org <http://www.linaro.org/>***│ *Open source software for ARM

>> SoCs

>> "Work should be fun and collaborative, the rest follows"

>>

>>

>



-- 
Mike Holmes
Program Manager - Linaro Networking Group
Linaro.org <http://www.linaro.org/> *│ *Open source software for ARM SoCs
"Work should be fun and collaborative, the rest follows"
diff mbox

Patch

diff --git a/test/common_plat/performance/odp_pktio_perf.c b/test/common_plat/performance/odp_pktio_perf.c
index f041b13..846dfaa 100644
--- a/test/common_plat/performance/odp_pktio_perf.c
+++ b/test/common_plat/performance/odp_pktio_perf.c
@@ -34,6 +34,8 @@ 
 #include <inttypes.h>
 #include <test_debug.h>
 
+#define TEST_SKIP 77
+
 #define PKT_BUF_NUM       8192
 #define MAX_NUM_IFACES    2
 #define TEST_HDR_MAGIC    0x92749451
@@ -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) {
@@ -669,8 +671,9 @@  static int run_test(void)
 		.warmup = 1,
 	};
 
-	if (setup_txrx_masks(&txmask, &rxmask) != 0)
-		return -1;
+	ret = setup_txrx_masks(&txmask, &rxmask);
+	if (ret)
+		return ret;
 
 	printf("Starting test with params:\n");
 	printf("\tTransmit workers:     \t%d\n", odp_cpumask_count(&txmask));
@@ -691,8 +694,11 @@  static int run_test(void)
 	run_test_single(&txmask, &rxmask, &status);
 	status.warmup = 0;
 
-	while (ret > 0)
+	while (1) {
 		ret = run_test_single(&txmask, &rxmask, &status);
+		if (ret)
+			break;
+	}
 
 	return ret;
 }