diff mbox

test/performance: pktio: perform an initial warmup run

Message ID 1446057907-20527-1-git-send-email-stuart.haslam@linaro.org
State Accepted
Commit 56f510fea3db1e2d7ff7e328d938b0d70fb1a0a5
Headers show

Commit Message

Stuart Haslam Oct. 28, 2015, 6:45 p.m. UTC
The results from the initial test run are often worse than would
normally be expected due to there being no warm up phase. As a
simple way to warm up run first test stage twice, ignoring the
results of the first run.

Signed-off-by: Stuart Haslam <stuart.haslam@linaro.org>
---
 test/performance/odp_pktio_perf.c | 12 ++++++++++--
 1 file changed, 10 insertions(+), 2 deletions(-)

Comments

Stuart Haslam Dec. 11, 2015, 4:54 p.m. UTC | #1
ping - needs review.

On 28 October 2015 at 18:45, Stuart Haslam <stuart.haslam@linaro.org> wrote:
> The results from the initial test run are often worse than would
> normally be expected due to there being no warm up phase. As a
> simple way to warm up run first test stage twice, ignoring the
> results of the first run.
>
> Signed-off-by: Stuart Haslam <stuart.haslam@linaro.org>
> ---
>  test/performance/odp_pktio_perf.c | 12 ++++++++++--
>  1 file changed, 10 insertions(+), 2 deletions(-)
>
> diff --git a/test/performance/odp_pktio_perf.c b/test/performance/odp_pktio_perf.c
> index efd26dc..38d684a 100644
> --- a/test/performance/odp_pktio_perf.c
> +++ b/test/performance/odp_pktio_perf.c
> @@ -134,6 +134,7 @@ typedef struct {
>         uint64_t pps_curr; /* Current attempted PPS */
>         uint64_t pps_pass; /* Highest passing PPS */
>         uint64_t pps_fail; /* Lowest failing PPS */
> +       int      warmup;   /* Warmup stage - ignore results */
>  } test_status_t;
>
>  /* Thread specific arguments */
> @@ -647,7 +648,10 @@ static int run_test_single(odp_cpumask_t *thd_mask_tx,
>         /* wait for receivers */
>         odph_linux_pthread_join(&thd_tbl[0], num_rx_workers);
>
> -       return process_results(expected_tx_cnt, status);
> +       if (!status->warmup)
> +               return process_results(expected_tx_cnt, status);
> +
> +       return 1;
>  }
>
>  static int run_test(void)
> @@ -659,6 +663,7 @@ static int run_test(void)
>                 .pps_curr = gbl_args->args.pps,
>                 .pps_pass = 0,
>                 .pps_fail = 0,
> +               .warmup = 1,
>         };
>
>         if (setup_txrx_masks(&txmask, &rxmask) != 0)
> @@ -679,6 +684,10 @@ static int run_test(void)
>                 printf("%s ", gbl_args->args.ifaces[i]);
>         printf("\n");
>
> +       /* first time just run the test but throw away the results */
> +       run_test_single(&txmask, &rxmask, &status);
> +       status.warmup = 0;
> +
>         while (ret > 0)
>                 ret = run_test_single(&txmask, &rxmask, &status);
>
> @@ -957,7 +966,6 @@ static void parse_args(int argc, char *argv[], test_args_t *args)
>                                 LOG_ABORT("Failed to alloc iface storage\n");
>
>                         strcpy(args->if_str, optarg);
> -
>                         for (token = strtok(args->if_str, ",");
>                              token != NULL && args->num_ifaces < MAX_NUM_IFACES;
>                              token = strtok(NULL, ","))
> --
> 2.1.1
>
Stuart Haslam Jan. 15, 2016, 3:21 p.m. UTC | #2
ping^2

