aboutsummaryrefslogtreecommitdiffstats
path: root/tests/perf/Short_IPv4_Fib_2M_Intel-X520-DA2.robot
diff options
context:
space:
mode:
authorpmikus <pmikus@cisco.com>2016-10-25 10:26:47 +0200
committerPeter Mikus <pmikus@cisco.com>2016-11-04 13:43:06 +0000
commit8184e3073bc98a85709380f55fd18f0c01ac9cf3 (patch)
treed57d88ca912caec2e249e0160b4ed75687362631 /tests/perf/Short_IPv4_Fib_2M_Intel-X520-DA2.robot
parentcbdce89c2134a8a0ecbba785b8f5ca09ac942a0c (diff)
CSIT-458 Use node aware config in all perf TCs
- Use node aware config in all perf TCs Change-Id: Icbf92bf232efef49d07c1324c64ae55125e90fb2 Signed-off-by: pmikus <pmikus@cisco.com>
Diffstat (limited to 'tests/perf/Short_IPv4_Fib_2M_Intel-X520-DA2.robot')
-rw-r--r--tests/perf/Short_IPv4_Fib_2M_Intel-X520-DA2.robot18
1 files changed, 9 insertions, 9 deletions
diff --git a/tests/perf/Short_IPv4_Fib_2M_Intel-X520-DA2.robot b/tests/perf/Short_IPv4_Fib_2M_Intel-X520-DA2.robot
index aaf94d5946..fc371731dd 100644
--- a/tests/perf/Short_IPv4_Fib_2M_Intel-X520-DA2.robot
+++ b/tests/perf/Short_IPv4_Fib_2M_Intel-X520-DA2.robot
@@ -53,7 +53,7 @@
| | ${framesize}= | Set Variable | 64
| | ${duration}= | Set Variable | 10
| | ${rate}= | Set Variable | 3.5mpps
-| | Given Add '1' worker threads and rxqueues '1' without HTT to all DUTs
+| | Given Add '1' worker threads and rxqueues '1' in 3-node single-link topo
| | And Add PCI devices to DUTs from 3-node single link topology
| | And Add No Multi Seg to all DUTs
| | And Add Heapsize Config to all DUTs | 3G
@@ -73,7 +73,7 @@
| | ${framesize}= | Set Variable | 1518
| | ${duration}= | Set Variable | 10
| | ${rate}= | Set Variable | 812743pps
-| | Given Add '1' worker threads and rxqueues '1' without HTT to all DUTs
+| | Given Add '1' worker threads and rxqueues '1' in 3-node single-link topo
| | And Add PCI devices to DUTs from 3-node single link topology
| | And Add No Multi Seg to all DUTs
| | And Add Heapsize Config to all DUTs | 3G
@@ -93,7 +93,7 @@
| | ${framesize}= | Set Variable | 9000
| | ${duration}= | Set Variable | 10
| | ${rate}= | Set Variable | 138580pps
-| | Given Add '1' worker threads and rxqueues '1' without HTT to all DUTs
+| | Given Add '1' worker threads and rxqueues '1' in 3-node single-link topo
| | And Add PCI devices to DUTs from 3-node single link topology
| | And Add Heapsize Config to all DUTs | 3G
| | And Apply startup configuration on all VPP DUTs
@@ -112,7 +112,7 @@
| | ${framesize}= | Set Variable | 64
| | ${duration}= | Set Variable | 10
| | ${rate}= | Set Variable | 7.5mpps
-| | Given Add '2' worker threads and rxqueues '1' without HTT to all DUTs
+| | Given Add '2' worker threads and rxqueues '1' in 3-node single-link topo
| | And Add PCI devices to DUTs from 3-node single link topology
| | And Add No Multi Seg to all DUTs
| | And Add Heapsize Config to all DUTs | 3G
@@ -132,7 +132,7 @@
| | ${framesize}= | Set Variable | 1518
| | ${duration}= | Set Variable | 10
| | ${rate}= | Set Variable | 812743pps
-| | Given Add '2' worker threads and rxqueues '1' without HTT to all DUTs
+| | Given Add '2' worker threads and rxqueues '1' in 3-node single-link topo
| | And Add PCI devices to DUTs from 3-node single link topology
| | And Add No Multi Seg to all DUTs
| | And Add Heapsize Config to all DUTs | 3G
@@ -152,7 +152,7 @@
| | ${framesize}= | Set Variable | 9000
| | ${duration}= | Set Variable | 10
| | ${rate}= | Set Variable | 138580pps
-| | Given Add '2' worker threads and rxqueues '1' without HTT to all DUTs
+| | Given Add '2' worker threads and rxqueues '1' in 3-node single-link topo
| | And Add PCI devices to DUTs from 3-node single link topology
| | And Add Heapsize Config to all DUTs | 3G
| | And Apply startup configuration on all VPP DUTs
@@ -171,7 +171,7 @@
| | ${framesize}= | Set Variable | 64
| | ${duration}= | Set Variable | 10
| | ${rate}= | Set Variable | 10.0mpps
-| | Given Add '4' worker threads and rxqueues '2' without HTT to all DUTs
+| | Given Add '4' worker threads and rxqueues '2' in 3-node single-link topo
| | And Add PCI devices to DUTs from 3-node single link topology
| | And Add No Multi Seg to all DUTs
| | And Add Heapsize Config to all DUTs | 3G
@@ -191,7 +191,7 @@
| | ${framesize}= | Set Variable | 1518
| | ${duration}= | Set Variable | 10
| | ${rate}= | Set Variable | 812743pps
-| | Given Add '4' worker threads and rxqueues '2' without HTT to all DUTs
+| | Given Add '4' worker threads and rxqueues '2' in 3-node single-link topo
| | And Add PCI devices to DUTs from 3-node single link topology
| | And Add No Multi Seg to all DUTs
| | And Add Heapsize Config to all DUTs | 3G
@@ -211,7 +211,7 @@
| | ${framesize}= | Set Variable | 9000
| | ${duration}= | Set Variable | 10
| | ${rate}= | Set Variable | 138580pps
-| | Given Add '4' worker threads and rxqueues '2' without HTT to all DUTs
+| | Given Add '4' worker threads and rxqueues '2' in 3-node single-link topo
| | And Add PCI devices to DUTs from 3-node single link topology
| | And Add Heapsize Config to all DUTs | 3G
| | And Apply startup configuration on all VPP DUTs
8 } /* Comment.Hashbang */ .highlight .cm { color: #888888 } /* Comment.Multiline */ .highlight .cp { color: #cc0000; font-weight: bold } /* Comment.Preproc */ .highlight .cpf { color: #888888 } /* Comment.PreprocFile */ .highlight .c1 { color: #888888 } /* Comment.Single */ .highlight .cs { color: #cc0000; font-weight: bold; background-color: #fff0f0 } /* Comment.Special */ .highlight .gd { color: #000000; background-color: #ffdddd } /* Generic.Deleted */ .highlight .ge { font-style: italic } /* Generic.Emph */ .highlight .gr { color: #aa0000 } /* Generic.Error */ .highlight .gh { color: #333333 } /* Generic.Heading */ .highlight .gi { color: #000000; background-color: #ddffdd } /* Generic.Inserted */ .highlight .go { color: #888888 } /* Generic.Output */ .highlight .gp { color: #555555 } /* Generic.Prompt */ .highlight .gs { font-weight: bold } /* Generic.Strong */ .highlight .gu { color: #666666 } /* Generic.Subheading */ .highlight .gt { color: #aa0000 } /* Generic.Traceback */ .highlight .kc { color: #008800; font-weight: bold } /* Keyword.Constant */ .highlight .kd { color: #008800; font-weight: bold } /* Keyword.Declaration */ .highlight .kn { color: #008800; font-weight: bold } /* Keyword.Namespace */ .highlight .kp { color: #008800 } /* Keyword.Pseudo */ .highlight .kr { color: #008800; font-weight: bold } /* Keyword.Reserved */ .highlight .kt { color: #888888; font-weight: bold } /* Keyword.Type */ .highlight .m { color: #0000DD; font-weight: bold } /* Literal.Number */ .highlight .s { color: #dd2200; background-color: #fff0f0 } /* Literal.String */ .highlight .na { color: #336699 } /* Name.Attribute */ .highlight .nb { color: #003388 } /* Name.Builtin */ .highlight .nc { color: #bb0066; font-weight: bold } /* Name.Class */ .highlight .no { color: #003366; font-weight: bold } /* Name.Constant */ .highlight .nd { color: #555555 } /* Name.Decorator */ .highlight .ne { color: #bb0066; font-weight: bold } /* Name.Exception */ .highlight .nf { color: #0066bb; font-weight: bold } /* Name.Function */ .highlight .nl { color: #336699; font-style: italic } /* Name.Label */ .highlight .nn { color: #bb0066; font-weight: bold } /* Name.Namespace */ .highlight .py { color: #336699; font-weight: bold } /* Name.Property */ .highlight .nt { color: #bb0066; font-weight: bold } /* Name.Tag */ .highlight .nv { color: #336699 } /* Name.Variable */ .highlight .ow { color: #008800 } /* Operator.Word */ .highlight .w { color: #bbbbbb } /* Text.Whitespace */ .highlight .mb { color: #0000DD; font-weight: bold } /* Literal.Number.Bin */ .highlight .mf { color: #0000DD; font-weight: bold } /* Literal.Number.Float */ .highlight .mh { color: #0000DD; font-weight: bold } /* Literal.Number.Hex */ .highlight .mi { color: #0000DD; font-weight: bold } /* Literal.Number.Integer */ .highlight .mo { color: #0000DD; font-weight: bold } /* Literal.Number.Oct */ .highlight .sa { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Affix */ .highlight .sb { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Backtick */ .highlight .sc { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Char */ .highlight .dl { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Delimiter */ .highlight .sd { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Doc */ .highlight .s2 { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Double */ .highlight .se { color: #0044dd; background-color: #fff0f0 } /* Literal.String.Escape */ .highlight .sh { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Heredoc */ .highlight .si { color: #3333bb; background-color: #fff0f0 } /* Literal.String.Interpol */ .highlight .sx { color: #22bb22; background-color: #f0fff0 } /* Literal.String.Other */ .highlight .sr { color: #008800; background-color: #fff0ff } /* Literal.String.Regex */ .highlight .s1 { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Single */ .highlight .ss { color: #aa6600; background-color: #fff0f0 } /* Literal.String.Symbol */ .highlight .bp { color: #003388 } /* Name.Builtin.Pseudo */ .highlight .fm { color: #0066bb; font-weight: bold } /* Name.Function.Magic */ .highlight .vc { color: #336699 } /* Name.Variable.Class */ .highlight .vg { color: #dd7700 } /* Name.Variable.Global */ .highlight .vi { color: #3333bb } /* Name.Variable.Instance */ .highlight .vm { color: #336699 } /* Name.Variable.Magic */ .highlight .il { color: #0000DD; font-weight: bold } /* Literal.Number.Integer.Long */ }
/*
 * Copyright (c) 2015 Cisco and/or its affiliates.
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at:
 *
 *     http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */
#include <vppinfra/bitmap.h>
#include <vppinfra/error.h>
#include <vppinfra/format.h>
#include <vppinfra/pool.h>
#include <vppinfra/random.h>
#include <vppinfra/time.h>
#include <vppinfra/timing_wheel.h>
#include <vppinfra/zvec.h>

#include <vppinfra/math.h>

#if __GNUC__ < 4
#define SQRT(a) a
#else
#define SQRT(a) sqrt(a)
#endif

typedef struct
{
  uword n_iter;

  u32 n_events;
  u32 seed;
  u32 verbose;

  /* Time is "synthetic" e.g. not taken from CPU timer. */
  u32 synthetic_time;

  clib_time_t time;
  timing_wheel_t timing_wheel;

  u64 *events;

  f64 max_time;
  f64 wait_time;

  f64 total_iterate_time;
  f64 time_iterate_start;

  f64 time_per_status_update;
  f64 time_next_status_update;
} test_timing_wheel_main_t;

typedef struct
{
  f64 dt;
  f64 fraction;
  u64 count;
} test_timing_wheel_tmp_t;

static void
set_event (test_timing_wheel_main_t * tm, uword i)
{
  timing_wheel_t *w = &tm->timing_wheel;
  u64 cpu_time;

  cpu_time = w->current_time_index << w->log2_clocks_per_bin;
  if (tm->synthetic_time)
    cpu_time += random_u32 (&tm->seed) % tm->n_iter;
  else
    cpu_time +=
      random_f64 (&tm->seed) * tm->max_time * tm->time.clocks_per_second;

  timing_wheel_insert (w, cpu_time, i);
  timing_wheel_validate (w);
  tm->events[i] = cpu_time;
}

static int
test_timing_wheel_tmp_cmp (void *a1, void *a2)
{
  test_timing_wheel_tmp_t *f1 = a1;
  test_timing_wheel_tmp_t *f2 = a2;

  return f1->dt < f2->dt ? -1 : (f1->dt > f2->dt ? +1 : 0);
}

clib_error_t *
test_timing_wheel_main (unformat_input_t * input)
{
  clib_error_t *error = 0;
  test_timing_wheel_main_t _tm, *tm = &_tm;
  timing_wheel_t *w = &tm->timing_wheel;
  uword iter, i;

  clib_memset (tm, 0, sizeof (tm[0]));
  tm->n_iter = 10;
  tm->time_per_status_update = 0;
  tm->n_events = 100;
  tm->seed = 1;
  tm->synthetic_time = 1;
  tm->max_time = 1;
  tm->wait_time = 1e-3;

  w->validate = 0;
  w->n_wheel_elt_time_bits = 32;

  while (unformat_check_input (input) != UNFORMAT_END_OF_INPUT)
    {
      if (unformat (input, "iter %wd", &tm->n_iter))
	;
      else if (unformat (input, "events %d", &tm->n_events))
	;
      else
	if (unformat (input, "elt-time-bits %d", &w->n_wheel_elt_time_bits))
	;
      else if (unformat (input, "seed %d", &tm->seed))
	;
      else if (unformat (input, "verbose"))
	tm->verbose = 1;
      else if (unformat (input, "validate"))
	w->validate = 1;

      else if (unformat (input, "real-time"))
	tm->synthetic_time = 0;
      else if (unformat (input, "synthetic-time"))
	tm->synthetic_time = 1;
      else if (unformat (input, "max-time %f", &tm->max_time))
	;
      else if (unformat (input, "wait-time %f", &tm->wait_time))
	;
      else if (unformat (input, "iter-time %f", &tm->total_iterate_time))
	;
      else if (unformat (input, "print %f", &tm->time_per_status_update))
	;

      else
	{
	  error = clib_error_create ("unknown input `%U'\n",
				     format_unformat_error, input);
	  goto done;
	}
    }

  if (!tm->seed)
    tm->seed = random_default_seed ();

  clib_time_init (&tm->time);

  if (tm->synthetic_time)
    {
      w->min_sched_time = tm->time.seconds_per_clock;
      w->max_sched_time = w->min_sched_time * 256;
      timing_wheel_init (w, 0, tm->time.clocks_per_second);
    }
  else
    {
      timing_wheel_init (w, clib_cpu_time_now (), tm->time.clocks_per_second);
    }

  clib_warning ("iter %wd, events %d, seed %u, %U",
		tm->n_iter, tm->n_events, tm->seed,
		format_timing_wheel, &tm->timing_wheel, /* verbose */ 0);

  /* Make some events. */
  vec_resize (tm->events, tm->n_events);
  for (i = 0; i < vec_len (tm->events); i++)
    set_event (tm, i);

  {
    u32 *expired = 0;
    f64 ave_error = 0;
    f64 rms_error = 0;
    f64 max_error = 0, min_error = 1e30;
    u32 *error_hist = 0;
    uword n_expired = 0;
    uword *expired_bitmap[2] = { 0 };
    uword n_events_in_wheel = vec_len (tm->events);

    vec_resize (expired, 32);
    vec_resize (error_hist, 1024);

    tm->time_iterate_start = clib_time_now (&tm->time);
    tm->time_next_status_update =
      tm->time_iterate_start + tm->time_per_status_update;

    if (tm->total_iterate_time != 0)
      tm->n_iter = ~0;

    for (iter = 0; iter < tm->n_iter || n_events_in_wheel > 0; iter++)
      {
	u64 cpu_time, min_next_time[2];

	if (tm->synthetic_time)
	  cpu_time = iter << w->log2_clocks_per_bin;
	else
	  cpu_time = clib_cpu_time_now ();

	_vec_len (expired) = 0;
	expired =
	  timing_wheel_advance (w, cpu_time, expired, &min_next_time[0]);
	timing_wheel_validate (w);

	/* Update bitmap of expired events. */
	if (w->validate)
	  {
	    for (i = 0; i < vec_len (tm->events); i++)
	      {
		uword is_expired;

		is_expired =
		  (cpu_time >> w->log2_clocks_per_bin) >=
		  (tm->events[i] >> w->log2_clocks_per_bin);
		expired_bitmap[0] =
		  clib_bitmap_set (expired_bitmap[0], i, is_expired);

		/* Validate min next time. */
		if (is_expired)
		  ASSERT (min_next_time[0] > tm->events[i]);
		else
		  ASSERT (min_next_time[0] <= tm->events[i]);
	      }
	  }

	n_expired += vec_len (expired);
	for (i = 0; i < vec_len (expired); i++)
	  {
	    word j, idt;
	    i64 dt_cpu;
	    f64 fdt_cpu;

	    j = expired[i];
	    expired_bitmap[1] = clib_bitmap_ori (expired_bitmap[1], j);

	    dt_cpu = cpu_time - tm->events[j];

	    /* Event must be scheduled in correct bin. */
	    if (tm->synthetic_time)
	      ASSERT (dt_cpu >= 0 && dt_cpu <= (1 << w->log2_clocks_per_bin));

	    fdt_cpu = dt_cpu * tm->time.seconds_per_clock;

	    ave_error += fdt_cpu;
	    rms_error += fdt_cpu * fdt_cpu;

	    if (fdt_cpu > max_error)
	      max_error = fdt_cpu;
	    if (fdt_cpu < min_error)
	      min_error = fdt_cpu;

	    idt =
	      (cpu_time >> w->log2_clocks_per_bin) -
	      (tm->events[j] >> w->log2_clocks_per_bin);
	    idt = zvec_signed_to_unsigned (idt);
	    vec_validate (error_hist, idt);
	    error_hist[idt] += 1;
	  }

	if (w->validate)
	  for (i = 0; i < vec_len (tm->events); i++)
	    {
	      int is_expired = clib_bitmap_get (expired_bitmap[0], i);
	      int is_expired_w = clib_bitmap_get (expired_bitmap[1], i);
	      ASSERT (is_expired == is_expired_w);
	    }

	min_next_time[1] = ~0;
	for (i = 0; i < vec_len (tm->events); i++)
	  {
	    if (!clib_bitmap_get (expired_bitmap[1], i))
	      min_next_time[1] = clib_min (min_next_time[1], tm->events[i]);
	  }
	if (min_next_time[0] != min_next_time[1])
	  clib_error ("min next time wrong 0x%Lx != 0x%Lx", min_next_time[0],
		      min_next_time[1]);

	if (tm->time_per_status_update != 0
	    && clib_time_now (&tm->time) >= tm->time_next_status_update)
	  {
	    f64 ave = 0, rms = 0;

	    tm->time_next_status_update += tm->time_per_status_update;
	    if (n_expired > 0)
	      {
		ave = ave_error / n_expired;
		rms = SQRT (rms_error / n_expired - ave * ave);
	      }

	    clib_warning
	      ("%12wd iter done %10wd expired; ave. error %.4e +- %.4e, range %.4e %.4e",
	       iter, n_expired, ave, rms, min_error, max_error);
	  }

	if (tm->total_iterate_time != 0
	    && (clib_time_now (&tm->time) - tm->time_iterate_start
		>= tm->total_iterate_time))
	  tm->n_iter = iter;

	/* Add new events to wheel to replace expired ones. */
	n_events_in_wheel -= vec_len (expired);
	if (iter < tm->n_iter)
	  {
	    for (i = 0; i < vec_len (expired); i++)
	      {
		uword j = expired[i];
		set_event (tm, j);
		expired_bitmap[1] =
		  clib_bitmap_andnoti (expired_bitmap[1], j);
	      }
	    n_events_in_wheel += vec_len (expired);
	  }
      }

    ave_error /= n_expired;
    rms_error = SQRT (rms_error / n_expired - ave_error * ave_error);

    clib_warning
      ("%wd iter done %wd expired; ave. error %.4e +- %.4e, range %.4e %.4e",
       1 + iter, n_expired, ave_error, rms_error, min_error, max_error);

    {
      test_timing_wheel_tmp_t *fs, *f;
      f64 total_fraction;

      fs = 0;
      for (i = 0; i < vec_len (error_hist); i++)
	{
	  if (error_hist[i] == 0)
	    continue;
	  vec_add2 (fs, f, 1);
	  f->dt =
	    (((i64) zvec_unsigned_to_signed (i) << w->log2_clocks_per_bin) *
	     tm->time.seconds_per_clock);
	  f->fraction = (f64) error_hist[i] / (f64) n_expired;
	  f->count = error_hist[i];
	}

      vec_sort_with_function (fs, test_timing_wheel_tmp_cmp);

      total_fraction = 0;
      vec_foreach (f, fs)
      {
	total_fraction += f->fraction;
	if (f == fs)
	  fformat (stdout, "%=12s %=16s %=16s %s\n", "Error max", "Fraction",
		   "Total", "Count");
	fformat (stdout, "%12.4e %16.4f%% %16.4f%% %Ld\n", f->dt,
		 f->fraction * 100, total_fraction * 100, f->count);
      }
    }

    clib_warning ("%U", format_timing_wheel, w, /* verbose */ 1);
  }

done:
  return error;
}

#ifdef CLIB_UNIX
int
main (int argc, char *argv[])
{
  unformat_input_t i;
  clib_error_t *error;

  clib_mem_init (0, 64ULL << 20);

  unformat_init_command_line (&i, argv);
  error = test_timing_wheel_main (&i);
  unformat_free (&i);
  if (error)
    {
      clib_error_report (error);
      return 1;
    }
  else
    return 0;
}
#endif /* CLIB_UNIX */

/*
 * fd.io coding-style-patch-verification: ON
 *
 * Local Variables:
 * eval: (c-set-style "gnu")
 * End:
 */