diff --git a/src/vppinfra/CMakeLists.txt b/src/vppinfra/CMakeLists.txt
index 3e396e3..3128ad3 100644
--- a/src/vppinfra/CMakeLists.txt
+++ b/src/vppinfra/CMakeLists.txt
@@ -165,6 +165,7 @@
   time.h
   time_range.h
   timing_wheel.h
+  tw_timer_2t_2w_512sl.c
   tw_timer_16t_1w_2048sl.h
   tw_timer_16t_2w_512sl.h
   tw_timer_1t_3w_1024sl_ov.h
diff --git a/src/vppinfra/test_tw_timer.c b/src/vppinfra/test_tw_timer.c
index 90fbc9e..499cc01 100644
--- a/src/vppinfra/test_tw_timer.c
+++ b/src/vppinfra/test_tw_timer.c
@@ -2,6 +2,7 @@
 #include <vppinfra/cache.h>
 #include <vppinfra/error.h>
 #include <vppinfra/tw_timer_2t_1w_2048sl.h>
+#include <vppinfra/tw_timer_2t_2w_512sl.h>
 #include <vppinfra/tw_timer_16t_2w_512sl.h>
 #include <vppinfra/tw_timer_4t_3w_256sl.h>
 #include <vppinfra/tw_timer_1t_3w_1024sl_ov.h>
@@ -32,6 +33,9 @@
   /* The triple wheel with overflow vector */
   tw_timer_wheel_1t_3w_1024sl_ov_t triple_ov_wheel;
 
+  /* Another two timer wheel geometry */
+  tw_timer_wheel_2t_2w_512sl_t two_timer_double_wheel;
+
   /** random number seed */
   u64 seed;
 
@@ -77,6 +81,19 @@
 }
 
 static void
+run_two_timer_double_wheel (tw_timer_wheel_2t_2w_512sl_t * tw, u32 n_ticks)
+{
+  u32 i;
+  f64 now = tw->last_run_time + 1.01;
+
+  for (i = 0; i < n_ticks; i++)
+    {
+      tw_timer_expire_timers_2t_2w_512sl (tw, now);
+      now += 1.01;
+    }
+}
+
+static void
 run_triple_wheel (tw_timer_wheel_4t_3w_256sl_t * tw, u32 n_ticks)
 {
   u32 i;
@@ -157,6 +174,33 @@
 }
 
 static void
+expired_timer_two_timer_double_callback (u32 * expired_timers)
+{
+  int i;
+  u32 pool_index, timer_id;
+  tw_timer_test_elt_t *e;
+  tw_timer_test_main_t *tm = &tw_timer_test_main;
+
+  for (i = 0; i < vec_len (expired_timers); i++)
+    {
+      pool_index = expired_timers[i] & 0x7FFFFFFF;
+      timer_id = expired_timers[i] >> 31;
+
+      ASSERT (timer_id == 1);
+
+      e = pool_elt_at_index (tm->test_elts, pool_index);
+
+      if (e->expected_to_expire != tm->two_timer_double_wheel.current_tick)
+	{
+	  fformat (stdout, "[%d] expired at %lld not %lld\n",
+		   e - tm->test_elts, tm->two_timer_double_wheel.current_tick,
+		   e->expected_to_expire);
+	}
+      pool_put (tm->test_elts, e);
+    }
+}
+
+static void
 expired_timer_triple_callback (u32 * expired_timers)
 {
   int i;
@@ -913,7 +957,7 @@
       if (timer_arg == 0)
 	timer_arg = 1;
 
-      expected_to_expire = timer_arg + offset;
+      expected_to_expire = timer_arg + tm->single_wheel.current_tick;
 
       pool_get (tm->test_elts, e);
       clib_memset (e, 0, sizeof (*e));
@@ -975,7 +1019,7 @@
       pool_get (tm->test_elts, e);
       clib_memset (e, 0, sizeof (*e));
 
-      e->expected_to_expire = i + offset + 1;
+      e->expected_to_expire = i + tm->double_wheel.current_tick + 1;
       e->stop_timer_handle = tw_timer_start_16t_2w_512sl
 	(&tm->double_wheel, e - tm->test_elts, 14 /* timer id */ ,
 	 i + 1);
@@ -1006,6 +1050,64 @@
 }
 
 static clib_error_t *