On 11 December 2015 at 16:54, Stuart Haslam <stuart.haslam@linaro.org> wrote:
> ping - needs review.
>
> On 28 October 2015 at 18:45, Stuart Haslam <stuart.haslam@linaro.org> wrote:
>> The results from the initial test run are often worse than would
>> normally be expected due to there being no warm up phase. As a
>> simple way to warm up run first test stage twice, ignoring the
>> results of the first run.
>>
>> Signed-off-by: Stuart Haslam <stuart.haslam@linaro.org>
>> ---
>>  test/performance/odp_pktio_perf.c | 12 ++++++++++--
>>  1 file changed, 10 insertions(+), 2 deletions(-)
>>
>> diff --git a/test/performance/odp_pktio_perf.c b/test/performance/odp_pktio_perf.c
>> index efd26dc..38d684a 100644
>> --- a/test/performance/odp_pktio_perf.c
>> +++ b/test/performance/odp_pktio_perf.c
>> @@ -134,6 +134,7 @@ typedef struct {
>>         uint64_t pps_curr; /* Current attempted PPS */
>>         uint64_t pps_pass; /* Highest passing PPS */
>>         uint64_t pps_fail; /* Lowest failing PPS */
>> +       int      warmup;   /* Warmup stage - ignore results */
>>  } test_status_t;
>>
>>  /* Thread specific arguments */
>> @@ -647,7 +648,10 @@ static int run_test_single(odp_cpumask_t *thd_mask_tx,
>>         /* wait for receivers */
>>         odph_linux_pthread_join(&thd_tbl[0], num_rx_workers);
>>
>> -       return process_results(expected_tx_cnt, status);
>> +       if (!status->warmup)
>> +               return process_results(expected_tx_cnt, status);
>> +
>> +       return 1;
>>  }
>>
>>  static int run_test(void)
>> @@ -659,6 +663,7 @@ static int run_test(void)
>>                 .pps_curr = gbl_args->args.pps,
>>                 .pps_pass = 0,
>>                 .pps_fail = 0,
>> +               .warmup = 1,
>>         };
>>
>>         if (setup_txrx_masks(&txmask, &rxmask) != 0)
>> @@ -679,6 +684,10 @@ static int run_test(void)
>>                 printf("%s ", gbl_args->args.ifaces[i]);
>>         printf("\n");
>>
>> +       /* first time just run the test but throw away the results */
>> +       run_test_single(&txmask, &rxmask, &status);
>> +       status.warmup = 0;
>> +
>>         while (ret > 0)
>>                 ret = run_test_single(&txmask, &rxmask, &status);
>>
>> @@ -957,7 +966,6 @@ static void parse_args(int argc, char *argv[], test_args_t *args)
>>                                 LOG_ABORT("Failed to alloc iface storage\n");
>>
>>                         strcpy(args->if_str, optarg);
>> -
>>                         for (token = strtok(args->if_str, ",");
>>                              token != NULL && args->num_ifaces < MAX_NUM_IFACES;
>>                              token = strtok(NULL, ","))
>> --
>> 2.1.1
>>
Maxim Uvarov Jan. 19, 2016, 1:35 p.m. UTC | #3
Stuart, please find my run bellow. On my machine warm up did not help:

5773 pps, 5773 max pps,  0 rx drops, 0 tx drops
1746 pps, 5773 max pps,  0 rx drops, 0 tx drops
1127 pps, 5773 max pps,  0 rx drops, 0 tx drops
832 pps, 5773 max pps,  0 rx drops, 0 tx drops
2579 pps, 5773 max pps,  0 rx drops, 0 tx drops
424 pps, 5773 max pps,  0 rx drops, 0 tx drops
1001 pps, 5773 max pps,  0 rx drops, 0 tx drops
1652 pps, 5773 max pps,  0 rx drops, 0 tx drops
1367 pps, 5773 max pps,  0 rx drops, 0 tx drops
1744 pps, 5773 max pps,  0 rx drops, 0 tx drops
810 pps, 5773 max pps,  0 rx drops, 0 tx drops
2113 pps, 5773 max pps,  0 rx drops, 0 tx drops
2910 pps, 5773 max pps,  0 rx drops, 0 tx drops
2648 pps, 5773 max pps,  0 rx drops, 0 tx drops
1421 pps, 5773 max pps,  0 rx drops, 0 tx drops
2548 pps, 5773 max pps,  0 rx drops, 0 tx drops
4021 pps, 5773 max pps,  0 rx drops, 0 tx drops
2112 pps, 5773 max pps,  0 rx drops, 0 tx drops
2085 pps, 5773 max pps,  0 rx drops, 0 tx drops
1103 pps, 5773 max pps,  0 rx drops, 0 tx drops
474 pps, 5773 max pps,  0 rx drops, 0 tx drops
1724 pps, 5773 max pps,  0 rx drops, 0 tx drops
1560 pps, 5773 max pps,  0 rx drops, 0 tx drops
2552 pps, 5773 max pps,  0 rx drops, 0 tx drops
5233 pps, 5773 max pps,  0 rx drops, 0 tx drops
741 pps, 5773 max pps,  0 rx drops, 0 tx drops
829 pps, 5773 max pps,  0 rx drops, 0 tx drops
685 pps, 5773 max pps,  0 rx drops, 0 tx drops
1809 pps, 5773 max pps,  0 rx drops, 0 tx drops
698 pps, 5773 max pps,  0 rx drops, 0 tx drops
TEST RESULT: 5773 maximum packets per second.


