diff --git a/src/vppinfra/test/array_mask.c b/src/vppinfra/test/array_mask.c
new file mode 100644
index 0000000..c3b475c
--- /dev/null
+++ b/src/vppinfra/test/array_mask.c
@@ -0,0 +1,124 @@
+/* SPDX-License-Identifier: Apache-2.0
+ * Copyright(c) 2021 Cisco Systems, Inc.
+ */
+
+#include <vppinfra/format.h>
+#include <vppinfra/test/test.h>
+#include <vppinfra/vector/array_mask.h>
+
+__test_funct_fn void
+clib_array_mask_u32_wrapper (u32 *src, u32 mask, u32 n_elts)
+{
+  clib_array_mask_u32 (src, mask, n_elts);
+}
+
+typedef struct
+{
+  u32 mask;
+  u32 expected[256];
+} array_mask_test_t;
+
+static array_mask_test_t tests[] = {
+  /* mask values 0x1, output array of alternating 0 1 0 1 .. */
+  { .mask = 1,
+    .expected = { 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1,
+		  0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1,
+		  0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1,
+		  0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1,
+		  0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1,
+		  0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1,
+		  0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1,
+		  0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1,
+		  0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1,
+		  0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1,
+		  0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1,
+		  0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1,
+		  0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1 } },
+  /* mask values 0xFFFFFFFF, output array of 0, 1, 2, .., 255 */
+  { .mask = ~0U,
+    .expected = { 0,   1,   2,	 3,   4,   5,	6,   7,	  8,   9,   10,	 11,
+		  12,  13,  14,	 15,  16,  17,	18,  19,  20,  21,  22,	 23,
+		  24,  25,  26,	 27,  28,  29,	30,  31,  32,  33,  34,	 35,
+		  36,  37,  38,	 39,  40,  41,	42,  43,  44,  45,  46,	 47,
+		  48,  49,  50,	 51,  52,  53,	54,  55,  56,  57,  58,	 59,
+		  60,  61,  62,	 63,  64,  65,	66,  67,  68,  69,  70,	 71,
+		  72,  73,  74,	 75,  76,  77,	78,  79,  80,  81,  82,	 83,
+		  84,  85,  86,	 87,  88,  89,	90,  91,  92,  93,  94,	 95,
+		  96,  97,  98,	 99,  100, 101, 102, 103, 104, 105, 106, 107,
+		  108, 109, 110, 111, 112, 113, 114, 115, 116, 117, 118, 119,
+		  120, 121, 122, 123, 124, 125, 126, 127, 128, 129, 130, 131,
+		  132, 133, 134, 135, 136, 137, 138, 139, 140, 141, 142, 143,
+		  144, 145, 146, 147, 148, 149, 150, 151, 152, 153, 154, 155,
+		  156, 157, 158, 159, 160, 161, 162, 163, 164, 165, 166, 167,
+		  168, 169, 170, 171, 172, 173, 174, 175, 176, 177, 178, 179,
+		  180, 181, 182, 183, 184, 185, 186, 187, 188, 189, 190, 191,
+		  192, 193, 194, 195, 196, 197, 198, 199, 200, 201, 202, 203,
+		  204, 205, 206, 207, 208, 209, 210, 211, 212, 213, 214, 215,
+		  216, 217, 218, 219, 220, 221, 222, 223, 224, 225, 226, 227,
+		  228, 229, 230, 231, 232, 233, 234, 235, 236, 237, 238, 239,
+		  240, 241, 242, 243, 244, 245, 246, 247, 248, 249, 250, 251,
+		  252, 253, 254, 255 } },
+  /* mask values 0xF, output array of 0, .., 15, 0, .., 15, 0, .., 15 */
+  { .mask = 15,
+    .expected = { 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15,
+		  0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15,
+		  0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15,
+		  0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15,
+		  0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15,
+		  0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15,
+		  0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15,
+		  0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15,
+		  0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15,
+		  0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15,
+		  0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15,
+		  0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15,
+		  0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15,
+		  0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15,
+		  0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15,
+		  0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15 } },
+  /* mask values 0x1, output array of 1, 0, 1, 0,.. */
+  { .mask = 1, .expected = { 1, 0, 1, 0, 1, 0, 1, 0, 1, 0 } },
+};
+
+static clib_error_t *
+test_clib_array_mask_u32 (clib_error_t *err)
+{
+  u32 i, j;
+  for (i = 0; i < ARRAY_LEN (tests) - 1; i++)
+    {
+      u32 src[256];
+      for (j = 0; j < ARRAY_LEN (src); j++)
+	src[j] = j;
+
+      array_mask_test_t *t = tests + i;
+      clib_array_mask_u32_wrapper (src, t->mask, ARRAY_LEN (src));
+      for (j = 0; j < ARRAY_LEN (src); j++)
+	{
+	  if (src[j] != t->expected[j])
+	    return clib_error_return (err,
+				      "testcase %u failed at "
+				      "(src[%u] = 0x%x, expected 0x%x)",
+				      i, j, src[j], t->expected[j]);
+	}
+    }
+
+  u32 src[10] = { 1, 2, 3, 4, 5, 6, 7, 8, 9, 10 };
+  array_mask_test_t *t = tests + i;
+
+  clib_array_mask_u32_wrapper (src, t->mask, ARRAY_LEN (src));
+  for (j = 0; j < ARRAY_LEN (src); j++)
+    {
+      if (src[j] != t->expected[j])
+	return clib_error_return (err,
+				  "testcase %u failed at "
+				  "(src[%u] = 0x%x, expected 0x%x)",
+				  i, j, src[j], t->expected[j]);
+    }
+
+  return err;
+}
+
+REGISTER_TEST (clib_array_mask_u32) = {
+  .name = "clib_array_mask_u32",
+  .fn = test_clib_array_mask_u32,
+};
diff --git a/src/vppinfra/test/compress.c b/src/vppinfra/test/compress.c
new file mode 100644
index 0000000..7fdc3f8
--- /dev/null
+++ b/src/vppinfra/test/compress.c
@@ -0,0 +1,248 @@
+/* SPDX-License-Identifier: Apache-2.0
+ * Copyright(c) 2021 Cisco Systems, Inc.
+ */
+
+#include <vppinfra/format.h>
+#include <vppinfra/test/test.h>
+#include <vppinfra/vector/compress.h>
+
+__test_funct_fn u32
+clib_compress_u64_wrapper (u64 *dst, u64 *src, u64 *mask, u32 n_elts)
+{
+  return clib_compress_u64 (dst, src, mask, n_elts);
+}
+
+__test_funct_fn u32
+clib_compress_u32_wrapper (u32 *dst, u32 *src, u64 *mask, u32 n_elts)
+{
+  return clib_compress_u32 (dst, src, mask, n_elts);
+}
+
+__test_funct_fn u32
+clib_compress_u16_wrapper (u16 *dst, u16 *src, u64 *mask, u32 n_elts)
+{
+  return clib_compress_u16 (dst, src, mask, n_elts);
+}
+
+__test_funct_fn u32
+clib_compress_u8_wrapper (u8 *dst, u8 *src, u64 *mask, u32 n_elts)
+{
+  return clib_compress_u8 (dst, src, mask, n_elts);
+}
+
+typedef struct
+{
+  u64 mask[10];
+  u32 n_elts;
+} compress_test_t;
+
+static compress_test_t tests[] = {
+  { .mask = { 1 }, .n_elts = 1 },
+  { .mask = { 2 }, .n_elts = 2 },
+  { .mask = { 3 }, .n_elts = 2 },
+  { .mask = { 0, 1 }, .n_elts = 66 },
+  { .mask = { 0, 2 }, .n_elts = 69 },
+  { .mask = { 0, 3 }, .n_elts = 66 },
+  { .mask = { ~0ULL, ~0ULL, ~0ULL, ~0ULL }, .n_elts = 62 },
+  { .mask = { ~0ULL, ~0ULL, ~0ULL, ~0ULL }, .n_elts = 255 },
+  { .mask = { ~0ULL, 1, 1, ~0ULL }, .n_elts = 256 },
+};
+
+static clib_error_t *
+test_clib_compress_u64 (clib_error_t *err)
+{
+  u64 src[513];
+  u64 dst[513];
+  u32 i, j;
+
+  for (i = 0; i < ARRAY_LEN (src); i++)
+    src[i] = i;
+
+  for (i = 0; i < ARRAY_LEN (tests); i++)
+    {
+      compress_test_t *t = tests + i;
+      u64 *dp = dst;
+      u32 r;
+
+      for (j = 0; j < ARRAY_LEN (dst); j++)
+	dst[j] = 0xa5a5a5a5a5a5a5a5;
+
+      r = clib_compress_u64_wrapper (dst, src, t->mask, t->n_elts);
+
+      for (j = 0; j < t->n_elts; j++)
+	{
+	  if ((t->mask[j >> 6] & (1ULL << (j & 0x3f))) == 0)
+	    continue;
+	  if (dp[0] != src[j])
+	    return clib_error_return (err,
+				      "wrong data in testcase %u at "
+				      "(dst[%u] = 0x%lx, src[%u] = 0x%lx)",
+				      i, dp - dst, dp[0], j, src[j]);
+	  dp++;
+	}
+
+      if (dst[dp - dst + 1] != 0xa5a5a5a5a5a5a5a5)
+	return clib_error_return (err, "buffer overrun in testcase %u", i);
+
+      if (dp - dst != r)
+	return clib_error_return (err, "wrong number of elts in testcase %u",
+				  i);
+    }
+
+  return err;
+
+  return err;
+}
+
+static clib_error_t *
+test_clib_compress_u32 (clib_error_t *err)
+{
+  u32 src[513];
+  u32 dst[513];
+  u32 i, j;
+
+  for (i = 0; i < ARRAY_LEN (src); i++)
+    src[i] = i;
+
+  for (i = 0; i < ARRAY_LEN (tests); i++)
+    {
+      compress_test_t *t = tests + i;
+      u32 *dp = dst;
+      u32 r;
+
+      for (j = 0; j < ARRAY_LEN (dst); j++)
+	dst[j] = 0xa5a5a5a5;
+
+      r = clib_compress_u32_wrapper (dst, src, t->mask, t->n_elts);
+
+      for (j = 0; j < t->n_elts; j++)
+	{
+	  if ((t->mask[j >> 6] & (1ULL << (j & 0x3f))) == 0)
+	    continue;
+
+	  if (dp[0] != src[j])
+	    return clib_error_return (err,
+				      "wrong data in testcase %u at "
+				      "(dst[%u] = 0x%x, src[%u] = 0x%x)",
+				      i, dp - dst, dp[0], j, src[j]);
+	  dp++;
+	}
+
+      if (dst[dp - dst + 1] != 0xa5a5a5a5)
+	return clib_error_return (err, "buffer overrun in testcase %u", i);
+
+      if (dp - dst != r)
+	return clib_error_return (err, "wrong number of elts in testcase %u",
+				  i);
+    }
+
+  return err;
+}
+
+static clib_error_t *
+test_clib_compress_u16 (clib_error_t *err)
+{
+  u16 src[513];
+  u16 dst[513];
+  u32 i, j;
+
+  for (i = 0; i < ARRAY_LEN (src); i++)
+    src[i] = i;
+
+  for (i = 0; i < ARRAY_LEN (tests); i++)
+    {
+      compress_test_t *t = tests + i;
+      u16 *dp = dst;
+      u32 r;
+
+      for (j = 0; j < ARRAY_LEN (dst); j++)
+	dst[j] = 0xa5a5;
+
+      r = clib_compress_u16_wrapper (dst, src, t->mask, t->n_elts);
+
+      for (j = 0; j < t->n_elts; j++)
+	{
+	  if ((t->mask[j >> 6] & (1ULL << (j & 0x3f))) == 0)
+	    continue;
+	  if (dp[0] != src[j])
+	    return clib_error_return (err,
+				      "wrong data in testcase %u at "
+				      "(dst[%u] = 0x%x, src[%u] = 0x%x)",
+				      i, dp - dst, dp[0], j, src[j]);
+	  dp++;
+	}
+
+      if (dst[dp - dst + 1] != 0xa5a5)
+	return clib_error_return (err, "buffer overrun in testcase %u", i);
+
+      if (dp - dst != r)
+	return clib_error_return (err, "wrong number of elts in testcase %u",
+				  i);
+    }
+
+  return err;
+}
+
+static clib_error_t *
+test_clib_compress_u8 (clib_error_t *err)
+{
+  u8 src[513];
+  u8 dst[513];
+  u32 i, j;
+
+  for (i = 0; i < ARRAY_LEN (src); i++)
+    src[i] = i;
+
+  for (i = 0; i < ARRAY_LEN (tests); i++)
+    {
+      compress_test_t *t = tests + i;
+      u8 *dp = dst;
+      u32 r;
+
+      for (j = 0; j < ARRAY_LEN (dst); j++)
+	dst[j] = 0xa5;
+
+      r = clib_compress_u8_wrapper (dst, src, t->mask, t->n_elts);
+
+      for (j = 0; j < t->n_elts; j++)
+	{
+	  if ((t->mask[j >> 6] & (1ULL << (j & 0x3f))) == 0)
+	    continue;
+	  if (dp[0] != src[j])
+	    return clib_error_return (err,
+				      "wrong data in testcase %u at "
+				      "(dst[%u] = 0x%x, src[%u] = 0x%x)",
+				      i, dp - dst, dp[0], j, src[j]);
+	  dp++;
+	}
+
+      if (dst[dp - dst + 1] != 0xa5)
+	return clib_error_return (err, "buffer overrun in testcase %u", i);
+
+      if (dp - dst != r)
+	return clib_error_return (err, "wrong number of elts in testcase %u",
+				  i);
+    }
+
+  return err;
+}
+
+REGISTER_TEST (clib_compress_u64) = {
+  .name = "clib_compress_u64",
+  .fn = test_clib_compress_u64,
+};
+
+REGISTER_TEST (clib_compress_u32) = {
+  .name = "clib_compress_u32",
+  .fn = test_clib_compress_u32,
+};
+
+REGISTER_TEST (clib_compress_u16) = {
+  .name = "clib_compress_u16",
+  .fn = test_clib_compress_u16,
+};
+
+REGISTER_TEST (clib_compress_u8) = {
+  .name = "clib_compress_u8",
+  .fn = test_clib_compress_u8,
+};
diff --git a/src/vppinfra/test/count_equal.c b/src/vppinfra/test/count_equal.c
new file mode 100644
index 0000000..942c220
--- /dev/null
+++ b/src/vppinfra/test/count_equal.c
@@ -0,0 +1,104 @@
+/* SPDX-License-Identifier: Apache-2.0
+ * Copyright(c) 2021 Cisco Systems, Inc.
+ */
+
+#include <vppinfra/format.h>
+#include <vppinfra/test/test.h>
+#include <vppinfra/vector/count_equal.h>
+
+#define foreach_clib_count_equal(type)                                        \
+  typedef uword (wrapper_fn_##type) (type * a, uword maxcount);               \
+                                                                              \
+  __test_funct_fn uword clib_count_equal_##type##_wrapper (type *a,           \
+							   uword maxcount)    \
+  {                                                                           \
+    return clib_count_equal_##type (a, maxcount);                             \
+  }                                                                           \
+                                                                              \
+  static wrapper_fn_##type *wfn_##type = &clib_count_equal_##type##_wrapper;  \
+  static clib_error_t *test_clib_count_equal_##type (clib_error_t *err)       \
+  {                                                                           \
+    u32 ps = clib_mem_get_log2_page_size ();                                  \
+    void *map;                                                                \
+                                                                              \
+    u16 lengths[] = {                                                         \
+      1, 2, 3, 5, 7, 9, 15, 16, 17, 31, 32, 33, 255, 256, 257                 \
+    };                                                                        \
+    type *data;                                                               \
+                                                                              \
+    map = clib_mem_vm_map (0, 2ULL << ps, ps, "test");                        \
+    if (map == CLIB_MEM_VM_MAP_FAILED)                                        \
+      return clib_error_return (err, "clib_mem_vm_map failed");               \
+                                                                              \
+    data = ((type *) (map + (1ULL << ps)));                                   \
+    data[-1] = 0xfe;                                                          \
+                                                                              \
+    mprotect (data, 1ULL < ps, PROT_NONE);                                    \
+                                                                              \
+    for (u8 d = 0; d < 255; d++)                                              \
+      {                                                                       \
+	for (int i = 1; i <= (1 << ps) / sizeof (data[0]); i++)               \
+	  data[-i] = d;                                                       \
+	for (int i = 0; i < ARRAY_LEN (lengths); i++)                         \
+	  {                                                                   \
+	    uword rv, len = lengths[i];                                       \
+                                                                              \
+	    if ((rv = wfn_##type (data - len, len)) != len)                   \
+	      {                                                               \
+		err = clib_error_return (                                     \
+		  err, "testcase 1 failed for len %u data %u(rv %u)", len, d, \
+		  rv);                                                        \
+		goto done;                                                    \
+	      }                                                               \
+                                                                              \
+	    data[-1] = d + 1;                                                 \
+	    if (len > 1 && ((rv = wfn_##type (data - len, len)) != len - 1))  \
+	      {                                                               \
+		err = clib_error_return (                                     \
+		  err, "testcase 2 failed for len %u data %u (rv %u)", len,   \
+		  d, rv);                                                     \
+		goto done;                                                    \
+	      }                                                               \
+	    data[-1] = d;                                                     \
+                                                                              \
+	    data[-2] = d + 1;                                                 \
+	    if (len > 2 && ((rv = wfn_##type (data - len, len)) != len - 2))  \
+	      {                                                               \
+		err = clib_error_return (                                     \
+		  err, "testcase 3 failed for len %u data %u (rv %u)", len,   \
+		  d, rv);                                                     \
+		goto done;                                                    \
+	      }                                                               \
+	    data[-2] = d;                                                     \
+	  }                                                                   \
+      }                                                                       \
+                                                                              \
+  done:                                                                       \
+    clib_mem_vm_unmap (map);                                                  \
+    return err;                                                               \
+  }
+
+foreach_clib_count_equal (u8);
+foreach_clib_count_equal (u16);
+foreach_clib_count_equal (u32);
+foreach_clib_count_equal (u64);
+
+REGISTER_TEST (clib_count_equal_u8) = {
+  .name = "clib_count_equal_u8",
+  .fn = test_clib_count_equal_u8,
+};
+
+REGISTER_TEST (clib_count_equal_u16) = {
+  .name = "clib_count_equal_u16",
+  .fn = test_clib_count_equal_u16,
+};
+
+REGISTER_TEST (clib_count_equal_u32) = {
+  .name = "clib_count_equal_u32",
+  .fn = test_clib_count_equal_u32,
+};
+
+REGISTER_TEST (clib_count_equal_u64) = {
+  .name = "clib_count_equal_u64",
+  .fn = test_clib_count_equal_u64,
+};
diff --git a/src/vppinfra/test/index_to_ptr.c b/src/vppinfra/test/index_to_ptr.c
new file mode 100644
index 0000000..06b621c
--- /dev/null
+++ b/src/vppinfra/test/index_to_ptr.c
@@ -0,0 +1,58 @@
+/* SPDX-License-Identifier: Apache-2.0
+ * Copyright(c) 2021 Cisco Systems, Inc.
+ */
+
+#include <vppinfra/format.h>
+#include <vppinfra/test/test.h>
+#include <vppinfra/vector/index_to_ptr.h>
+
+typedef void (wrapper_fn) (u32 *indices, void *base, u8 shift, void **ptrs,
+			   u32 n_elts);
+
+__test_funct_fn void
+clib_index_to_ptr_u32_wrapper (u32 *indices, void *base, u8 shift, void **ptrs,
+			       u32 n_elts)
+{
+  clib_index_to_ptr_u32 (indices, base, shift, ptrs, n_elts);
+}
+
+static wrapper_fn *wfn = &clib_index_to_ptr_u32_wrapper;
+
+static clib_error_t *
+test_clib_index_to_ptr_u32 (clib_error_t *err)
+{
+  void *_ptrs[512 + 128], **ptrs = _ptrs + 64;
+  u32 _indices[512 + 128], *indices = _indices + 64;
+  u16 lengths[] = { 1,	3,  5,	7,  9,	15, 16, 17,  31, 32,
+		    33, 40, 41, 42, 63, 64, 65, 511, 512 };
+
+  for (int i = 0; i < ARRAY_LEN (_indices); i++)
+    _indices[i] = i;
+
+  for (int i = 0; i < ARRAY_LEN (lengths); i++)
+    {
+      u16 len = lengths[i];
+      u8 shift = 6;
+      void *base = (void *) 0x100000000 + i;
+
+      for (int j = -64; j < len + 64; j++)
+	ptrs[j] = (void *) 0xfefefefefefefefe;
+
+      wfn (indices, base, shift, ptrs, len);
+      for (int j = 0; j < len; j++)
+	{
+	  void *expected = base + ((u64) indices[j] << shift);
+	  if (ptrs[j] != expected)
+	    return clib_error_return (err,
+				      "testcase failed for length %u "
+				      "(offset %u, expected %p, found %p)",
+				      len, j, expected, ptrs[j]);
+	}
+    }
+  return err;
+}
+
+REGISTER_TEST (clib_index_to_ptr_u32) = {
+  .name = "clib_index_to_ptr_u32",
+  .fn = test_clib_index_to_ptr_u32,
+};
diff --git a/src/vppinfra/test/ip_csum.c b/src/vppinfra/test/ip_csum.c
new file mode 100644
index 0000000..9387336
--- /dev/null
+++ b/src/vppinfra/test/ip_csum.c
@@ -0,0 +1,179 @@
+/* SPDX-License-Identifier: Apache-2.0
+ * Copyright(c) 2021 Cisco Systems, Inc.
+ */
+
+#include <vppinfra/format.h>
+#include <vppinfra/test/test.h>
+#include <vppinfra/vector/ip_csum.h>
+
+typedef struct
+{
+  struct
+  {
+    u8 *src;
+    u32 count;
+  } chunk[5];
+  u16 result;
+} ip_csum_test_t;
+
+static u8 test1[] = { 0x45, 0x00, 0x00, 0x73, 0x00, 0x00, 0x40,
+		      0x00, 0x40, 0x11, 0x00, 0x00, 0xc0, 0xa8,
+		      0x00, 0x01, 0xc0, 0xa8, 0x00, 0xc7, 0x00 };
+#define TEST_LEN(x) (ARRAY_LEN (x) - 1)
+
+static ip_csum_test_t tests[] = { {
+				    .chunk[0].src = test1,
+				    .chunk[0].count = TEST_LEN (test1),
+				    .result = 0x61b8,
+				  },
+				  {
+				    .chunk[0].src = test1,
+				    .chunk[0].count = 1,
+				    .chunk[1].src = test1 + 1,
+				    .chunk[1].count = 2,
+				    .chunk[2].src = test1 + 3,
+				    .chunk[2].count = 3,
+				    .chunk[3].src = test1 + 6,
+				    .chunk[3].count = 4,
+				    .chunk[4].src = test1 + 10,
+				    .chunk[4].count = TEST_LEN (test1) - 10,
+				    .result = 0x61b8,
+				  },
+				  {
+				    .chunk[0].count = 1,
+				    .result = 0xff0f,
+				  },
+				  {
+				    .chunk[0].count = 2,
+				    .result = 0x080f,
+				  },
+				  {
+				    .chunk[0].count = 3,
+				    .result = 0x0711,
+				  },
+				  {
+				    .chunk[0].count = 4,
+				    .result = 0x1210,
+				  },
+				  {
+				    .chunk[0].count = 63,
+				    .result = 0xda01,
+				  },
+				  {
+				    .chunk[0].count = 64,
+				    .result = 0xe100,
+				  },
+				  {
+				    .chunk[0].count = 65,
+				    .result = 0xe010,
+				  },
+				  {
+				    .chunk[0].count = 65535,
+				    .result = 0xfc84,
+				  },
+				  {
+				    .chunk[0].count = 65536,
+				    .result = 0xffff,
+				  } };
+
+static clib_error_t *
+test_clib_ip_csum (clib_error_t *err)
+{
+  u8 *buf;
+  buf = test_mem_alloc (65536);
+  for (int i = 0; i < 65536; i++)
+    buf[i] = 0xf0 + ((i * 7) & 0xf);
+
+  for (int i = 0; i < ARRAY_LEN (tests); i++)
+    {
+      clib_ip_csum_t c = {};
+      ip_csum_test_t *t = tests + i;
+      u16 rv;
+
+      for (int j = 0; j < ARRAY_LEN (((ip_csum_test_t *) 0)->chunk); j++)
+	if (t->chunk[j].count > 0)
+	  {
+	    if (t->chunk[j].src == 0)
+	      clib_ip_csum_chunk (&c, buf, t->chunk[j].count);
+	    else
+	      clib_ip_csum_chunk (&c, t->chunk[j].src, t->chunk[j].count);
+	  }
+      rv = clib_ip_csum_fold (&c);
+
+      if (rv != tests[i].result)
+	{
+	  err = clib_error_return (err,
+				   "bad checksum in test case %u (expected "
+				   "0x%04x, calculated 0x%04x)",
+				   i, tests[i].result, rv);
+	  goto done;
+	}
+    }
+done:
+  test_mem_free (buf);
+  return err;
+}
+
+void __test_perf_fn
+perftest_ip4_hdr (test_perf_t *tp)
+{
+  u32 n = tp->n_ops;
+  u8 *data = test_mem_alloc_and_splat (20, n, (void *) &test1);
+  u16 *res = test_mem_alloc (n * sizeof (u16));
+
+  test_perf_event_enable (tp);
+  for (int i = 0; i < n; i++)
+    res[i] = clib_ip_csum (data + i * 20, 20);
+  test_perf_event_disable (tp);
+
+  test_mem_free (data);
+  test_mem_free (res);
+}
+
+void __test_perf_fn
+perftest_tcp_payload (test_perf_t *tp)
+{
+  u32 n = tp->n_ops;
+  volatile uword *lenp = &tp->arg0;
+  u8 *data = test_mem_alloc_and_splat (20, n, (void *) &test1);
+  u16 *res = test_mem_alloc (n * sizeof (u16));
+
+  test_perf_event_enable (tp);
+  for (int i = 0; i < n; i++)
+    res[i] = clib_ip_csum (data + i * lenp[0], lenp[0]);
+  test_perf_event_disable (tp);
+
+  test_mem_free (data);
+  test_mem_free (res);
+}
+
+void __test_perf_fn
+perftest_byte (test_perf_t *tp)
+{
+  volatile uword *np = &tp->n_ops;
+  u8 *data = test_mem_alloc_and_fill_inc_u8 (*np, 0, 0);
+  u16 *res = test_mem_alloc (sizeof (u16));
+
+  test_perf_event_enable (tp);
+  res[0] = clib_ip_csum (data, np[0]);
+  test_perf_event_disable (tp);
+
+  test_mem_free (data);
+  test_mem_free (res);
+}
+
+REGISTER_TEST (clib_ip_csum) = {
+  .name = "clib_ip_csum",
+  .fn = test_clib_ip_csum,
+  .perf_tests = PERF_TESTS (
+    { .name = "fixed size (per IPv4 Header)",
+      .n_ops = 1024,
+      .fn = perftest_ip4_hdr },
+    { .name = "fixed size (per 1460 byte block)",
+      .n_ops = 16,
+      .arg0 = 1460,
+      .fn = perftest_tcp_payload },
+    { .name = "variable size (per byte)", .n_ops = 16384, .fn = perftest_byte }
+
+    ),
+};
diff --git a/src/vppinfra/test/mask_compare.c b/src/vppinfra/test/mask_compare.c
new file mode 100644
index 0000000..738b008
--- /dev/null
+++ b/src/vppinfra/test/mask_compare.c
@@ -0,0 +1,139 @@
+/* SPDX-License-Identifier: Apache-2.0
+ * Copyright(c) 2021 Cisco Systems, Inc.
+ */
+
+#include <vppinfra/format.h>
+#include <vppinfra/test/test.h>
+#include <vppinfra/vector/mask_compare.h>
+
+__test_funct_fn void
+clib_mask_compare_u16_wrapper (u16 v, u16 *a, u64 *mask, u32 n_elts)
+{
+  clib_mask_compare_u16 (v, a, mask, n_elts);
+}
+
+__test_funct_fn void
+clib_mask_compare_u32_wrapper (u32 v, u32 *a, u64 *mask, u32 n_elts)
+{
+  clib_mask_compare_u32 (v, a, mask, n_elts);
+}
+
+__test_funct_fn void
+clib_mask_compare_u64_wrapper (u64 v, u64 *a, u64 *mask, u64 n_elts)
+{
+  clib_mask_compare_u64 (v, a, mask, n_elts);
+}
+
+static clib_error_t *
+test_clib_mask_compare_u16 (clib_error_t *err)
+{
+  u16 array[513];
+  u64 mask[10];
+  u32 i, j;
+
+  for (i = 0; i < ARRAY_LEN (array); i++)
+    array[i] = i;
+
+  for (i = 0; i < ARRAY_LEN (array); i++)
+    {
+      for (j = 0; j < ARRAY_LEN (mask); j++)
+	mask[j] = 0xa5a5a5a5a5a5a5a5;
+
+      clib_mask_compare_u16_wrapper (i, array, mask, i + 1);
+
+      for (j = 0; j < (i >> 6); j++)
+	{
+	  if (mask[j])
+	    return clib_error_return (err, "mask at position %u not zero", j);
+	}
+      if (mask[j] != 1ULL << (i & 0x3f))
+	return clib_error_return (err,
+				  "mask at position %u is %lx, expected %lx",
+				  j, mask[j], 1ULL << (i % 64));
+
+      if (mask[j + 1] != 0xa5a5a5a5a5a5a5a5)
+	return clib_error_return (err, "mask overrun at position %u", j + 1);
+    }
+  return err;
+}
+
+REGISTER_TEST (clib_mask_compare_u16) = {
+  .name = "clib_mask_compare_u16",
+  .fn = test_clib_mask_compare_u16,
+};
+
+static clib_error_t *
+test_clib_mask_compare_u32 (clib_error_t *err)
+{
+  u32 array[513];
+  u64 mask[10];
+  u32 i, j;
+
+  for (i = 0; i < ARRAY_LEN (array); i++)
+    array[i] = i;
+
+  for (i = 0; i < ARRAY_LEN (array); i++)
+    {
+      for (j = 0; j < ARRAY_LEN (mask); j++)
+	mask[j] = 0xa5a5a5a5a5a5a5a5;
+
+      clib_mask_compare_u32_wrapper (i, array, mask, i + 1);
+
+      for (j = 0; j < (i >> 6); j++)
+	{
+	  if (mask[j])
+	    return clib_error_return (err, "mask at position %u not zero", j);
+	}
+      if (mask[j] != 1ULL << (i & 0x3f))
+	return clib_error_return (err,
+				  "mask at position %u is %lx, expected %lx",
+				  j, mask[j], 1ULL << (i % 64));
+
+      if (mask[j + 1] != 0xa5a5a5a5a5a5a5a5)
+	return clib_error_return (err, "mask overrun at position %u", j + 1);
+    }
+  return err;
+}
+
+REGISTER_TEST (clib_mask_compare_u32) = {
+  .name = "clib_mask_compare_u32",
+  .fn = test_clib_mask_compare_u32,
+};
+
+static clib_error_t *
+test_clib_mask_compare_u64 (clib_error_t *err)
+{
+  u64 array[513];
+  u64 mask[10];
+  u32 i, j;
+
+  for (i = 0; i < ARRAY_LEN (array); i++)
+    array[i] = i;
+
+  for (i = 0; i < ARRAY_LEN (array); i++)
+    {
+      for (j = 0; j < ARRAY_LEN (mask); j++)
+	mask[j] = 0xa5a5a5a5a5a5a5a5;
+
+      clib_mask_compare_u64_wrapper (i, array, mask, i + 1);
+
+      for (j = 0; j < (i >> 6); j++)
+	{
+	  if (mask[j])
+	    return clib_error_return (err, "mask at position %u not zero", j);
+	}
+      if (mask[j] != 1ULL << (i & 0x3f))
+	return clib_error_return (err,
+				  "mask at position %u is %lx, expected %lx",
+				  j, mask[j], 1ULL << (i % 64));
+
+      if (mask[j + 1] != 0xa5a5a5a5a5a5a5a5)
+	return clib_error_return (err, "mask overrun at position %u", j + 1);
+    }
+  return err;
+}
+
+REGISTER_TEST (clib_mask_compare_u64) = {
+  .name = "clib_mask_compare_u64",
+  .fn = test_clib_mask_compare_u64,
+};
diff --git a/src/vppinfra/test/memcpy_x86_64.c b/src/vppinfra/test/memcpy_x86_64.c
new file mode 100644
index 0000000..4d9525d
--- /dev/null
+++ b/src/vppinfra/test/memcpy_x86_64.c
@@ -0,0 +1,142 @@
+/* SPDX-License-Identifier: Apache-2.0
+ * Copyright(c) 2021 Cisco Systems, Inc.
+ */
+
+#ifdef __x86_64__
+
+#include <vppinfra/format.h>
+#include <vppinfra/test/test.h>
+#include <vppinfra/vector/mask_compare.h>
+
+__test_funct_fn void
+wrapper (u8 *dst, u8 *src, uword n)
+{
+  clib_memcpy_x86_64 (dst, src, n);
+}
+
+/* clang-format off */
+#define foreach_const_n \
+  _(1) _(2) _(3) _(4) _(5) _(6) _(7) _(8) _(9) _(10) _(11) _(12) _(13) _(14)  \
+  _(15) _(16) _(17) _(18) _(19) _(20) _(21) _(22) _(23) _(24) _(25) _(26)     \
+  _(27) _(28) _(29) _(30) _(31) _(32) _(33) _(34) _(35) _(36) _(37) _(38)     \
+  _(39) _(40) _(41) _(42) _(43) _(44) _(45) _(46) _(47) _(48) _(49) _(50)     \
+  _(51) _(52) _(53) _(54) _(55) _(56) _(57) _(58) _(59) _(60) _(61) _(62)     \
+  _(63) _(64) _(65) _(66) _(67) _(68) _(69) _(70) _(71) _(72) _(73) _(74)     \
+  _(75) _(76) _(77) _(78) _(79) _(80) _(81) _(82) _(83) _(84) _(85) _(86)     \
+  _(87) _(88) _(89) _(90) _(91) _(92) _(93) _(94) _(95) _(96) _(97) _(98)     \
+  _(99) _(100) _(101) _(102) _(103) _(104) _(105) _(106) _(107) _(108)        \
+  _(109) _(110) _(111) _(112) _(113) _(114) _(115) _(116) _(117) _(118)       \
+  _(119) _(120) _(121) _(122) _(123) _(124) _(125) _(126) _(127) _(128)       \
+  _(129) _(130) _(131) _(132) _(133) _(134) _(135) _(136) _(137) _(138)       \
+  _(139) _(140) _(141) _(142) _(143) _(144) _(145) _(146) _(147) _(148)       \
+  _(149) _(150) _(151) _(152) _(153) _(154) _(155) _(156) _(157) _(158)       \
+  _(159) _(160) _(161) _(162) _(163) _(164) _(165) _(166) _(167) _(168)       \
+  _(169) _(170) _(171) _(172) _(173) _(174) _(175) _(176) _(177) _(178)       \
+  _(179) _(180) _(181) _(182) _(183) _(184) _(185) _(186) _(187) _(188)       \
+  _(189) _(190) _(191) _(192) _(193) _(194) _(195) _(196) _(197) _(198)       \
+  _(199) _(200) _(201) _(202) _(203) _(204) _(205) _(206) _(207) _(208)       \
+  _(209) _(210) _(211) _(212) _(213) _(214) _(215) _(216) _(217) _(218)       \
+  _(219) _(220) _(221) _(222) _(223) _(224) _(225) _(226) _(227) _(228)       \
+  _(229) _(230) _(231) _(232) _(233) _(234) _(235) _(236) _(237) _(238)       \
+  _(239) _(240) _(241) _(242) _(243) _(244) _(245) _(246) _(247) _(248)       \
+  _(249) _(250) _(251) _(252) _(253) _(254) _(255)
+/* clang-format on */
+
+#define _(n)                                                                  \
+  static __clib_noinline void wrapper##n (u8 *dst, u8 *src)                   \
+  {                                                                           \
+    clib_memcpy_x86_64 (dst, src, n);                                         \
+  }
+
+foreach_const_n;
+#undef _
+
+typedef void (const_fp_t) (u8 *dst, u8 *src);
+typedef struct
+{
+  u16 len;
+  const_fp_t *fp;
+} counst_test_t;
+
+static counst_test_t const_tests[] = {
+#define _(n) { .fp = wrapper##n, .len = n },
+  foreach_const_n
+#undef _
+};
+
+#define MAX_LEN 1024
+
+static clib_error_t *
+validate_one (clib_error_t *err, u8 *d, u8 *s, u16 n, u8 off, int is_const)
+{
+  for (int i = 0; i < n; i++)
+    if (d[i] != s[i])
+      return clib_error_return (err,
+				"memcpy error at position %d "
+				"(n = %u, off = %u, expected 0x%02x "
+				"found 0x%02x%s)",
+				i, n, off, s[i], d[i],
+				is_const ? ", const" : "");
+  for (int i = -64; i < 0; i++)
+    if (d[i] != 0xfe)
+      return clib_error_return (err,
+				"buffer underrun at position %d "
+				"(n = %u, off = %u, expected 0xfe "
+				"found 0x%02x%s)",
+				i, n, off, d[i], is_const ? ", const" : "");
+  for (int i = n; i < n + 64; i++)
+    if (d[i] != 0xfe)
+      return clib_error_return (err,
+				"buffer overrun at position %d "
+				"(n = %u, off = %u, expected 0xfe "
+				"found 0x%02x%s)",
+				i, n, off, d[i], is_const ? ", const" : "");
+  return err;
+}
+
+static clib_error_t *
+test_clib_memcpy_x86_64 (clib_error_t *err)
+{
+  u8 src[MAX_LEN + 192];
+  u8 dst[MAX_LEN + 128];
+
+  for (int i = 0; i < ARRAY_LEN (src); i++)
+    src[i] = i & 0x7f;
+
+  for (int j = 0; j < ARRAY_LEN (const_tests); j++)
+    {
+      u8 *d = dst + 64;
+      u8 *s = src + 64;
+      u16 n = const_tests[j].len;
+
+      for (int i = 0; i < 128 + n; i++)
+	dst[i] = 0xfe;
+      const_tests[j].fp (d, s);
+      if ((err = validate_one (err, d, s, n, 0, /* is_const */ 1)))
+	return err;
+    }
+
+  for (u16 n = 1; n <= MAX_LEN; n++)
+    {
+      for (int off = 0; off < 64; off += 7)
+	{
+	  u8 *d = dst + 64 + off;
+	  u8 *s = src + 64;
+
+	  for (int i = 0; i < 128 + n + off; i++)
+	    dst[i] = 0xfe;
+
+	  wrapper (d, s, n);
+
+	  if ((err = validate_one (err, d, s, n, off, /* is_const */ 0)))
+	    return err;
+	}
+    }
+  return err;
+}
+
+REGISTER_TEST (clib_memcpy_x86_64) = {
+  .name = "clib_memcpy_x86_64",
+  .fn = test_clib_memcpy_x86_64,
+};
+#endif
diff --git a/src/vppinfra/test/sha2.c b/src/vppinfra/test/sha2.c
new file mode 100644
index 0000000..9b4abbe
--- /dev/null
+++ b/src/vppinfra/test/sha2.c
@@ -0,0 +1,326 @@
+/* SPDX-License-Identifier: Apache-2.0
+ * Copyright(c) 2021 Cisco Systems, Inc.
+ */
+
+#include <vppinfra/format.h>
+#include <vppinfra/test/test.h>
+#include <vppinfra/sha2.h>
+
+typedef struct
+{
+  const u8 *msg;
+  const u8 *key;
+  int tc;
+  u32 msg_len;
+  u32 key_len;
+  u8 digest_224[28];
+  u8 digest_256[32];
+  u8 digest_384[48];
+  u8 digest_512[64];
+  u8 digest_224_len;
+  u8 digest_256_len;
+  u8 digest_384_len;
+  u8 digest_512_len;
+} sha2_test_t;
+
+#ifndef CLIB_MARCH_VARIANT
+static const u8 key1[20] = { 0x0b, 0x0b, 0x0b, 0x0b, 0x0b, 0x0b, 0x0b,
+			     0x0b, 0x0b, 0x0b, 0x0b, 0x0b, 0x0b, 0x0b,
+			     0x0b, 0x0b, 0x0b, 0x0b, 0x0b, 0x0b };
+static const u8 key2[4] = "Jefe";
+static const u8 key3[20] = { 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa,
+			     0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa,
+			     0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa };
+static const u8 key4[25] = { 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07,
+			     0x08, 0x09, 0x0a, 0x0b, 0x0c, 0x0d, 0x0e,
+			     0x0f, 0x10, 0x11, 0x12, 0x13, 0x14, 0x15,
+			     0x16, 0x17, 0x18, 0x19 };
+static const u8 key5[20] = { 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c,
+			     0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c,
+			     0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c };
+static const u8 key6[131] = {
+  0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa,
+  0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa,
+  0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa,
+  0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa,
+  0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa,
+  0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa,
+  0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa,
+  0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa,
+  0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa,
+  0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa,
+  0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa
+};
+
+static const u8 msg1[8] = "Hi There";
+static const u8 msg2[28] = "what do ya want for nothing?";
+static const u8 msg3[50] = {
+  0xdd, 0xdd, 0xdd, 0xdd, 0xdd, 0xdd, 0xdd, 0xdd, 0xdd, 0xdd, 0xdd, 0xdd, 0xdd,
+  0xdd, 0xdd, 0xdd, 0xdd, 0xdd, 0xdd, 0xdd, 0xdd, 0xdd, 0xdd, 0xdd, 0xdd, 0xdd,
+  0xdd, 0xdd, 0xdd, 0xdd, 0xdd, 0xdd, 0xdd, 0xdd, 0xdd, 0xdd, 0xdd, 0xdd, 0xdd,
+  0xdd, 0xdd, 0xdd, 0xdd, 0xdd, 0xdd, 0xdd, 0xdd, 0xdd, 0xdd, 0xdd
+};
+static const u8 msg4[50] = {
+  0xcd, 0xcd, 0xcd, 0xcd, 0xcd, 0xcd, 0xcd, 0xcd, 0xcd, 0xcd, 0xcd, 0xcd, 0xcd,
+  0xcd, 0xcd, 0xcd, 0xcd, 0xcd, 0xcd, 0xcd, 0xcd, 0xcd, 0xcd, 0xcd, 0xcd, 0xcd,
+  0xcd, 0xcd, 0xcd, 0xcd, 0xcd, 0xcd, 0xcd, 0xcd, 0xcd, 0xcd, 0xcd, 0xcd, 0xcd,
+  0xcd, 0xcd, 0xcd, 0xcd, 0xcd, 0xcd, 0xcd, 0xcd, 0xcd, 0xcd, 0xcd
+};
+static const u8 msg6[54] =
+  "Test Using Larger Than Block-Size Key - Hash Key First";
+static const u8 msg7[153] =
+  "This is a test using a larger than block-size key and a larger than "
+  "block-size data. The key needs to be hashed before being used by the "
+  "HMAC algorithm.";
+
+const sha2_test_t sha2_tests[] = {
+  {
+    /* RFC4231 Test Case 1 */
+    .tc = 1,
+    .key = key1,
+    .key_len = sizeof (key1),
+    .msg = msg1,
+    .msg_len = sizeof (msg1),
+    .digest_224 = { 0x89, 0x6f, 0xb1, 0x12, 0x8a, 0xbb, 0xdf, 0x19, 0x68, 0x32,
+		    0x10, 0x7c, 0xd4, 0x9d, 0xf3, 0x3f, 0x47, 0xb4, 0xb1, 0x16,
+		    0x99, 0x12, 0xba, 0x4f, 0x53, 0x68, 0x4b, 0x22 },
+    .digest_256 = { 0xb0, 0x34, 0x4c, 0x61, 0xd8, 0xdb, 0x38, 0x53,
+		    0x5c, 0xa8, 0xaf, 0xce, 0xaf, 0x0b, 0xf1, 0x2b,
+		    0x88, 0x1d, 0xc2, 0x00, 0xc9, 0x83, 0x3d, 0xa7,
+		    0x26, 0xe9, 0x37, 0x6c, 0x2e, 0x32, 0xcf, 0xf7 },
+    .digest_384 = { 0xaf, 0xd0, 0x39, 0x44, 0xd8, 0x48, 0x95, 0x62, 0x6b, 0x08,
+		    0x25, 0xf4, 0xab, 0x46, 0x90, 0x7f, 0x15, 0xf9, 0xda, 0xdb,
+		    0xe4, 0x10, 0x1e, 0xc6, 0x82, 0xaa, 0x03, 0x4c, 0x7c, 0xeb,
+		    0xc5, 0x9c, 0xfa, 0xea, 0x9e, 0xa9, 0x07, 0x6e, 0xde, 0x7f,
+		    0x4a, 0xf1, 0x52, 0xe8, 0xb2, 0xfa, 0x9c, 0xb6 },
+    .digest_512 = { 0x87, 0xaa, 0x7c, 0xde, 0xa5, 0xef, 0x61, 0x9d, 0x4f, 0xf0,
+		    0xb4, 0x24, 0x1a, 0x1d, 0x6c, 0xb0, 0x23, 0x79, 0xf4, 0xe2,
+		    0xce, 0x4e, 0xc2, 0x78, 0x7a, 0xd0, 0xb3, 0x05, 0x45, 0xe1,
+		    0x7c, 0xde, 0xda, 0xa8, 0x33, 0xb7, 0xd6, 0xb8, 0xa7, 0x02,
+		    0x03, 0x8b, 0x27, 0x4e, 0xae, 0xa3, 0xf4, 0xe4, 0xbe, 0x9d,
+		    0x91, 0x4e, 0xeb, 0x61, 0xf1, 0x70, 0x2e, 0x69, 0x6c, 0x20,
+		    0x3a, 0x12, 0x68, 0x54 },
+  },
+  {
+    /* RFC4231 Test Case 2 */
+    .tc = 2,
+    .key = key2,
+    .key_len = sizeof (key2),
+    .msg = msg2,
+    .msg_len = sizeof (msg2),
+    .digest_224 = { 0xa3, 0x0e, 0x01, 0x09, 0x8b, 0xc6, 0xdb, 0xbf, 0x45, 0x69,
+		    0x0f, 0x3a, 0x7e, 0x9e, 0x6d, 0x0f, 0x8b, 0xbe, 0xa2, 0xa3,
+		    0x9e, 0x61, 0x48, 0x00, 0x8f, 0xd0, 0x5e, 0x44 },
+    .digest_256 = { 0x5b, 0xdc, 0xc1, 0x46, 0xbf, 0x60, 0x75, 0x4e,
+		    0x6a, 0x04, 0x24, 0x26, 0x08, 0x95, 0x75, 0xc7,
+		    0x5a, 0x00, 0x3f, 0x08, 0x9d, 0x27, 0x39, 0x83,
+		    0x9d, 0xec, 0x58, 0xb9, 0x64, 0xec, 0x38, 0x43 },
+    .digest_384 = { 0xaf, 0x45, 0xd2, 0xe3, 0x76, 0x48, 0x40, 0x31, 0x61, 0x7f,
+		    0x78, 0xd2, 0xb5, 0x8a, 0x6b, 0x1b, 0x9c, 0x7e, 0xf4, 0x64,
+		    0xf5, 0xa0, 0x1b, 0x47, 0xe4, 0x2e, 0xc3, 0x73, 0x63, 0x22,
+		    0x44, 0x5e, 0x8e, 0x22, 0x40, 0xca, 0x5e, 0x69, 0xe2, 0xc7,
+		    0x8b, 0x32, 0x39, 0xec, 0xfa, 0xb2, 0x16, 0x49 },
+    .digest_512 = { 0x16, 0x4b, 0x7a, 0x7b, 0xfc, 0xf8, 0x19, 0xe2, 0xe3, 0x95,
+		    0xfb, 0xe7, 0x3b, 0x56, 0xe0, 0xa3, 0x87, 0xbd, 0x64, 0x22,
+		    0x2e, 0x83, 0x1f, 0xd6, 0x10, 0x27, 0x0c, 0xd7, 0xea, 0x25,
+		    0x05, 0x54, 0x97, 0x58, 0xbf, 0x75, 0xc0, 0x5a, 0x99, 0x4a,
+		    0x6d, 0x03, 0x4f, 0x65, 0xf8, 0xf0, 0xe6, 0xfd, 0xca, 0xea,
+		    0xb1, 0xa3, 0x4d, 0x4a, 0x6b, 0x4b, 0x63, 0x6e, 0x07, 0x0a,
+		    0x38, 0xbc, 0xe7, 0x37 },
+  },
+  { /* RFC4231 Test Case 3 */
+    .tc = 3,
+    .key = key3,
+    .key_len = sizeof (key3),
+    .msg = msg3,
+    .msg_len = sizeof (msg3),
+    .digest_224 = { 0x7f, 0xb3, 0xcb, 0x35, 0x88, 0xc6, 0xc1, 0xf6, 0xff, 0xa9,
+		    0x69, 0x4d, 0x7d, 0x6a, 0xd2, 0x64, 0x93, 0x65, 0xb0, 0xc1,
+		    0xf6, 0x5d, 0x69, 0xd1, 0xec, 0x83, 0x33, 0xea },
+    .digest_256 = { 0x77, 0x3e, 0xa9, 0x1e, 0x36, 0x80, 0x0e, 0x46,
+		    0x85, 0x4d, 0xb8, 0xeb, 0xd0, 0x91, 0x81, 0xa7,
+		    0x29, 0x59, 0x09, 0x8b, 0x3e, 0xf8, 0xc1, 0x22,
+		    0xd9, 0x63, 0x55, 0x14, 0xce, 0xd5, 0x65, 0xfe },
+    .digest_384 = { 0x88, 0x06, 0x26, 0x08, 0xd3, 0xe6, 0xad, 0x8a, 0x0a, 0xa2,
+		    0xac, 0xe0, 0x14, 0xc8, 0xa8, 0x6f, 0x0a, 0xa6, 0x35, 0xd9,
+		    0x47, 0xac, 0x9f, 0xeb, 0xe8, 0x3e, 0xf4, 0xe5, 0x59, 0x66,
+		    0x14, 0x4b, 0x2a, 0x5a, 0xb3, 0x9d, 0xc1, 0x38, 0x14, 0xb9,
+		    0x4e, 0x3a, 0xb6, 0xe1, 0x01, 0xa3, 0x4f, 0x27 },
+    .digest_512 = { 0xfa, 0x73, 0xb0, 0x08, 0x9d, 0x56, 0xa2, 0x84, 0xef, 0xb0,
+		    0xf0, 0x75, 0x6c, 0x89, 0x0b, 0xe9, 0xb1, 0xb5, 0xdb, 0xdd,
+		    0x8e, 0xe8, 0x1a, 0x36, 0x55, 0xf8, 0x3e, 0x33, 0xb2, 0x27,
+		    0x9d, 0x39, 0xbf, 0x3e, 0x84, 0x82, 0x79, 0xa7, 0x22, 0xc8,
+		    0x06, 0xb4, 0x85, 0xa4, 0x7e, 0x67, 0xc8, 0x07, 0xb9, 0x46,
+		    0xa3, 0x37, 0xbe, 0xe8, 0x94, 0x26, 0x74, 0x27, 0x88, 0x59,
+		    0xe1, 0x32, 0x92, 0xfb } },
+  {
+    /* RFC4231 Test Case 4 */
+    .tc = 4,
+    .key = key4,
+    .key_len = sizeof (key4),
+    .msg = msg4,
+    .msg_len = sizeof (msg4),
+    .digest_224 = { 0x6c, 0x11, 0x50, 0x68, 0x74, 0x01, 0x3c, 0xac, 0x6a, 0x2a,
+		    0xbc, 0x1b, 0xb3, 0x82, 0x62, 0x7c, 0xec, 0x6a, 0x90, 0xd8,
+		    0x6e, 0xfc, 0x01, 0x2d, 0xe7, 0xaf, 0xec, 0x5a },
+    .digest_256 = { 0x82, 0x55, 0x8a, 0x38, 0x9a, 0x44, 0x3c, 0x0e,
+		    0xa4, 0xcc, 0x81, 0x98, 0x99, 0xf2, 0x08, 0x3a,
+		    0x85, 0xf0, 0xfa, 0xa3, 0xe5, 0x78, 0xf8, 0x07,
+		    0x7a, 0x2e, 0x3f, 0xf4, 0x67, 0x29, 0x66, 0x5b },
+    .digest_384 = { 0x3e, 0x8a, 0x69, 0xb7, 0x78, 0x3c, 0x25, 0x85, 0x19, 0x33,
+		    0xab, 0x62, 0x90, 0xaf, 0x6c, 0xa7, 0x7a, 0x99, 0x81, 0x48,
+		    0x08, 0x50, 0x00, 0x9c, 0xc5, 0x57, 0x7c, 0x6e, 0x1f, 0x57,
+		    0x3b, 0x4e, 0x68, 0x01, 0xdd, 0x23, 0xc4, 0xa7, 0xd6, 0x79,
+		    0xcc, 0xf8, 0xa3, 0x86, 0xc6, 0x74, 0xcf, 0xfb },
+    .digest_512 = { 0xb0, 0xba, 0x46, 0x56, 0x37, 0x45, 0x8c, 0x69, 0x90, 0xe5,
+		    0xa8, 0xc5, 0xf6, 0x1d, 0x4a, 0xf7, 0xe5, 0x76, 0xd9, 0x7f,
+		    0xf9, 0x4b, 0x87, 0x2d, 0xe7, 0x6f, 0x80, 0x50, 0x36, 0x1e,
+		    0xe3, 0xdb, 0xa9, 0x1c, 0xa5, 0xc1, 0x1a, 0xa2, 0x5e, 0xb4,
+		    0xd6, 0x79, 0x27, 0x5c, 0xc5, 0x78, 0x80, 0x63, 0xa5, 0xf1,
+		    0x97, 0x41, 0x12, 0x0c, 0x4f, 0x2d, 0xe2, 0xad, 0xeb, 0xeb,
+		    0x10, 0xa2, 0x98, 0xdd },
+  },
+  {
+    /* RFC4231 Test Case 5 */
+    .tc = 5,
+    .key = key5,
+    .key_len = sizeof (key5),
+    .msg = (u8 *) "Test With Truncation",
+    .msg_len = 20,
+    .digest_224 = { 0x0e, 0x2a, 0xea, 0x68, 0xa9, 0x0c, 0x8d, 0x37, 0xc9, 0x88,
+		    0xbc, 0xdb, 0x9f, 0xca, 0x6f, 0xa8 },
+    .digest_224_len = 16,
+    .digest_256 = { 0xa3, 0xb6, 0x16, 0x74, 0x73, 0x10, 0x0e, 0xe0, 0x6e, 0x0c,
+		    0x79, 0x6c, 0x29, 0x55, 0x55, 0x2b },
+    .digest_256_len = 16,
+    .digest_384 = { 0x3a, 0xbf, 0x34, 0xc3, 0x50, 0x3b, 0x2a, 0x23, 0xa4, 0x6e,
+		    0xfc, 0x61, 0x9b, 0xae, 0xf8, 0x97 },
+    .digest_384_len = 16,
+    .digest_512 = { 0x41, 0x5f, 0xad, 0x62, 0x71, 0x58, 0x0a, 0x53, 0x1d, 0x41,
+		    0x79, 0xbc, 0x89, 0x1d, 0x87, 0xa6 },
+    .digest_512_len = 16,
+  },
+  { /* RFC4231 Test Case 6 */
+    .tc = 6,
+    .key = key6,
+    .key_len = sizeof (key6),
+    .msg = msg6,
+    .msg_len = sizeof (msg6),
+    .digest_224 = { 0x95, 0xe9, 0xa0, 0xdb, 0x96, 0x20, 0x95, 0xad, 0xae, 0xbe,
+		    0x9b, 0x2d, 0x6f, 0x0d, 0xbc, 0xe2, 0xd4, 0x99, 0xf1, 0x12,
+		    0xf2, 0xd2, 0xb7, 0x27, 0x3f, 0xa6, 0x87, 0x0e },
+    .digest_256 = { 0x60, 0xe4, 0x31, 0x59, 0x1e, 0xe0, 0xb6, 0x7f,
+		    0x0d, 0x8a, 0x26, 0xaa, 0xcb, 0xf5, 0xb7, 0x7f,
+		    0x8e, 0x0b, 0xc6, 0x21, 0x37, 0x28, 0xc5, 0x14,
+		    0x05, 0x46, 0x04, 0x0f, 0x0e, 0xe3, 0x7f, 0x54 },
+    .digest_384 = { 0x4e, 0xce, 0x08, 0x44, 0x85, 0x81, 0x3e, 0x90, 0x88, 0xd2,
+		    0xc6, 0x3a, 0x04, 0x1b, 0xc5, 0xb4, 0x4f, 0x9e, 0xf1, 0x01,
+		    0x2a, 0x2b, 0x58, 0x8f, 0x3c, 0xd1, 0x1f, 0x05, 0x03, 0x3a,
+		    0xc4, 0xc6, 0x0c, 0x2e, 0xf6, 0xab, 0x40, 0x30, 0xfe, 0x82,
+		    0x96, 0x24, 0x8d, 0xf1, 0x63, 0xf4, 0x49, 0x52 },
+    .digest_512 = { 0x80, 0xb2, 0x42, 0x63, 0xc7, 0xc1, 0xa3, 0xeb, 0xb7, 0x14,
+		    0x93, 0xc1, 0xdd, 0x7b, 0xe8, 0xb4, 0x9b, 0x46, 0xd1, 0xf4,
+		    0x1b, 0x4a, 0xee, 0xc1, 0x12, 0x1b, 0x01, 0x37, 0x83, 0xf8,
+		    0xf3, 0x52, 0x6b, 0x56, 0xd0, 0x37, 0xe0, 0x5f, 0x25, 0x98,
+		    0xbd, 0x0f, 0xd2, 0x21, 0x5d, 0x6a, 0x1e, 0x52, 0x95, 0xe6,
+		    0x4f, 0x73, 0xf6, 0x3f, 0x0a, 0xec, 0x8b, 0x91, 0x5a, 0x98,
+		    0x5d, 0x78, 0x65, 0x98 } },
+  {
+    /* RFC4231 Test Case 7 */
+    .tc = 7,
+    .key = key6,
+    .key_len = sizeof (key6),
+    .msg = msg7,
+    .msg_len = sizeof (msg7) - 1,
+    .digest_224 = { 0x3a, 0x85, 0x41, 0x66, 0xac, 0x5d, 0x9f, 0x02, 0x3f, 0x54,
+		    0xd5, 0x17, 0xd0, 0xb3, 0x9d, 0xbd, 0x94, 0x67, 0x70, 0xdb,
+		    0x9c, 0x2b, 0x95, 0xc9, 0xf6, 0xf5, 0x65, 0xd1 },
+    .digest_256 = { 0x9b, 0x09, 0xff, 0xa7, 0x1b, 0x94, 0x2f, 0xcb,
+		    0x27, 0x63, 0x5f, 0xbc, 0xd5, 0xb0, 0xe9, 0x44,
+		    0xbf, 0xdc, 0x63, 0x64, 0x4f, 0x07, 0x13, 0x93,
+		    0x8a, 0x7f, 0x51, 0x53, 0x5c, 0x3a, 0x35, 0xe2 },
+    .digest_384 = { 0x66, 0x17, 0x17, 0x8e, 0x94, 0x1f, 0x02, 0x0d, 0x35, 0x1e,
+		    0x2f, 0x25, 0x4e, 0x8f, 0xd3, 0x2c, 0x60, 0x24, 0x20, 0xfe,
+		    0xb0, 0xb8, 0xfb, 0x9a, 0xdc, 0xce, 0xbb, 0x82, 0x46, 0x1e,
+		    0x99, 0xc5, 0xa6, 0x78, 0xcc, 0x31, 0xe7, 0x99, 0x17, 0x6d,
+		    0x38, 0x60, 0xe6, 0x11, 0x0c, 0x46, 0x52, 0x3e },
+    .digest_512 = { 0xe3, 0x7b, 0x6a, 0x77, 0x5d, 0xc8, 0x7d, 0xba, 0xa4, 0xdf,
+		    0xa9, 0xf9, 0x6e, 0x5e, 0x3f, 0xfd, 0xde, 0xbd, 0x71, 0xf8,
+		    0x86, 0x72, 0x89, 0x86, 0x5d, 0xf5, 0xa3, 0x2d, 0x20, 0xcd,
+		    0xc9, 0x44, 0xb6, 0x02, 0x2c, 0xac, 0x3c, 0x49, 0x82, 0xb1,
+		    0x0d, 0x5e, 0xeb, 0x55, 0xc3, 0xe4, 0xde, 0x15, 0x13, 0x46,
+		    0x76, 0xfb, 0x6d, 0xe0, 0x44, 0x60, 0x65, 0xc9, 0x74, 0x40,
+		    0xfa, 0x8c, 0x6a, 0x58 },
+  },
+  {}
+};
+#else
+extern const sha2_test_t sha2_tests[];
+#endif
+
+static clib_error_t *
+check_digest (clib_error_t *err, int tc, u8 *calculated, const u8 *expected,
+	      u8 len)
+{
+  if (memcmp (expected, calculated, len) != 0)
+    err = clib_error_return (err,
+			     "Bad HMAC SHA%u digest for test case "
+			     "%u:\nExpected:\n%U\nCalculated:\n%U\n",
+			     len * 8, tc, format_hexdump, expected, len,
+			     format_hexdump, calculated, len);
+  return err;
+}
+
+#define _(bits)                                                               \
+  static clib_error_t *test_clib_hmac_sha##bits (clib_error_t *err)           \
+  {                                                                           \
+    u8 digest[64];                                                            \
+    const sha2_test_t *t = sha2_tests;                                        \
+                                                                              \
+    while (t->key)                                                            \
+      {                                                                       \
+	u8 digest_len = t->digest_##bits##_len;                               \
+	if (digest_len == 0)                                                  \
+	  digest_len = sizeof (t->digest_##bits);                             \
+	clib_memset_u8 (digest, 0xfe, sizeof (digest));                       \
+	clib_hmac_sha##bits (t->key, t->key_len, t->msg, t->msg_len, digest); \
+	if ((err = check_digest (err, t->tc, digest, t->digest_##bits,        \
+				 digest_len)))                                \
+	  return err;                                                         \
+	t++;                                                                  \
+      }                                                                       \
+                                                                              \
+    return err;                                                               \
+  }                                                                           \
+                                                                              \
+  void __test_perf_fn perftest_sha##bits##_byte (test_perf_t *tp)             \
+  {                                                                           \
+    volatile uword *np = &tp->n_ops;                                          \
+    volatile uword *kl = &tp->arg0;                                           \
+    ;                                                                         \
+    u8 *key = test_mem_alloc_and_fill_inc_u8 (*kl, 32, 0);                    \
+    u8 *data = test_mem_alloc_and_fill_inc_u8 (*np, 0, 0);                    \
+    u8 *digest = test_mem_alloc (64);                                         \
+                                                                              \
+    test_perf_event_enable (tp);                                              \
+    clib_hmac_sha##bits (key, *kl, data, *np, digest);                        \
+    test_perf_event_disable (tp);                                             \
+                                                                              \
+    test_mem_free (key);                                                      \
+    test_mem_free (data);                                                     \
+    test_mem_free (digest);                                                   \
+  }                                                                           \
+  REGISTER_TEST (clib_hmac_sha##bits) = {                                     \
+    .name = "clib_hmac_sha" #bits,                                            \
+    .fn = test_clib_hmac_sha##bits,                                           \
+    .perf_tests = PERF_TESTS ({ .name = "byte",                               \
+				.n_ops = 16384,                               \
+				.arg0 = 20,                                   \
+				.fn = perftest_sha##bits##_byte })            \
+  }
+
+_ (224);
+_ (256);
+_ (384);
+_ (512);
+#undef _
diff --git a/src/vppinfra/test/test.c b/src/vppinfra/test/test.c
new file mode 100644
index 0000000..15ea6fd
--- /dev/null
+++ b/src/vppinfra/test/test.c
@@ -0,0 +1,249 @@
+/* SPDX-License-Identifier: Apache-2.0
+ * Copyright(c) 2021 Cisco Systems, Inc.
+ */
+
+#include <vppinfra/format.h>
+#include <vppinfra/test/test.h>
+#include <vppinfra/error.h>
+
+test_main_t test_main;
+
+int
+test_march_supported (clib_march_variant_type_t type)
+{
+#define _(s, n)                                                               \
+  if (CLIB_MARCH_VARIANT_TYPE_##s == type)                                    \
+    return clib_cpu_march_priority_##s ();
+  foreach_march_variant
+#undef _
+    return 0;
+}
+
+clib_error_t *
+test_funct (test_main_t *tm)
+{
+  for (int i = 0; i < CLIB_MARCH_TYPE_N_VARIANTS; i++)
+    {
+      test_registration_t *r = tm->registrations[i];
+
+      if (r == 0 || test_march_supported (i) < 0)
+	continue;
+
+      fformat (stdout, "\nMultiarch Variant: %U\n", format_march_variant, i);
+      fformat (stdout,
+	       "-------------------------------------------------------\n");
+      while (r)
+	{
+	  clib_error_t *err;
+	  if (tm->filter && strstr (r->name, (char *) tm->filter) == 0)
+	    goto next;
+	  err = (r->fn) (0);
+	  fformat (stdout, "%-50s %s\n", r->name, err ? "FAIL" : "PASS");
+	  if (err)
+	    {
+	      clib_error_report (err);
+	      fformat (stdout, "\n");
+	    }
+	next:
+	  r = r->next;
+	}
+    }
+
+  fformat (stdout, "\n");
+  return 0;
+}
+
+#if 0
+static u8 *
+format_test_perf_bundle_core_power (u8 *s, va_list *args)
+{
+  test_perf_event_bundle_t __clib_unused *b =
+    va_arg (*args, test_perf_event_bundle_t *);
+  test_perf_t __clib_unused *tp = va_arg (*args, test_perf_t *);
+  u64 *data = va_arg (*args, u64 *);
+
+  if (data)
+    s = format (s, "%7.1f %%", (f64) 100 * data[1] / data[0]);
+  else
+    s = format (s, "%9s", "Level 0");
+
+  if (data)
+    s = format (s, "%8.1f %%", (f64) 100 * data[2] / data[0]);
+  else
+    s = format (s, "%9s", "Level 1");
+
+  if (data)
+    s = format (s, "%7.1f %%", (f64) 100 * data[3] / data[0]);
+  else
+    s = format (s, "%9s", "Level 2");
+
+  return s;
+}
+
+#ifdef __x86_64__
+#define PERF_INTEL_CODE(event, umask) ((event) | (umask) << 8)
+  ,
+  {
+    .name = "core-power",
+    .desc =
+      "Core cycles where the core was running under specific turbo schedule.",
+    .type = PERF_TYPE_RAW,
+    .config[0] = PERF_INTEL_CODE (0x3c, 0x00),
+    .config[1] = PERF_INTEL_CODE (0x28, 0x07),
+    .config[2] = PERF_INTEL_CODE (0x28, 0x18),
+    .config[3] = PERF_INTEL_CODE (0x28, 0x20),
+    .config[4] = PERF_INTEL_CODE (0x28, 0x40),
+    .n_events = 5,
+    .format_fn = format_test_perf_bundle_core_power,
+  }
+#endif
+};
+#endif
+
+#ifdef __linux__
+clib_error_t *
+test_perf (test_main_t *tm)
+{
+  clib_error_t *err = 0;
+  clib_perfmon_ctx_t _ctx, *ctx = &_ctx;
+
+  if ((err = clib_perfmon_init_by_bundle_name (
+	 ctx, "%s", tm->bundle ? (char *) tm->bundle : "default")))
+    return err;
+
+  fformat (stdout, "Warming up...\n");
+  clib_perfmon_warmup (ctx);
+
+  for (int i = 0; i < CLIB_MARCH_TYPE_N_VARIANTS; i++)
+    {
+      test_registration_t *r = tm->registrations[i];
+
+      if (r == 0 || test_march_supported (i) < 0)
+	continue;
+
+      fformat (stdout, "\nMultiarch Variant: %U\n", format_march_variant, i);
+      fformat (stdout,
+	       "-------------------------------------------------------\n");
+      while (r)
+	{
+	  if (r->perf_tests)
+	    {
+	      test_perf_t *pt = r->perf_tests;
+	      if (tm->filter && strstr (r->name, (char *) tm->filter) == 0)
+		goto next;
+
+	      clib_perfmon_capture_group (ctx, "%s", r->name);
+	      do
+		{
+		  for (int i = 0; i < tm->repeat; i++)
+		    {
+		      pt->fd = ctx->group_fd;
+		      clib_perfmon_reset (ctx);
+		      pt->fn (pt);
+		      clib_perfmon_capture (ctx, pt->n_ops, "%0s", pt->name);
+		    }
+		}
+	      while ((++pt)->fn);
+	    }
+	next:
+	  r = r->next;
+	}
+      fformat (stdout, "%U\n", format_perfmon_bundle, ctx);
+      clib_perfmon_clear (ctx);
+    }
+
+  clib_perfmon_free (ctx);
+  return err;
+}
+#endif
+
+int
+main (int argc, char *argv[])
+{
+  test_main_t *tm = &test_main;
+  unformat_input_t _i = {}, *i = &_i;
+  clib_mem_init (0, 64ULL << 20);
+  clib_error_t *err;
+  int perf = 0;
+
+  /* defaults */
+  tm->repeat = 3;
+
+  unformat_init_command_line (i, argv);
+
+  while (unformat_check_input (i) != UNFORMAT_END_OF_INPUT)
+    {
+      if (unformat (i, "perf"))
+	perf = 1;
+      else if (unformat (i, "filter %s", &tm->filter))
+	;
+      else if (unformat (i, "bundle %s", &tm->bundle))
+	;
+      else if (unformat (i, "repeat %d", &tm->repeat))
+	;
+      else
+	{
+	  clib_warning ("unknown input '%U'", format_unformat_error, i);
+	  exit (1);
+	}
+    }
+
+  if (perf)
+    err = test_perf (tm);
+  else
+    err = test_funct (tm);
+
+  if (err)
+    {
+      clib_error_report (err);
+      fformat (stderr, "\n");
+      return 1;
+    }
+  return 0;
+}
+
+void *
+test_mem_alloc (uword size)
+{
+  void *rv;
+  size = round_pow2 (size, CLIB_CACHE_LINE_BYTES);
+  rv = clib_mem_alloc_aligned (size, CLIB_CACHE_LINE_BYTES);
+  clib_memset_u8 (rv, 0, size);
+  return rv;
+}
+
+void *
+test_mem_alloc_and_fill_inc_u8 (uword size, u8 start, u8 mask)
+{
+  u8 *rv;
+  mask = mask ? mask : 0xff;
+  size = round_pow2 (size, CLIB_CACHE_LINE_BYTES);
+  rv = clib_mem_alloc_aligned (size, CLIB_CACHE_LINE_BYTES);
+  for (uword i = 0; i < size; i++)
+    rv[i] = ((u8) i + start) & mask;
+  return rv;
+}
+
+void *
+test_mem_alloc_and_splat (uword elt_size, uword n_elts, void *elt)
+{
+  u8 *rv, *e;
+  uword data_size = elt_size * n_elts;
+  uword alloc_size = round_pow2 (data_size, CLIB_CACHE_LINE_BYTES);
+  e = rv = clib_mem_alloc_aligned (alloc_size, CLIB_CACHE_LINE_BYTES);
+  while (e - rv < data_size)
+    {
+      clib_memcpy_fast (e, elt, elt_size);
+      e += elt_size;
+    }
+
+  if (data_size < alloc_size)
+    clib_memset_u8 (e, 0, alloc_size - data_size);
+  return rv;
+}
+
+void
+test_mem_free (void *p)
+{
+  clib_mem_free (p);
+}
diff --git a/src/vppinfra/test/test.h b/src/vppinfra/test/test.h
new file mode 100644
index 0000000..7d54d80
--- /dev/null
+++ b/src/vppinfra/test/test.h
@@ -0,0 +1,107 @@
+/* SPDX-License-Identifier: Apache-2.0
+ * Copyright(c) 2021 Cisco Systems, Inc.
+ */
+
+#ifndef included_test_test_h
+#define included_test_test_h
+
+#include <vppinfra/cpu.h>
+#include <vppinfra/perfmon/perfmon.h>
+#ifdef __linux__
+#include <sys/ioctl.h>
+#include <linux/perf_event.h>
+#endif
+
+typedef clib_error_t *(test_fn_t) (clib_error_t *);
+
+struct test_perf_;
+typedef void (test_perf_fn_t) (struct test_perf_ *tp);
+
+typedef struct test_perf_
+{
+  int fd;
+  u64 n_ops;
+  union
+  {
+    u64 arg0;
+    void *ptr0;
+  };
+  union
+  {
+    u64 arg1;
+    void *ptr1;
+  };
+  union
+  {
+    u64 arg2;
+    void *ptr2;
+  };
+  char *name;
+  test_perf_fn_t *fn;
+} test_perf_t;
+
+typedef struct test_registration_
+{
+  char *name;
+  u8 multiarch : 1;
+  test_fn_t *fn;
+  test_perf_t *perf_tests;
+  u32 n_perf_tests;
+  struct test_registration_ *next;
+} test_registration_t;
+
+typedef struct
+{
+  test_registration_t *registrations[CLIB_MARCH_TYPE_N_VARIANTS];
+  u32 repeat;
+  u8 *filter;
+  u8 *bundle;
+  f64 ref_clock;
+} test_main_t;
+extern test_main_t test_main;
+
+#define __test_funct_fn                                                       \
+  static __clib_noinline __clib_noclone __clib_section (".test_func")
+#define __test_perf_fn                                                        \
+  static __clib_noinline __clib_noclone __clib_section (".test_perf")
+
+#define REGISTER_TEST(x)                                                      \
+  test_registration_t CLIB_MARCH_SFX (__test_##x);                            \
+  static void __clib_constructor CLIB_MARCH_SFX (__test_registration_##x) (   \
+    void)                                                                     \
+  {                                                                           \
+    test_registration_t *r = &CLIB_MARCH_SFX (__test_##x);                    \
+    r->next =                                                                 \
+      test_main.registrations[CLIB_MARCH_SFX (CLIB_MARCH_VARIANT_TYPE)];      \
+    test_main.registrations[CLIB_MARCH_SFX (CLIB_MARCH_VARIANT_TYPE)] = r;    \
+  }                                                                           \
+  test_registration_t CLIB_MARCH_SFX (__test_##x)
+
+#define PERF_TESTS(...)                                                       \
+  (test_perf_t[])                                                             \
+  {                                                                           \
+    __VA_ARGS__, {}                                                           \
+  }
+
+static_always_inline void
+test_perf_event_reset (test_perf_t *t)
+{
+  clib_perfmon_ioctl (t->fd, PERF_EVENT_IOC_RESET);
+}
+static_always_inline void
+test_perf_event_enable (test_perf_t *t)
+{
+  clib_perfmon_ioctl (t->fd, PERF_EVENT_IOC_ENABLE);
+}
+static_always_inline void
+test_perf_event_disable (test_perf_t *t)
+{
+  clib_perfmon_ioctl (t->fd, PERF_EVENT_IOC_DISABLE);
+}
+
+void *test_mem_alloc (uword size);
+void *test_mem_alloc_and_fill_inc_u8 (uword size, u8 start, u8 mask);
+void *test_mem_alloc_and_splat (uword elt_size, uword n_elts, void *elt);
+void test_mem_free (void *p);
+
+#endif
diff --git a/src/vppinfra/test/toeplitz.c b/src/vppinfra/test/toeplitz.c
new file mode 100644
index 0000000..c1bd13f
--- /dev/null
+++ b/src/vppinfra/test/toeplitz.c
@@ -0,0 +1,553 @@
+/* SPDX-License-Identifier: Apache-2.0
+ * Copyright(c) 2021 Cisco Systems, Inc.
+ */
+
+#include <vppinfra/format.h>
+#include <vppinfra/test/test.h>
+#include <vppinfra/vector/toeplitz.h>
+
+/* secret key and test cases taken from:
+ * https://docs.microsoft.com/en-us/windows-hardware/drivers/network/verifying-the-rss-hash-calculation
+ */
+
+typedef struct
+{
+  u32 sip, dip;
+  u16 sport, dport;
+} __clib_packed ip4_key_t;
+
+typedef struct
+{
+  ip4_key_t key;
+  u32 hash_2t, hash_4t;
+} ip4_test_t;
+
+typedef struct
+{
+  u16 sip[8], dip[8];
+  u16 sport, dport;
+} __clib_packed ip6_key_t;
+
+typedef struct
+{
+  ip6_key_t key;
+  u32 hash_2t, hash_4t;
+} ip6_test_t;
+
+#define N_IP4_TESTS    5
+#define N_IP6_TESTS    3
+#define N_LENGTH_TESTS 240
+
+#ifndef CLIB_MARCH_VARIANT
+#define _IP4(a, b, c, d) ((d) << 24 | (c) << 16 | (b) << 8 | (a))
+#define _IP6(a, b, c, d, e, f, g, h)                                          \
+  {                                                                           \
+    (u16) ((a) << 8) | (u8) ((a) >> 8), (u16) ((b) << 8) | (u8) ((b) >> 8),   \
+      (u16) ((c) << 8) | (u8) ((c) >> 8), (u16) ((d) << 8) | (u8) ((d) >> 8), \
+      (u16) ((e) << 8) | (u8) ((e) >> 8), (u16) ((f) << 8) | (u8) ((f) >> 8), \
+      (u16) ((g) << 8) | (u8) ((g) >> 8), (u16) ((h) << 8) | (u8) ((h) >> 8), \
+  }
+#define _PORT(a) ((a) >> 8 | (((a) &0xff) << 8))
+
+const ip4_test_t ip4_tests[N_IP4_TESTS] = {
+  /* ipv4 tests */
+  {
+    .key.sip = _IP4 (66, 9, 149, 187),
+    .key.dip = _IP4 (161, 142, 100, 80),
+    .key.sport = _PORT (2794),
+    .key.dport = _PORT (1766),
+    .hash_2t = 0x323e8fc2,
+    .hash_4t = 0x51ccc178,
+  },
+  {
+    .key.sip = _IP4 (199, 92, 111, 2),
+    .key.dip = _IP4 (65, 69, 140, 83),
+    .key.sport = _PORT (14230),
+    .key.dport = _PORT (4739),
+    .hash_2t = 0xd718262a,
+    .hash_4t = 0xc626b0ea,
+  },
+  {
+    .key.sip = _IP4 (24, 19, 198, 95),
+    .key.dip = _IP4 (12, 22, 207, 184),
+    .key.sport = _PORT (12898),
+    .key.dport = _PORT (38024),
+    .hash_2t = 0xd2d0a5de,
+    .hash_4t = 0x5c2b394a,
+  },
+  {
+    .key.sip = _IP4 (38, 27, 205, 30),
+    .key.dip = _IP4 (209, 142, 163, 6),
+    .key.sport = _PORT (48228),
+    .key.dport = _PORT (2217),
+    .hash_2t = 0x82989176,
+    .hash_4t = 0xafc7327f,
+  },
+  {
+    .key.sip = _IP4 (153, 39, 163, 191),
+    .key.dip = _IP4 (202, 188, 127, 2),
+    .key.sport = _PORT (44251),
+    .key.dport = _PORT (1303),
+    .hash_2t = 0x5d1809c5,
+    .hash_4t = 0x10e828a2,
+  }
+};
+
+const ip6_test_t ip6_tests[N_IP6_TESTS] = {
+  {
+    .key.sip = _IP6 (0x3ffe, 0x2501, 0x200, 0x1fff, 0, 0, 0, 7),
+    .key.dip = _IP6 (0x3ffe, 0x2501, 0x200, 3, 0, 0, 0, 1),
+    .key.sport = _PORT (2794),
+    .key.dport = _PORT (1766),
+    .hash_2t = 0x2cc18cd5,
+    .hash_4t = 0x40207d3d,
+  },
+  {
+    .key.sip = _IP6 (0x3ffe, 0x501, 8, 0, 0x260, 0x97ff, 0xfe40, 0xefab),
+    .key.dip = _IP6 (0xff02, 0, 0, 0, 0, 0, 0, 1),
+    .key.sport = _PORT (14230),
+    .key.dport = _PORT (4739),
+    .hash_2t = 0x0f0c461c,
+    .hash_4t = 0xdde51bbf,
+  },
+  {
+    .key.sip = _IP6 (0x3ffe, 0x1900, 0x4545, 3, 0x200, 0xf8ff, 0xfe21, 0x67cf),
+    .key.dip = _IP6 (0xfe80, 0, 0, 0, 0x200, 0xf8ff, 0xfe21, 0x67cf),
+    .key.sport = _PORT (44251),
+    .key.dport = _PORT (38024),
+    .hash_2t = 0x4b61e985,
+    .hash_4t = 0x02d1feef,
+  }
+};
+
+const u32 length_test_hashes[N_LENGTH_TESTS] = {
+  0x00000000, 0x00000000, 0x2b6d12ad, 0x9de4446e, 0x061f00bf, 0xad7ed8f7,
+  0x4bc7b068, 0x231fc545, 0xdbd97a33, 0xcdab29e7, 0x2d665c0c, 0x31e28ed7,
+  0x14e19218, 0x5aa89f0f, 0xd47de07f, 0x355ec712, 0x7e1cbfc0, 0xf84de19d,
+  0xbcf66bd3, 0x104086c6, 0x71900b34, 0xcd2f9819, 0xeae68ebb, 0x54d63b4c,
+  0x5f865a2c, 0x9d6ded08, 0xe00b0912, 0x3fcf07a6, 0x3bd9ca93, 0x3f4f3bbb,
+  0xd0b82624, 0xa28a08e1, 0xa585969f, 0x0c8f4a71, 0x5dce7bdd, 0x4fcf2a6d,
+  0x91c89ae9, 0xbef8a24d, 0x8e3d30fe, 0xc8027848, 0xc1e7e513, 0xa12bd3d9,
+  0x46700bb4, 0xc6339dab, 0x970805ad, 0xfcb50ac8, 0xc6db4f44, 0x792e2987,
+  0xacfb7836, 0xa25ec529, 0x957d7beb, 0x6732809a, 0x891836ed, 0xeefb83b2,
+  0xca96b40b, 0x93fd5abd, 0x9076f922, 0x59adb4eb, 0x9705aafb, 0x282719b1,
+  0xdda9cb8a, 0x3f499131, 0x47491130, 0x30ef0759, 0xad1cf855, 0x428aa312,
+  0x4200240a, 0x71a72857, 0x16b30c36, 0x10cca9a3, 0x166f091e, 0x30e00560,
+  0x8acd20ba, 0xfa633d76, 0x0fe32eb7, 0xdcc0122f, 0x20aa8ab0, 0x62b2a9af,
+  0x7a6c80a6, 0x27e87268, 0x95b797a8, 0x25d18ccd, 0x68a7fb00, 0xc54bcdad,
+  0x3bd0e717, 0xf0df54c9, 0x780daadf, 0x7b435605, 0x150c1e10, 0x8a892e54,
+  0x9d27cb25, 0xe23383a5, 0x57aac408, 0x83b8abf8, 0x560f33af, 0xd5cb3307,
+  0x79ae8edc, 0x9b127665, 0x320f18bd, 0x385d636b, 0xbd1b2dbf, 0x97679888,
+  0x738894a4, 0xeba2afb0, 0xfa7c2d50, 0xb6741aa1, 0x28922bba, 0x7783242b,
+  0xa694cca2, 0xa32781c0, 0x696cd670, 0xa714d72f, 0xea34d35a, 0xc5aed81e,
+  0x0438433a, 0xc1939ab2, 0xb51c123a, 0x121426b9, 0x1add93ba, 0x50c56b6a,
+  0x7e90902a, 0xae3abd85, 0x2f7a0088, 0xb45cf6f9, 0x80070094, 0x8bd46467,
+  0xdfd1b762, 0x0bb25856, 0x48eefe84, 0x0989dbb9, 0xfc32472b, 0x965fec6b,
+  0x5a256bd0, 0x6df7127a, 0x7856d0d6, 0xedc82bd3, 0x1b563b96, 0xc73eace7,
+  0xba4c0a93, 0xdfd6dd97, 0x923c41db, 0x14926ca6, 0x22e52ab1, 0x22852a66,
+  0x79606b9c, 0xb0f22b23, 0xb46354ba, 0x9c3cd931, 0x03a92bd6, 0x84000834,
+  0x5425df65, 0xf4dd3fc9, 0x391cc873, 0xa560b52e, 0x828037d9, 0x31323dd5,
+  0x5c6e3147, 0x28e21f85, 0xa431eb51, 0xf468c4a3, 0x9bea1d2e, 0x43d9109c,
+  0x5bb9b081, 0xe0825675, 0xc9c92591, 0xd29fc812, 0x03136bc9, 0x5e005a1f,
+  0x6d821ed8, 0x3f0bfcc4, 0x24774162, 0x893bde94, 0x6475efea, 0x6711538e,
+  0xc4755f6d, 0x9425ebe2, 0xacf471b4, 0xb947ab0c, 0x1f78c455, 0x372b3ed7,
+  0xb3ec24d7, 0x18c4459f, 0xa8ff3695, 0xe4aa2b85, 0x8a52ad7e, 0xe05e8177,
+  0x7aa348ed, 0x3e4ac6aa, 0x17dcf8a5, 0x93b933b0, 0x8f7413ec, 0xc77bfe61,
+  0xfdb72874, 0x4370f138, 0xdf3462ad, 0xc8970a59, 0xb4a9fed8, 0xa2ddc39b,
+  0xd61db62a, 0x95c5fc1b, 0x7b22e6e0, 0x1969702c, 0x7992aebb, 0x59d7c225,
+  0x0e16db0b, 0x9f2afc21, 0x246cf66b, 0xb3d6569d, 0x29c532d7, 0xe155747a,
+  0xe38d7872, 0xea704969, 0xb69095b0, 0x1b198efd, 0x55daab76, 0xa2a377b6,
+  0xb31aa2fa, 0x48b73c41, 0xf0cc501a, 0x9c9ca831, 0x1b591b99, 0xb2d8d22f,
+  0xab4b5f69, 0x4fe00e71, 0xdf5480bd, 0x982540d7, 0x7f34ea4f, 0xd7be66e1,
+  0x9d2ab1ba, 0x1ba62e12, 0xee3fb36c, 0xf28d7c5a, 0x756311eb, 0xc68567f2,
+  0x7b6ea177, 0xc398d9f3
+};
+
+#else
+extern const ip4_test_t ip4_tests[N_IP4_TESTS];
+extern const ip6_test_t ip6_tests[N_IP6_TESTS];
+extern const u32 length_test_hashes[N_LENGTH_TESTS];
+#endif
+
+__test_funct_fn u32
+wrapper (clib_toeplitz_hash_key_t *k, u8 *data, u32 n_bytes)
+{
+  return clib_toeplitz_hash (k, data, n_bytes);
+}
+
+__test_funct_fn void
+wrapper_x4 (clib_toeplitz_hash_key_t *k, u8 *d0, u8 *d1, u8 *d2, u8 *d3,
+	    u32 *h0, u32 *h1, u32 *h2, u32 *h3, u32 n_bytes)
+{
+  clib_toeplitz_hash_x4 (k, d0, d1, d2, d3, h0, h1, h2, h3, n_bytes);
+}
+
+static clib_error_t *
+test_clib_toeplitz_hash (clib_error_t *err)
+{
+  u32 r;
+  int n_key_copies, bigkey_len, bigdata_len;
+  u8 *bigkey, *bigdata;
+  clib_toeplitz_hash_key_t *k;
+
+  k = clib_toeplitz_hash_key_init (0, 0);
+
+  for (int i = 0; i < N_IP4_TESTS; i++)
+    {
+      r = wrapper (k, (u8 *) &ip4_tests[i].key, 8);
+      if (ip4_tests[i].hash_2t != r)
+	return clib_error_return (err,
+				  "wrong IPv4 2 tuple hash for test %u, "
+				  "calculated 0x%08x expected 0x%08x",
+				  i, ip4_tests[i].hash_2t, r);
+
+      r = wrapper (k, (u8 *) &ip4_tests[i].key, 12);
+      if (ip4_tests[i].hash_4t != r)
+	return clib_error_return (err,
+				  "wrong IPv4 4 tuple hash for test %u, "
+				  "calculated 0x%08x expected 0x%08x",
+				  i, ip4_tests[i].hash_4t, r);
+    }
+
+  for (int i = 0; i < N_IP6_TESTS; i++)
+    {
+      r = wrapper (k, (u8 *) &ip6_tests[i].key, 32);
+      if (ip6_tests[i].hash_2t != r)
+	return clib_error_return (err,
+				  "wrong IPv6 2 tuple hash for test %u, "
+				  "calculated 0x%08x expected 0x%08x",
+				  i, ip6_tests[i].hash_2t, r);
+
+      r = wrapper (k, (u8 *) &ip6_tests[i].key, 36);
+      if (ip6_tests[i].hash_4t != r)
+	return clib_error_return (err,
+				  "wrong IPv6 4 tuple hash for test %u, "
+				  "calculated 0x%08x expected 0x%08x",
+				  i, ip6_tests[i].hash_4t, r);
+    }
+
+  n_key_copies = 6;
+  bigkey_len = k->key_length * n_key_copies;
+  bigdata_len = bigkey_len - 4;
+  bigkey = test_mem_alloc_and_splat (k->key_length, n_key_copies, k->data);
+  bigdata = test_mem_alloc_and_fill_inc_u8 (bigdata_len, 0, 0);
+  u32 key_len = k->key_length;
+
+  clib_toeplitz_hash_key_free (k);
+  k = clib_toeplitz_hash_key_init (bigkey, n_key_copies * key_len);
+
+  for (int i = 0; i < N_LENGTH_TESTS - 4; i++)
+    {
+      r = wrapper (k, bigdata, i);
+      if (length_test_hashes[i] != r)
+	{
+	  err = clib_error_return (err,
+				   "wrong length test hash for length %u, "
+				   "calculated 0x%08x expected 0x%08x "
+				   "xor 0x%08x",
+				   i, r, length_test_hashes[i],
+				   r ^ length_test_hashes[i]);
+	  goto done;
+	}
+    }
+
+done:
+  clib_toeplitz_hash_key_free (k);
+  test_mem_free (bigkey);
+  test_mem_free (bigdata);
+  return err;
+}
+
+void __test_perf_fn
+perftest_fixed_12byte (test_perf_t *tp)
+{
+  u32 n = tp->n_ops;
+  u8 *data = test_mem_alloc_and_splat (12, n, (void *) &ip4_tests[0].key);
+  u8 *res = test_mem_alloc (4 * n);
+  clib_toeplitz_hash_key_t *k = clib_toeplitz_hash_key_init (0, 0);
+
+  test_perf_event_enable (tp);
+  for (int i = 0; i < n; i++)
+    ((u32 *) res)[i] = clib_toeplitz_hash (k, data + i * 12, 12);
+  test_perf_event_disable (tp);
+
+  clib_toeplitz_hash_key_free (k);
+  test_mem_free (data);
+  test_mem_free (res);
+}
+
+void __test_perf_fn
+perftest_fixed_36byte (test_perf_t *tp)
+{
+  u32 n = tp->n_ops;
+  u8 *data = test_mem_alloc_and_splat (36, n, (void *) &ip6_tests[0].key);
+  u8 *res = test_mem_alloc (4 * n);
+  clib_toeplitz_hash_key_t *k = clib_toeplitz_hash_key_init (0, 0);
+
+  test_perf_event_enable (tp);
+  for (int i = 0; i < n; i++)
+    ((u32 *) res)[i] = clib_toeplitz_hash (k, data + i * 36, 36);
+  test_perf_event_disable (tp);
+
+  clib_toeplitz_hash_key_free (k);
+  test_mem_free (data);
+  test_mem_free (res);
+}
+
+void __test_perf_fn
+perftest_variable_size (test_perf_t *tp)
+{
+  u32 key_len, n_keys, n = tp->n_ops;
+  u8 *key, *data = test_mem_alloc (n);
+  u32 *res = test_mem_alloc (sizeof (u32));
+  clib_toeplitz_hash_key_t *k = clib_toeplitz_hash_key_init (0, 0);
+
+  k = clib_toeplitz_hash_key_init (0, 0);
+  key_len = k->key_length;
+  n_keys = ((n + 4) / k->key_length) + 1;
+  key = test_mem_alloc_and_splat (n_keys, key_len, k->data);
+  clib_toeplitz_hash_key_free (k);
+  k = clib_toeplitz_hash_key_init (key, key_len * n_keys);
+
+  test_perf_event_enable (tp);
+  res[0] = clib_toeplitz_hash (k, data, n);
+  test_perf_event_disable (tp);
+
+  clib_toeplitz_hash_key_free (k);
+  test_mem_free (data);
+  test_mem_free (res);
+  test_mem_free (key);
+}
+
+REGISTER_TEST (clib_toeplitz_hash) = {
+  .name = "clib_toeplitz_hash",
+  .fn = test_clib_toeplitz_hash,
+  .perf_tests = PERF_TESTS ({ .name = "fixed (per 12 byte tuple)",
+			      .n_ops = 1024,
+			      .fn = perftest_fixed_12byte },
+			    { .name = "fixed (per 36 byte tuple)",
+			      .n_ops = 1024,
+			      .fn = perftest_fixed_36byte },
+			    { .name = "variable size (per byte)",
+			      .n_ops = 16384,
+			      .fn = perftest_variable_size }),
+};
+
+static clib_error_t *
+test_clib_toeplitz_hash_x4 (clib_error_t *err)
+{
+  u32 r[4];
+  int n_key_copies, bigkey_len, bigdata_len;
+  u8 *bigkey, *bigdata0, *bigdata1, *bigdata2, *bigdata3;
+  clib_toeplitz_hash_key_t *k;
+
+  k = clib_toeplitz_hash_key_init (0, 0);
+
+  wrapper_x4 (k, (u8 *) &ip4_tests[0].key, (u8 *) &ip4_tests[1].key,
+	      (u8 *) &ip4_tests[2].key, (u8 *) &ip4_tests[3].key, r, r + 1,
+	      r + 2, r + 3, 8);
+
+  if (ip4_tests[0].hash_2t != r[0] || ip4_tests[1].hash_2t != r[1] ||
+      ip4_tests[2].hash_2t != r[2] || ip4_tests[3].hash_2t != r[3])
+    return clib_error_return (err,
+			      "wrong IPv4 2 tuple x4 hash "
+			      "calculated { 0x%08x, 0x%08x, 0x%08x, 0x%08x } "
+			      "expected { 0x%08x, 0x%08x, 0x%08x, 0x%08x }",
+			      ip4_tests[0].hash_2t, ip4_tests[1].hash_2t,
+			      ip4_tests[2].hash_2t, ip4_tests[3].hash_2t, r[0],
+			      r[1], r[2], r[3]);
+
+  wrapper_x4 (k, (u8 *) &ip4_tests[0].key, (u8 *) &ip4_tests[1].key,
+	      (u8 *) &ip4_tests[2].key, (u8 *) &ip4_tests[3].key, r, r + 1,
+	      r + 2, r + 3, 12);
+
+  if (ip4_tests[0].hash_4t != r[0] || ip4_tests[1].hash_4t != r[1] ||
+      ip4_tests[2].hash_4t != r[2] || ip4_tests[3].hash_4t != r[3])
+    return clib_error_return (err,
+			      "wrong IPv4 4 tuple x4 hash "
+			      "calculated { 0x%08x, 0x%08x, 0x%08x, 0x%08x } "
+			      "expected { 0x%08x, 0x%08x, 0x%08x, 0x%08x }",
+			      ip4_tests[0].hash_4t, ip4_tests[1].hash_4t,
+			      ip4_tests[2].hash_4t, ip4_tests[3].hash_4t, r[0],
+			      r[1], r[2], r[3]);
+
+  wrapper_x4 (k, (u8 *) &ip6_tests[0].key, (u8 *) &ip6_tests[1].key,
+	      (u8 *) &ip6_tests[2].key, (u8 *) &ip6_tests[0].key, r, r + 1,
+	      r + 2, r + 3, 32);
+
+  if (ip6_tests[0].hash_2t != r[0] || ip6_tests[1].hash_2t != r[1] ||
+      ip6_tests[2].hash_2t != r[2] || ip6_tests[0].hash_2t != r[3])
+    return clib_error_return (err,
+			      "wrong IPv6 2 tuple x4 hash "
+			      "calculated { 0x%08x, 0x%08x, 0x%08x, 0x%08x } "
+			      "expected { 0x%08x, 0x%08x, 0x%08x, 0x%08x }",
+			      ip6_tests[0].hash_2t, ip6_tests[1].hash_2t,
+			      ip6_tests[2].hash_2t, ip6_tests[0].hash_2t, r[0],
+			      r[1], r[2], r[3]);
+
+  wrapper_x4 (k, (u8 *) &ip6_tests[0].key, (u8 *) &ip6_tests[1].key,
+	      (u8 *) &ip6_tests[2].key, (u8 *) &ip6_tests[0].key, r, r + 1,
+	      r + 2, r + 3, 36);
+
+  if (ip6_tests[0].hash_4t != r[0] || ip6_tests[1].hash_4t != r[1] ||
+      ip6_tests[2].hash_4t != r[2] || ip6_tests[0].hash_4t != r[3])
+    return clib_error_return (err,
+			      "wrong IPv6 4 tuple x4 hash "
+			      "calculated { 0x%08x, 0x%08x, 0x%08x, 0x%08x } "
+			      "expected { 0x%08x, 0x%08x, 0x%08x, 0x%08x }",
+			      ip6_tests[0].hash_4t, ip6_tests[1].hash_4t,
+			      ip6_tests[2].hash_4t, ip6_tests[0].hash_4t, r[0],
+			      r[1], r[2], r[3]);
+
+  n_key_copies = 6;
+  bigkey_len = k->key_length * n_key_copies;
+  bigdata_len = bigkey_len - 4;
+  bigkey = test_mem_alloc_and_splat (k->key_length, n_key_copies, k->data);
+  bigdata0 = test_mem_alloc_and_fill_inc_u8 (bigdata_len, 0, 0);
+  bigdata1 = test_mem_alloc_and_fill_inc_u8 (bigdata_len, 0, 0);
+  bigdata2 = test_mem_alloc_and_fill_inc_u8 (bigdata_len, 0, 0);
+  bigdata3 = test_mem_alloc_and_fill_inc_u8 (bigdata_len, 0, 0);
+  u32 key_len = k->key_length;
+
+  clib_toeplitz_hash_key_free (k);
+  k = clib_toeplitz_hash_key_init (bigkey, n_key_copies * key_len);
+
+  for (int i = 0; i < N_LENGTH_TESTS - 4; i++)
+    {
+      wrapper_x4 (k, bigdata0, bigdata1, bigdata2, bigdata3, r, r + 1, r + 2,
+		  r + 3, i);
+      if (length_test_hashes[i] != r[0] || length_test_hashes[i] != r[1] ||
+	  length_test_hashes[i] != r[2] || length_test_hashes[i] != r[3])
+	{
+	  err = clib_error_return (
+	    err,
+	    "wrong length test hash x4 for length %u, "
+	    "calculated { 0x%08x, 0x%08x, 0x%08x, 0x%08x }, expected 0x%08x",
+	    i, r[0], r[1], r[2], r[3], length_test_hashes[i]);
+	  goto done;
+	}
+    }
+
+done:
+  clib_toeplitz_hash_key_free (k);
+  test_mem_free (bigkey);
+  test_mem_free (bigdata0);
+  test_mem_free (bigdata1);
+  test_mem_free (bigdata2);
+  test_mem_free (bigdata3);
+  return err;
+}
+
+void __test_perf_fn
+perftest_fixed_12byte_x4 (test_perf_t *tp)
+{
+  u32 n = tp->n_ops / 4;
+  u8 *d0 = test_mem_alloc_and_splat (12, n, (void *) &ip4_tests[0].key);
+  u8 *d1 = test_mem_alloc_and_splat (12, n, (void *) &ip4_tests[1].key);
+  u8 *d2 = test_mem_alloc_and_splat (12, n, (void *) &ip4_tests[2].key);
+  u8 *d3 = test_mem_alloc_and_splat (12, n, (void *) &ip4_tests[3].key);
+  u32 *h0 = test_mem_alloc (4 * n);
+  u32 *h1 = test_mem_alloc (4 * n);
+  u32 *h2 = test_mem_alloc (4 * n);
+  u32 *h3 = test_mem_alloc (4 * n);
+  clib_toeplitz_hash_key_t *k = clib_toeplitz_hash_key_init (0, 0);
+
+  test_perf_event_enable (tp);
+  for (int i = 0; i < n; i++)
+    clib_toeplitz_hash_x4 (k, d0 + i * 12, d1 + i * 12, d2 + i * 12,
+			   d3 + i * 12, h0 + i, h1 + i, h2 + i, h3 + i, 12);
+  test_perf_event_disable (tp);
+
+  clib_toeplitz_hash_key_free (k);
+  test_mem_free (d0);
+  test_mem_free (d1);
+  test_mem_free (d2);
+  test_mem_free (d3);
+  test_mem_free (h0);
+  test_mem_free (h1);
+  test_mem_free (h2);
+  test_mem_free (h3);
+}
+
+void __test_perf_fn
+perftest_fixed_36byte_x4 (test_perf_t *tp)
+{
+  u32 n = tp->n_ops / 4;
+  u8 *d0 = test_mem_alloc_and_splat (36, n, (void *) &ip4_tests[0].key);
+  u8 *d1 = test_mem_alloc_and_splat (36, n, (void *) &ip4_tests[1].key);
+  u8 *d2 = test_mem_alloc_and_splat (36, n, (void *) &ip4_tests[2].key);
+  u8 *d3 = test_mem_alloc_and_splat (36, n, (void *) &ip4_tests[3].key);
+  u32 *h0 = test_mem_alloc (4 * n);
+  u32 *h1 = test_mem_alloc (4 * n);
+  u32 *h2 = test_mem_alloc (4 * n);
+  u32 *h3 = test_mem_alloc (4 * n);
+  clib_toeplitz_hash_key_t *k = clib_toeplitz_hash_key_init (0, 0);
+
+  test_perf_event_enable (tp);
+  for (int i = 0; i < n; i++)
+    clib_toeplitz_hash_x4 (k, d0 + i * 36, d1 + i * 36, d2 + i * 36,
+			   d3 + i * 36, h0 + i, h1 + i, h2 + i, h3 + i, 36);
+  test_perf_event_disable (tp);
+
+  clib_toeplitz_hash_key_free (k);
+  test_mem_free (d0);
+  test_mem_free (d1);
+  test_mem_free (d2);
+  test_mem_free (d3);
+  test_mem_free (h0);
+  test_mem_free (h1);
+  test_mem_free (h2);
+  test_mem_free (h3);
+}
+
+void __test_perf_fn
+perftest_variable_size_x4 (test_perf_t *tp)
+{
+  u32 key_len, n_keys, n = tp->n_ops / 4;
+  u8 *key;
+  u8 *d0 = test_mem_alloc (n);
+  u8 *d1 = test_mem_alloc (n);
+  u8 *d2 = test_mem_alloc (n);
+  u8 *d3 = test_mem_alloc (n);
+  u32 *h0 = test_mem_alloc (sizeof (u32));
+  u32 *h1 = test_mem_alloc (sizeof (u32));
+  u32 *h2 = test_mem_alloc (sizeof (u32));
+  u32 *h3 = test_mem_alloc (sizeof (u32));
+  clib_toeplitz_hash_key_t *k = clib_toeplitz_hash_key_init (0, 0);
+
+  k = clib_toeplitz_hash_key_init (0, 0);
+  key_len = k->key_length;
+  n_keys = ((n + 4) / k->key_length) + 1;
+  key = test_mem_alloc_and_splat (n_keys, key_len, k->data);
+  clib_toeplitz_hash_key_free (k);
+  k = clib_toeplitz_hash_key_init (key, key_len * n_keys);
+
+  test_perf_event_enable (tp);
+  clib_toeplitz_hash_x4 (k, d0, d1, d2, d3, h0, h1, h2, h3, n);
+  test_perf_event_disable (tp);
+
+  clib_toeplitz_hash_key_free (k);
+  test_mem_free (key);
+  test_mem_free (d0);
+  test_mem_free (d1);
+  test_mem_free (d2);
+  test_mem_free (d3);
+  test_mem_free (h0);
+  test_mem_free (h1);
+  test_mem_free (h2);
+  test_mem_free (h3);
+}
+
+REGISTER_TEST (clib_toeplitz_hash_x4) = {
+  .name = "clib_toeplitz_hash_x4",
+  .fn = test_clib_toeplitz_hash_x4,
+  .perf_tests = PERF_TESTS ({ .name = "fixed (per 12 byte tuple)",
+			      .n_ops = 1024,
+			      .fn = perftest_fixed_12byte_x4 },
+			    { .name = "fixed (per 36 byte tuple)",
+			      .n_ops = 1024,
+			      .fn = perftest_fixed_36byte_x4 },
+			    { .name = "variable size (per byte)",
+			      .n_ops = 16384,
+			      .fn = perftest_variable_size_x4 }),
+};