+test1_two_timer_double (tw_timer_test_main_t * tm)
+{
+  u32 i;
+  tw_timer_test_elt_t *e;
+  u32 offset;
+
+  tw_timer_wheel_init_2t_2w_512sl (&tm->two_timer_double_wheel,
+				   expired_timer_two_timer_double_callback,
+				   1.0 /* timer interval */ , ~0);
+
+  /*
+   * Prime offset, to make sure that the wheel starts in a
+   * non-trivial position
+   */
+  offset = 2745;
+
+  run_two_timer_double_wheel (&tm->two_timer_double_wheel, offset);
+
+  fformat (stdout, "initial wheel time %d, fast index %d\n",
+	   tm->two_timer_double_wheel.current_tick,
+	   tm->two_timer_double_wheel.current_index[TW_TIMER_RING_FAST]);
+
+  for (i = 0; i < tm->ntimers; i++)
+    {
+      pool_get (tm->test_elts, e);
+      clib_memset (e, 0, sizeof (*e));
+
+      e->expected_to_expire = i + tm->two_timer_double_wheel.current_tick + 1;
+      e->stop_timer_handle = tw_timer_start_2t_2w_512sl
+	(&tm->two_timer_double_wheel, e - tm->test_elts, 1 /* timer id */ ,
+	 i + 1);
+    }
+  run_two_timer_double_wheel (&tm->two_timer_double_wheel, tm->ntimers + 3);
+
+  if (pool_elts (tm->test_elts))
+    fformat (stdout, "Note: %d elements remain in pool\n",
+	     pool_elts (tm->test_elts));
+
+  /* *INDENT-OFF* */
+  pool_foreach (e, tm->test_elts,
+  ({
+    fformat(stdout, "[%d] expected to expire %d\n",
+                     e - tm->test_elts,
+                     e->expected_to_expire);
+  }));
+  /* *INDENT-ON* */
+
+  fformat (stdout,
+	   "final wheel time %d, fast index %d\n",
+	   tm->two_timer_double_wheel.current_tick,
+	   tm->two_timer_double_wheel.current_index[TW_TIMER_RING_FAST]);
+
+  pool_free (tm->test_elts);
+  tw_timer_wheel_free_2t_2w_512sl (&tm->two_timer_double_wheel);
+  return 0;
+}
+
+static clib_error_t *
 test3_triple_double (tw_timer_test_main_t * tm)
 {
   tw_timer_test_elt_t *e;
@@ -1308,7 +1410,10 @@
       if (num_wheels == 1)
 	return test1_single (tm);
       else
-	return test1_double (tm);
+	{
+	  (void) test1_double (tm);
+	  return test1_two_timer_double (tm);
+	}
     }
   if (is_test2)
     {
diff --git a/src/vppinfra/tw_timer_2t_2w_512sl.c b/src/vppinfra/tw_timer_2t_2w_512sl.c
new file mode 100644
index 0000000..14a79c7
--- /dev/null
+++ b/src/vppinfra/tw_timer_2t_2w_512sl.c
@@ -0,0 +1,26 @@
+/*
+ * Copyright (c) 2020 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/error.h>
+#include "tw_timer_2t_2w_512sl.h"
+#include "tw_timer_template.c"
+
+/*
+ * fd.io coding-style-patch-verification: ON
+ *
+ * Local Variables:
+ * eval: (c-set-style "gnu")
+ * End:
+ */
diff --git a/src/vppinfra/tw_timer_2t_2w_512sl.h b/src/vppinfra/tw_timer_2t_2w_512sl.h
new file mode 100644
index 0000000..7ea88bd
--- /dev/null
+++ b/src/vppinfra/tw_timer_2t_2w_512sl.h
@@ -0,0 +1,52 @@
+/*
+ * Copyright (c) 2017-2020 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.
+ */
+
+#ifndef __included_tw_timer_2t_2w_512sl_h__
+#define __included_tw_timer_2t_2w_512sl_h__
+
+/* ... So that a client app can create multiple wheel geometries */
+#undef TW_TIMER_WHEELS
+#undef TW_SLOTS_PER_RING
+#undef TW_RING_SHIFT
+#undef TW_RING_MASK
+#undef TW_TIMERS_PER_OBJECT
+#undef LOG2_TW_TIMERS_PER_OBJECT
+#undef TW_SUFFIX
+#undef TW_OVERFLOW_VECTOR
+#undef TW_FAST_WHEEL_BITMAP
+#undef TW_TIMER_ALLOW_DUPLICATE_STOP
+#undef TW_START_STOP_TRACE_SIZE
+
+#define TW_TIMER_WHEELS 2
+#define TW_SLOTS_PER_RING 512
+#define TW_RING_SHIFT 9
+#define TW_RING_MASK (TW_SLOTS_PER_RING -1)
+#define TW_TIMERS_PER_OBJECT 2
+#define LOG2_TW_TIMERS_PER_OBJECT 1
+#define TW_SUFFIX _2t_2w_512sl
+#define TW_FAST_WHEEL_BITMAP 0
+#define TW_TIMER_ALLOW_DUPLICATE_STOP 0
+
+#include <vppinfra/tw_timer_template.h>
+
+#endif /* __included_tw_timer_2t_2w_512sl_h__ */
+
+/*
+ * fd.io coding-style-patch-verification: ON
+ *
+ * Local Variables:
+ * eval: (c-set-style "gnu")
+ * End:
+ */