On 01/15/2016 18:21, Stuart Haslam wrote:
> ping^2
>
> On 11 December 2015 at 16:54, Stuart Haslam <stuart.haslam@linaro.org> wrote:
>> ping - needs review.
>>
>> On 28 October 2015 at 18:45, Stuart Haslam <stuart.haslam@linaro.org> wrote:
>>> The results from the initial test run are often worse than would
>>> normally be expected due to there being no warm up phase. As a
>>> simple way to warm up run first test stage twice, ignoring the
>>> results of the first run.
>>>
>>> Signed-off-by: Stuart Haslam <stuart.haslam@linaro.org>
>>> ---
>>>   test/performance/odp_pktio_perf.c | 12 ++++++++++--
>>>   1 file changed, 10 insertions(+), 2 deletions(-)
>>>
>>> diff --git a/test/performance/odp_pktio_perf.c b/test/performance/odp_pktio_perf.c
>>> index efd26dc..38d684a 100644
>>> --- a/test/performance/odp_pktio_perf.c
>>> +++ b/test/performance/odp_pktio_perf.c
>>> @@ -134,6 +134,7 @@ typedef struct {
>>>          uint64_t pps_curr; /* Current attempted PPS */
>>>          uint64_t pps_pass; /* Highest passing PPS */
>>>          uint64_t pps_fail; /* Lowest failing PPS */
>>> +       int      warmup;   /* Warmup stage - ignore results */
>>>   } test_status_t;
>>>
>>>   /* Thread specific arguments */
>>> @@ -647,7 +648,10 @@ static int run_test_single(odp_cpumask_t *thd_mask_tx,
>>>          /* wait for receivers */
>>>          odph_linux_pthread_join(&thd_tbl[0], num_rx_workers);
>>>
>>> -       return process_results(expected_tx_cnt, status);
>>> +       if (!status->warmup)
>>> +               return process_results(expected_tx_cnt, status);
>>> +
>>> +       return 1;
>>>   }
>>>
>>>   static int run_test(void)
>>> @@ -659,6 +663,7 @@ static int run_test(void)
>>>                  .pps_curr = gbl_args->args.pps,
>>>                  .pps_pass = 0,
>>>                  .pps_fail = 0,
>>> +               .warmup = 1,
>>>          };
>>>
>>>          if (setup_txrx_masks(&txmask, &rxmask) != 0)
>>> @@ -679,6 +684,10 @@ static int run_test(void)
>>>                  printf("%s ", gbl_args->args.ifaces[i]);
>>>          printf("\n");
>>>
>>> +       /* first time just run the test but throw away the results */
>>> +       run_test_single(&txmask, &rxmask, &status);
>>> +       status.warmup = 0;
>>> +
>>>          while (ret > 0)
>>>                  ret = run_test_single(&txmask, &rxmask, &status);
>>>
>>> @@ -957,7 +966,6 @@ static void parse_args(int argc, char *argv[], test_args_t *args)
>>>                                  LOG_ABORT("Failed to alloc iface storage\n");
>>>
>>>                          strcpy(args->if_str, optarg);
>>> -
>>>                          for (token = strtok(args->if_str, ",");
>>>                               token != NULL && args->num_ifaces < MAX_NUM_IFACES;
>>>                               token = strtok(NULL, ","))
>>> --
>>> 2.1.1
>>>
> _______________________________________________
> lng-odp mailing list
> lng-odp@lists.linaro.org
> https://lists.linaro.org/mailman/listinfo/lng-odp
Stuart Haslam Jan. 19, 2016, 6:19 p.m. UTC | #4
On Tue, Jan 19, 2016 at 04:35:21PM +0300, Maxim Uvarov wrote:
> Stuart, please find my run bellow. On my machine warm up did not help:
> 
> 5773 pps, 5773 max pps,  0 rx drops, 0 tx drops
> 1746 pps, 5773 max pps,  0 rx drops, 0 tx drops
> 1127 pps, 5773 max pps,  0 rx drops, 0 tx drops
> 832 pps, 5773 max pps,  0 rx drops, 0 tx drops
> 2579 pps, 5773 max pps,  0 rx drops, 0 tx drops
> 424 pps, 5773 max pps,  0 rx drops, 0 tx drops
> 1001 pps, 5773 max pps,  0 rx drops, 0 tx drops
> 1652 pps, 5773 max pps,  0 rx drops, 0 tx drops
> 1367 pps, 5773 max pps,  0 rx drops, 0 tx drops
> 1744 pps, 5773 max pps,  0 rx drops, 0 tx drops
> 810 pps, 5773 max pps,  0 rx drops, 0 tx drops
> 2113 pps, 5773 max pps,  0 rx drops, 0 tx drops
> 2910 pps, 5773 max pps,  0 rx drops, 0 tx drops
> 2648 pps, 5773 max pps,  0 rx drops, 0 tx drops
> 1421 pps, 5773 max pps,  0 rx drops, 0 tx drops
> 2548 pps, 5773 max pps,  0 rx drops, 0 tx drops
> 4021 pps, 5773 max pps,  0 rx drops, 0 tx drops
> 2112 pps, 5773 max pps,  0 rx drops, 0 tx drops
> 2085 pps, 5773 max pps,  0 rx drops, 0 tx drops
> 1103 pps, 5773 max pps,  0 rx drops, 0 tx drops
> 474 pps, 5773 max pps,  0 rx drops, 0 tx drops
> 1724 pps, 5773 max pps,  0 rx drops, 0 tx drops
> 1560 pps, 5773 max pps,  0 rx drops, 0 tx drops
> 2552 pps, 5773 max pps,  0 rx drops, 0 tx drops
> 5233 pps, 5773 max pps,  0 rx drops, 0 tx drops
> 741 pps, 5773 max pps,  0 rx drops, 0 tx drops
> 829 pps, 5773 max pps,  0 rx drops, 0 tx drops
> 685 pps, 5773 max pps,  0 rx drops, 0 tx drops
> 1809 pps, 5773 max pps,  0 rx drops, 0 tx drops
> 698 pps, 5773 max pps,  0 rx drops, 0 tx drops
> TEST RESULT: 5773 maximum packets per second.
> 


Hrm, aren't those results from l2fwd? this patch is a change to
odp_pktio_perf.

The change isn't really intended to improve performance, just to make
results more consistent. You're not likely to notice any difference on
machine with non-isolated cores as runs won't be consistent anyway.

--
Stuart.

> 
> On 01/15/2016 18:21, Stuart Haslam wrote:
> >ping^2
> >
> >On 11 December 2015 at 16:54, Stuart Haslam <stuart.haslam@linaro.org> wrote:
> >>ping - needs review.
> >>
> >>On 28 October 2015 at 18:45, Stuart Haslam <stuart.haslam@linaro.org> wrote:
> >>>The results from the initial test run are often worse than would
> >>>normally be expected due to there being no warm up phase. As a
> >>>simple way to warm up run first test stage twice, ignoring the
> >>>results of the first run.
> >>>
> >>>Signed-off-by: Stuart Haslam <stuart.haslam@linaro.org>
> >>>---
> >>>  test/performance/odp_pktio_perf.c | 12 ++++++++++--
> >>>  1 file changed, 10 insertions(+), 2 deletions(-)
> >>>
> >>>diff --git a/test/performance/odp_pktio_perf.c b/test/performance/odp_pktio_perf.c
> >>>index efd26dc..38d684a 100644
> >>>--- a/test/performance/odp_pktio_perf.c
> >>>+++ b/test/performance/odp_pktio_perf.c
> >>>@@ -134,6 +134,7 @@ typedef struct {
> >>>         uint64_t pps_curr; /* Current attempted PPS */
> >>>         uint64_t pps_pass; /* Highest passing PPS */
> >>>         uint64_t pps_fail; /* Lowest failing PPS */
> >>>+       int      warmup;   /* Warmup stage - ignore results */
> >>>  } test_status_t;
> >>>
> >>>  /* Thread specific arguments */
> >>>@@ -647,7 +648,10 @@ static int run_test_single(odp_cpumask_t *thd_mask_tx,
> >>>         /* wait for receivers */
> >>>         odph_linux_pthread_join(&thd_tbl[0], num_rx_workers);
> >>>
> >>>-       return process_results(expected_tx_cnt, status);
> >>>+       if (!status->warmup)
> >>>+               return process_results(expected_tx_cnt, status);
> >>>+
> >>>+       return 1;
> >>>  }
> >>>
> >>>  static int run_test(void)
> >>>@@ -659,6 +663,7 @@ static int run_test(void)
> >>>                 .pps_curr = gbl_args->args.pps,
> >>>                 .pps_pass = 0,
> >>>                 .pps_fail = 0,
> >>>+               .warmup = 1,
> >>>         };
> >>>
> >>>         if (setup_txrx_masks(&txmask, &rxmask) != 0)
> >>>@@ -679,6 +684,10 @@ static int run_test(void)
> >>>                 printf("%s ", gbl_args->args.ifaces[i]);
> >>>         printf("\n");
> >>>
> >>>+       /* first time just run the test but throw away the results */
> >>>+       run_test_single(&txmask, &rxmask, &status);
> >>>+       status.warmup = 0;
> >>>+
> >>>         while (ret > 0)
> >>>                 ret = run_test_single(&txmask, &rxmask, &status);
> >>>
> >>>@@ -957,7 +966,6 @@ static void parse_args(int argc, char *argv[], test_args_t *args)
> >>>                                 LOG_ABORT("Failed to alloc iface storage\n");
> >>>
> >>>                         strcpy(args->if_str, optarg);
> >>>-
> >>>                         for (token = strtok(args->if_str, ",");
> >>>                              token != NULL && args->num_ifaces < MAX_NUM_IFACES;
> >>>                              token = strtok(NULL, ","))
> >>>--
> >>>2.1.1
> >>>
Maxim Uvarov Jan. 20, 2016, 8:10 a.m. UTC | #5
Merged.

I did test on meeting time and looks like cpu load was high.  At least now
I see speed up improvements.

Maxim.

On 01/19/2016 21:19, Stuart Haslam wrote:
> On Tue, Jan 19, 2016 at 04:35:21PM +0300, Maxim Uvarov wrote:
>> Stuart, please find my run bellow. On my machine warm up did not help:
>>
>> 5773 pps, 5773 max pps,  0 rx drops, 0 tx drops
>> 1746 pps, 5773 max pps,  0 rx drops, 0 tx drops
>> 1127 pps, 5773 max pps,  0 rx drops, 0 tx drops
>> 832 pps, 5773 max pps,  0 rx drops, 0 tx drops
>> 2579 pps, 5773 max pps,  0 rx drops, 0 tx drops
>> 424 pps, 5773 max pps,  0 rx drops, 0 tx drops
>> 1001 pps, 5773 max pps,  0 rx drops, 0 tx drops
>> 1652 pps, 5773 max pps,  0 rx drops, 0 tx drops
>> 1367 pps, 5773 max pps,  0 rx drops, 0 tx drops
>> 1744 pps, 5773 max pps,  0 rx drops, 0 tx drops
>> 810 pps, 5773 max pps,  0 rx drops, 0 tx drops
>> 2113 pps, 5773 max pps,  0 rx drops, 0 tx drops
>> 2910 pps, 5773 max pps,  0 rx drops, 0 tx drops
>> 2648 pps, 5773 max pps,  0 rx drops, 0 tx drops
>> 1421 pps, 5773 max pps,  0 rx drops, 0 tx drops
>> 2548 pps, 5773 max pps,  0 rx drops, 0 tx drops
>> 4021 pps, 5773 max pps,  0 rx drops, 0 tx drops
>> 2112 pps, 5773 max pps,  0 rx drops, 0 tx drops
>> 2085 pps, 5773 max pps,  0 rx drops, 0 tx drops
>> 1103 pps, 5773 max pps,  0 rx drops, 0 tx drops
>> 474 pps, 5773 max pps,  0 rx drops, 0 tx drops
>> 1724 pps, 5773 max pps,  0 rx drops, 0 tx drops
>> 1560 pps, 5773 max pps,  0 rx drops, 0 tx drops
>> 2552 pps, 5773 max pps,  0 rx drops, 0 tx drops
>> 5233 pps, 5773 max pps,  0 rx drops, 0 tx drops
>> 741 pps, 5773 max pps,  0 rx drops, 0 tx drops
>> 829 pps, 5773 max pps,  0 rx drops, 0 tx drops
>> 685 pps, 5773 max pps,  0 rx drops, 0 tx drops
>> 1809 pps, 5773 max pps,  0 rx drops, 0 tx drops
>> 698 pps, 5773 max pps,  0 rx drops, 0 tx drops
>> TEST RESULT: 5773 maximum packets per second.
>>
>
> Hrm, aren't those results from l2fwd? this patch is a change to
> odp_pktio_perf.
>
> The change isn't really intended to improve performance, just to make
> results more consistent. You're not likely to notice any difference on
> machine with non-isolated cores as runs won't be consistent anyway.
>
> --
> Stuart.
>
>> On 01/15/2016 18:21, Stuart Haslam wrote:
>>> ping^2
>>>
>>> On 11 December 2015 at 16:54, Stuart Haslam <stuart.haslam@linaro.org> wrote:
>>>> ping - needs review.
>>>>
>>>> On 28 October 2015 at 18:45, Stuart Haslam <stuart.haslam@linaro.org> wrote:
>>>>> The results from the initial test run are often worse than would
>>>>> normally be expected due to there being no warm up phase. As a
>>>>> simple way to warm up run first test stage twice, ignoring the
>>>>> results of the first run.
>>>>>
>>>>> Signed-off-by: Stuart Haslam <stuart.haslam@linaro.org>
>>>>> ---
>>>>>   test/performance/odp_pktio_perf.c | 12 ++++++++++--
>>>>>   1 file changed, 10 insertions(+), 2 deletions(-)
>>>>>
>>>>> diff --git a/test/performance/odp_pktio_perf.c b/test/performance/odp_pktio_perf.c
>>>>> index efd26dc..38d684a 100644
>>>>> --- a/test/performance/odp_pktio_perf.c
>>>>> +++ b/test/performance/odp_pktio_perf.c
>>>>> @@ -134,6 +134,7 @@ typedef struct {
>>>>>          uint64_t pps_curr; /* Current attempted PPS */
>>>>>          uint64_t pps_pass; /* Highest passing PPS */
>>>>>          uint64_t pps_fail; /* Lowest failing PPS */
>>>>> +       int      warmup;   /* Warmup stage - ignore results */
>>>>>   } test_status_t;
>>>>>
>>>>>   /* Thread specific arguments */
>>>>> @@ -647,7 +648,10 @@ static int run_test_single(odp_cpumask_t *thd_mask_tx,
>>>>>          /* wait for receivers */
>>>>>          odph_linux_pthread_join(&thd_tbl[0], num_rx_workers);
>>>>>
>>>>> -       return process_results(expected_tx_cnt, status);
>>>>> +       if (!status->warmup)
>>>>> +               return process_results(expected_tx_cnt, status);
>>>>> +
>>>>> +       return 1;
>>>>>   }
>>>>>
>>>>>   static int run_test(void)
>>>>> @@ -659,6 +663,7 @@ static int run_test(void)
>>>>>                  .pps_curr = gbl_args->args.pps,
>>>>>                  .pps_pass = 0,
>>>>>                  .pps_fail = 0,
>>>>> +               .warmup = 1,
>>>>>          };
>>>>>
>>>>>          if (setup_txrx_masks(&txmask, &rxmask) != 0)
>>>>> @@ -679,6 +684,10 @@ static int run_test(void)
>>>>>                  printf("%s ", gbl_args->args.ifaces[i]);
>>>>>          printf("\n");
>>>>>
>>>>> +       /* first time just run the test but throw away the results */
>>>>> +       run_test_single(&txmask, &rxmask, &status);
>>>>> +       status.warmup = 0;
>>>>> +
>>>>>          while (ret > 0)
>>>>>                  ret = run_test_single(&txmask, &rxmask, &status);
>>>>>
>>>>> @@ -957,7 +966,6 @@ static void parse_args(int argc, char *argv[], test_args_t *args)
>>>>>                                  LOG_ABORT("Failed to alloc iface storage\n");
>>>>>
>>>>>                          strcpy(args->if_str, optarg);
>>>>> -
>>>>>                          for (token = strtok(args->if_str, ",");
>>>>>                               token != NULL && args->num_ifaces < MAX_NUM_IFACES;
>>>>>                               token = strtok(NULL, ","))
>>>>> --
>>>>> 2.1.1
>>>>>
diff mbox

Patch

diff --git a/test/performance/odp_pktio_perf.c b/test/performance/odp_pktio_perf.c
index efd26dc..38d684a 100644
--- a/test/performance/odp_pktio_perf.c
+++ b/test/performance/odp_pktio_perf.c
@@ -134,6 +134,7 @@  typedef struct {
 	uint64_t pps_curr; /* Current attempted PPS */
 	uint64_t pps_pass; /* Highest passing PPS */
 	uint64_t pps_fail; /* Lowest failing PPS */
+	int      warmup;   /* Warmup stage - ignore results */
 } test_status_t;
 
 /* Thread specific arguments */
@@ -647,7 +648,10 @@  static int run_test_single(odp_cpumask_t *thd_mask_tx,
 	/* wait for receivers */
 	odph_linux_pthread_join(&thd_tbl[0], num_rx_workers);
 
-	return process_results(expected_tx_cnt, status);
+	if (!status->warmup)
+		return process_results(expected_tx_cnt, status);
+
+	return 1;
 }
 
 static int run_test(void)
@@ -659,6 +663,7 @@  static int run_test(void)
 		.pps_curr = gbl_args->args.pps,
 		.pps_pass = 0,
 		.pps_fail = 0,
+		.warmup = 1,
 	};
 
 	if (setup_txrx_masks(&txmask, &rxmask) != 0)
@@ -679,6 +684,10 @@  static int run_test(void)
 		printf("%s ", gbl_args->args.ifaces[i]);
 	printf("\n");
 
+	/* first time just run the test but throw away the results */
+	run_test_single(&txmask, &rxmask, &status);
+	status.warmup = 0;
+
 	while (ret > 0)
 		ret = run_test_single(&txmask, &rxmask, &status);
 
@@ -957,7 +966,6 @@  static void parse_args(int argc, char *argv[], test_args_t *args)
 				LOG_ABORT("Failed to alloc iface storage\n");
 
 			strcpy(args->if_str, optarg);
-
 			for (token = strtok(args->if_str, ",");
 			     token != NULL && args->num_ifaces < MAX_NUM_IFACES;
 			     token = strtok(NULL, ","))