diff --git a/src/vnet/bier/bier_fmask.c b/src/vnet/bier/bier_fmask.c
index 3d7cc83..73f7194 100644
--- a/src/vnet/bier/bier_fmask.c
+++ b/src/vnet/bier/bier_fmask.c
@@ -37,6 +37,11 @@
  */
 bier_fmask_t *bier_fmask_pool;
 
+/**
+ * Stats for each BIER fmask object
+ */
+vlib_combined_counter_main_t bier_fmask_counters;
+
 static inline index_t
 bier_fmask_get_index (const bier_fmask_t *bfm)
 {
@@ -165,6 +170,12 @@
     const bier_table_id_t *btid;
     mpls_label_t olabel;
 
+    ASSERT(1 == vec_len(rpaths));
+    memset(bfm, 0, sizeof(*bfm));
+
+    bfm->bfm_id = clib_mem_alloc(sizeof(*bfm->bfm_id));
+
+    fib_node_init(&bfm->bfm_node, FIB_NODE_TYPE_BIER_FMASK);
     *bfm->bfm_id = *fmid;
     dpo_reset(&bfm->bfm_dpo);
     btid = bier_table_get_id(bfm->bfm_id->bfmi_bti);
@@ -268,20 +279,19 @@
                             const fib_route_path_t *rpaths)
 {
     bier_fmask_t *bfm;
+    index_t bfmi;
 
     pool_get_aligned(bier_fmask_pool, bfm, CLIB_CACHE_LINE_BYTES);
+    bfmi = bier_fmask_get_index(bfm);
 
-    memset(bfm, 0, sizeof(*bfm));
+    vlib_validate_combined_counter (&(bier_fmask_counters), bfmi);
+    vlib_zero_combined_counter (&(bier_fmask_counters), bfmi);
 
-    bfm->bfm_id = clib_mem_alloc(sizeof(*bfm->bfm_id));
-
-    ASSERT(1 == vec_len(rpaths));
-    fib_node_init(&bfm->bfm_node, FIB_NODE_TYPE_BIER_FMASK);
     bier_fmask_init(bfm, fmid, rpaths);
 
-    bier_fmask_lock(bier_fmask_get_index(bfm));
+    bier_fmask_lock(bfmi);
 
-    return (bier_fmask_get_index(bfm));
+    return (bfmi);
 }
 
 void
@@ -331,6 +341,7 @@
     u32 indent = va_arg(*ap, u32);
     bier_fmask_attributes_t attr;
     bier_fmask_t *bfm;
+    vlib_counter_t to;
 
     if (pool_is_free_index(bier_fmask_pool, bfmi))
     {
@@ -349,6 +360,8 @@
             s = format (s, "%s,", bier_fmask_attr_names[attr]);
         }
     }
+    vlib_get_combined_counter (&(bier_fmask_counters), bfmi, &to);
+    s = format (s, " to:[%Ld:%Ld]]", to.packets, to.bytes);
     s = format(s, "\n");
     s = fib_path_list_format(bfm->bfm_pl, s);
 
@@ -371,6 +384,43 @@
     return (s);
 }
 
+void
+bier_fmask_get_stats (index_t bfmi, u64 * packets, u64 * bytes)
+{
+  vlib_counter_t to;
+
+  vlib_get_combined_counter (&(bier_fmask_counters), bfmi, &to);
+
+  *packets = to.packets;
+  *bytes = to.bytes;
+}
+
+void
+bier_fmask_encode (index_t bfmi,
+                   bier_table_id_t *btid,
+                   fib_route_path_encode_t *rpath)
+{
+    bier_fmask_t *bfm;
+
+    bfm = bier_fmask_get(bfmi);
+    *btid = *bier_table_get_id(bfm->bfm_id->bfmi_bti);
+
+    memset(rpath, 0, sizeof(*rpath));
+
+    rpath->rpath.frp_sw_if_index = ~0;
+
+    switch (bfm->bfm_id->bfmi_nh_type)
+    {
+    case BIER_NH_UDP:
+        rpath->rpath.frp_flags = FIB_ROUTE_PATH_UDP_ENCAP;
+        rpath->rpath.frp_udp_encap_id = bfm->bfm_id->bfmi_id;
+        break;
+    case BIER_NH_IP:
+        memcpy(&rpath->rpath.frp_addr, &bfm->bfm_id->bfmi_nh,
+               sizeof(rpath->rpath.frp_addr));
+        break;
+    }
+}
 
 static fib_node_t *
 bier_fmask_get_node (fib_node_index_t index)
diff --git a/src/vnet/bier/bier_fmask.h b/src/vnet/bier/bier_fmask.h
index 56930f6..0666605 100644
--- a/src/vnet/bier/bier_fmask.h
+++ b/src/vnet/bier/bier_fmask.h
@@ -163,6 +163,10 @@
                                  fib_node_index_t child_index);
 extern void bier_fmask_child_remove (fib_node_index_t fib_entry_index,
                                      u32 sibling_index);
+extern void bier_fmask_get_stats (index_t bfmi, u64 * packets, u64 * bytes);
+extern void bier_fmask_encode (index_t bfmi,
+                               bier_table_id_t *btid,
+                               fib_route_path_encode_t *rpath);
 
 /*
  * provided for fast data-path access
diff --git a/src/vnet/bier/bier_fmask_db.c b/src/vnet/bier/bier_fmask_db.c
index 67d3bd1..59e2973 100644
--- a/src/vnet/bier/bier_fmask_db.c
+++ b/src/vnet/bier/bier_fmask_db.c
@@ -31,7 +31,7 @@
     /**
      * hash table for underlying storage
      */
-    mhash_t bfdb_hash;
+    uword *bfdb_hash;
 
     /**
      * Pool for memory
@@ -68,11 +68,12 @@
     if (FIB_ROUTE_PATH_UDP_ENCAP & rpath->frp_flags)
     {
         key->bfmi_id = rpath->frp_udp_encap_id;
+        key->bfmi_nh_type = BIER_NH_UDP;
     }
     else
     {
-        key->bfmi_sw_if_index = rpath->frp_sw_if_index;
         memcpy(&key->bfmi_nh, &rpath->frp_addr, sizeof(rpath->frp_addr));
+        key->bfmi_nh_type = BIER_NH_IP;
     }
     if (NULL == rpath->frp_label_stack)
     {
@@ -82,6 +83,7 @@
     {
         key->bfmi_hdr_type = BIER_HDR_O_MPLS;
     }
+    key->bfmi_bti = bti;
 }
 
 u32
@@ -92,7 +94,7 @@
     uword *p;
 
     bier_fmask_db_mk_key(bti, rpath, &fmid);
-    p = mhash_get(&bier_fmask_db.bfdb_hash, &fmid);
+    p = hash_get_mem(bier_fmask_db.bfdb_hash, &fmid);
 
     if (NULL != p)
     {
@@ -111,7 +113,7 @@
     uword *p;
 
     bier_fmask_db_mk_key(bti, rpath, &fmid);
-    p = mhash_get(&bier_fmask_db.bfdb_hash, &fmid);
+    p = hash_get_mem(bier_fmask_db.bfdb_hash, &fmid);
 
     if (NULL == p)
     {
@@ -121,7 +123,7 @@
          */
         index = bier_fmask_create_and_lock(&fmid, rpath);
         bfm = bier_fmask_get(index);
-        mhash_set(&bier_fmask_db.bfdb_hash, bfm->bfm_id, index, 0);
+        hash_set_mem(bier_fmask_db.bfdb_hash, bfm->bfm_id, index);
     }
     else
     {
@@ -137,7 +139,7 @@
 {
     uword *p;
 
-    p = mhash_get(&bier_fmask_db.bfdb_hash, fmid);
+    p = hash_get_mem(bier_fmask_db.bfdb_hash, fmid);
 
     if (NULL == p) {
         /*
@@ -145,16 +147,29 @@
          */
         ASSERT (!"remove non-existant fmask");
     } else {
-        mhash_unset(&(bier_fmask_db.bfdb_hash), (void*)fmid, 0);
+        hash_unset(bier_fmask_db.bfdb_hash, fmid);
     }
 }
 
+void
+bier_fmask_db_walk (bier_fmask_walk_fn_t fn, void *ctx)
+{
+    CLIB_UNUSED (bier_fmask_id_t *fmid);
+    uword *bfmi;
+
+    hash_foreach(fmid, bfmi, bier_fmask_db.bfdb_hash,
+    ({
+        if (WALK_STOP == fn(*bfmi, ctx))
+            break;
+    }));
+}
+
 clib_error_t *
 bier_fmask_db_module_init (vlib_main_t *vm)
 {
-    mhash_init(&bier_fmask_db.bfdb_hash,
-               sizeof(index_t),
-               sizeof(bier_fmask_id_t));
+    bier_fmask_db.bfdb_hash = hash_create_mem(0,
+                                              sizeof(bier_fmask_id_t),
+                                              sizeof(index_t));
 
     return (NULL);
 }
diff --git a/src/vnet/bier/bier_fmask_db.h b/src/vnet/bier/bier_fmask_db.h
index a7f29c2..36e555f 100644
--- a/src/vnet/bier/bier_fmask_db.h
+++ b/src/vnet/bier/bier_fmask_db.h
@@ -36,23 +36,28 @@
      * BIER header in non-MPLS networks
      */
     BIER_HDR_O_OTHER,
-} bier_hdr_type_t;
+} __attribute__((packed)) bier_hdr_type_t;
+
+/**
+ * BIER next-hop type
+ */
+typedef enum bier_nh_type_t_ {
+    /**
+     * BIER Header in MPLS networks
+     */
+    BIER_NH_IP,
+
+    /**
+     * BIER header in non-MPLS networks
+     */
+    BIER_NH_UDP,
+} __attribute__((packed)) bier_nh_type_t;
 
 /**
  * A key/ID for a BIER forwarding Mas (FMask).
  * This is a simplified version of a fib_route_path_t.
  */
 typedef struct bier_fmask_id_t_ {
-    /**
-     * Type of BIER header this fmask supports
-     */
-    bier_hdr_type_t bfmi_hdr_type;
-
-    /**
-     * The BIER table this fmask is in
-     */
-    index_t bfmi_bti;
-
     union {
         /**
          * next-hop of the peer
@@ -64,11 +69,20 @@
          */
         u32 bfmi_id;
     };
+    /**
+     * The BIER table this fmask is in
+     */
+    index_t bfmi_bti;
 
     /**
-     * Software interface index
+     * Type of BIER header this fmask supports
      */
-    u32 bfmi_sw_if_index;
+    bier_hdr_type_t bfmi_hdr_type;
+
+    /**
+     * Union discriminatrr
+     */
+    bier_nh_type_t bfmi_nh_type;
 } __attribute__((packed)) bier_fmask_id_t;
 
 extern index_t
@@ -79,5 +93,11 @@
 
 extern void bier_fmask_db_remove (const bier_fmask_id_t *fmid);
 
+/**
+ * Walk all the BIER fmasks
+ */
+typedef walk_rc_t (*bier_fmask_walk_fn_t) (index_t bfmi, void *ctx);
+
+extern void bier_fmask_db_walk(bier_fmask_walk_fn_t fn, void *ctx);
 
 #endif
diff --git a/src/vnet/bier/bier_output.c b/src/vnet/bier/bier_output.c
index 01eeffe..7f513fc 100644
--- a/src/vnet/bier/bier_output.c
+++ b/src/vnet/bier/bier_output.c
@@ -49,6 +49,7 @@
  * Forward declaration
  */
 vlib_node_registration_t bier_output_node;
+extern vlib_combined_counter_main_t bier_fmask_counters;
 
 /**
  * @brief Packet trace recoed for a BIER output
@@ -64,13 +65,14 @@
              vlib_node_runtime_t * node,
              vlib_frame_t * from_frame)
 {
+  vlib_combined_counter_main_t *cm = &bier_fmask_counters;
     u32 n_left_from, next_index, * from, * to_next;
+    u32 thread_index;
 
+    thread_index = vlib_get_thread_index ();
     from = vlib_frame_vector_args (from_frame);
     n_left_from = from_frame->n_vectors;
 
-    // vnet_buffer(b0)->sw_if_index[VLIB_TX] = d0->tx_fib_index;
-
     /*
      * objection your honour! speculation!
      */
@@ -112,6 +114,10 @@
             bfmi0 = vnet_buffer (b0)->ip.adj_index[VLIB_TX];
             bfm0 = bier_fmask_get(bfmi0);
 
+            vlib_increment_combined_counter(
+                cm, thread_index, bfmi0, 1,
+                vlib_buffer_length_in_chain (vm, b0));
+
             /*
              * perform the logical AND of the packet's mask with
              * that of the fmask objects, to reset the bits that
diff --git a/src/vnet/udp/udp_encap.c b/src/vnet/udp/udp_encap.c
index 4b4d541..914680f 100644
--- a/src/vnet/udp/udp_encap.c
+++ b/src/vnet/udp/udp_encap.c
@@ -599,7 +599,7 @@
   /* *INDENT-OFF* */
   pool_foreach_index(uei, udp_encap_pool,
   ({
-    if (!cb(uei, ctx))
+    if (WALK_STOP == cb(uei, ctx))
       break;
   }));
   /* *INDENT-ON* */
diff --git a/src/vnet/udp/udp_encap.h b/src/vnet/udp/udp_encap.h
index 185d5e7..e20edec 100644
--- a/src/vnet/udp/udp_encap.h
+++ b/src/vnet/udp/udp_encap.h
@@ -131,7 +131,7 @@
  * Callback function invoked when walking all encap objects.
  * Return non-zero to continue the walk.
  */
-typedef int (*udp_encap_walk_cb_t) (index_t uei, void *ctx);
+typedef walk_rc_t (*udp_encap_walk_cb_t) (index_t uei, void *ctx);
 
 /**
  * Walk each of the encap objects
diff --git a/src/vpp/stats/stats.api b/src/vpp/stats/stats.api
index 72e03b0..5d00908 100644
--- a/src/vpp/stats/stats.api
+++ b/src/vpp/stats/stats.api
@@ -18,9 +18,10 @@
     This file defines the stats API 
 */
 
-option version = "1.0.0";
+option version = "1.0.1";
 
 import "vnet/interface.api";
+import "vnet/bier/bier.api";
 
 service {
   rpc want_stats
@@ -58,6 +59,9 @@
   rpc want_udp_encap_stats
     returns want_udp_encap_stats_reply
     events vnet_udp_encap_counters;
+  rpc want_bier_neighbor_stats
+    returns want_bier_neighbor_stats_reply
+    events vnet_bier_neighbor_counters;
 };
 
 /** \brief Want Stats, enable/disable ALL stats updates
@@ -472,6 +476,41 @@
   vl_api_udp_encap_counter_t c[count];
 };
 
+/** \brief Want BIER neighbor Stats, register for continuous stats
+    @param client_index - opaque cookie to identify the sender
+    @param context - sender context, to match reply w/ request
+    @param enable - 1 = enable stats, 0 = disable
+    @param pid - pid of process requesting stats updates
+*/
+autoreply define want_bier_neighbor_stats
+{
+  u32 client_index;
+  u32 context;
+  u32 enable;
+  u32 pid;
+};
+
+/** \brief Stat for one BIER neighbor object
+    @param tbl_id - The BIER Table ID the neighbour belongs to.
+    @param path - The path describing the negihbor (this is the data
+                  given during a BIER route add)
+    @param packets - number of packets sent
+    @param bytes - number of bytes sent
+*/
+typeonly manual_print manual_endian define bier_neighbor_counter
+{
+  vl_api_bier_table_id_t tbl_id;
+  vl_api_fib_path_t path;
+  u64 packets;
+  u64 bytes;
+};
+
+manual_print manual_endian define vnet_bier_neighbor_counters
+{
+  u32 timestamp;
+  u32 count;
+  vl_api_bier_neighbor_counter_t c[count];
+};
 
 /*
  * Local Variables:
diff --git a/src/vpp/stats/stats.c b/src/vpp/stats/stats.c
index 452871f..9f91210 100644
--- a/src/vpp/stats/stats.c
+++ b/src/vpp/stats/stats.c
@@ -19,6 +19,9 @@
 #include <vnet/mfib/mfib_entry.h>
 #include <vnet/dpo/load_balance.h>
 #include <vnet/udp/udp_encap.h>
+#include <vnet/bier/bier_fmask.h>
+#include <vnet/bier/bier_table.h>
+#include <vnet/fib/fib_api.h>
 
 #define STATS_DEBUG 0
 
@@ -65,7 +68,8 @@
 _(WANT_IP6_NBR_STATS, want_ip6_nbr_stats)                               \
 _(VNET_GET_SUMMARY_STATS, vnet_get_summary_stats)                       \
 _(STATS_GET_POLLER_DELAY, stats_get_poller_delay)                       \
-_(WANT_UDP_ENCAP_STATS, want_udp_encap_stats)
+_(WANT_UDP_ENCAP_STATS, want_udp_encap_stats)                           \
+_(WANT_BIER_NEIGHBOR_STATS, want_bier_neighbor_stats)
 
 #define vl_msg_name_crc_list
 #include <vpp/stats/stats.api.h>
@@ -88,6 +92,7 @@
 #define IP4_MFIB_COUNTER_BATCH_SIZE	24
 #define IP6_MFIB_COUNTER_BATCH_SIZE	15
 #define UDP_ENCAP_COUNTER_BATCH_SIZE	(1024 / sizeof(vl_api_udp_encap_counter_t))
+#define BIER_NEIGHBOR_COUNTER_BATCH_SIZE (1024 / sizeof(vl_api_bier_neighbor_counter_t))
 
 /* 5ms */
 #define STATS_RELEASE_DELAY_NS (1000 * 1000 * 5)
@@ -1224,6 +1229,23 @@
 #define MIN(x,y) (((x)<(y))?(x):(y))
 
 static void
+send_and_pause (stats_main_t * sm, svm_queue_t * q, u8 * mp)
+{
+  u8 pause = 0;
+
+  svm_queue_lock (q);
+  pause = svm_queue_is_full (q);
+
+  vl_msg_api_send_shmem_nolock (q, (u8 *) & mp);
+  svm_queue_unlock (q);
+  dsunlock (sm);
+
+  if (pause)
+    ip46_fib_stats_delay (sm, 0 /* sec */ ,
+			  STATS_RELEASE_DELAY_NS);
+}
+
+static void
 ip4_nbr_ship (stats_main_t * sm, ip4_nbr_stats_ctx_t * ctx)
 {
   api_main_t *am = sm->api_main;
@@ -1268,16 +1290,7 @@
       /*
        * send to the shm q
        */
-      svm_queue_lock (q);
-      pause = svm_queue_is_full (q);
-
-      vl_msg_api_send_shmem_nolock (q, (u8 *) & mp);
-      svm_queue_unlock (q);
-      dsunlock (sm);
-
-      if (pause)
-	ip46_fib_stats_delay (sm, 0 /* sec */ ,
-			      STATS_RELEASE_DELAY_NS);
+      send_and_pause (sm, q, (u8 *) & mp);
     }
 }
 
@@ -1423,16 +1436,7 @@
       /*
        * send to the shm q
        */
-      svm_queue_lock (q);
-      pause = svm_queue_is_full (q);
-
-      vl_msg_api_send_shmem_nolock (q, (u8 *) & mp);
-      svm_queue_unlock (q);
-      dsunlock (sm);
-
-      if (pause)
-        ip46_fib_stats_delay (sm, 0 /* sec */ ,
-                              STATS_RELEASE_DELAY_NS);
+      send_and_pause(sm, q, (u8 *) & mp);
     }
 }
 
@@ -2138,31 +2142,25 @@
     vl_msg_api_free (mp);
 }
 
-typedef struct udp_encap_stat_t_
-{
-  u32 ue_id;
-  u64 stats[2];
-} udp_encap_stat_t;
-
 typedef struct udp_encap_stats_walk_t_
 {
-  udp_encap_stat_t *stats;
+  vl_api_udp_encap_counter_t *stats;
 } udp_encap_stats_walk_t;
 
-static int
+static walk_rc_t
 udp_encap_stats_walk_cb (index_t uei, void *arg)
 {
   udp_encap_stats_walk_t *ctx = arg;
-  udp_encap_stat_t *stat;
+  vl_api_udp_encap_counter_t *stat;
   udp_encap_t *ue;
 
   ue = udp_encap_get (uei);
   vec_add2 (ctx->stats, stat, 1);
 
-  stat->ue_id = uei;
-  udp_encap_get_stats (ue->ue_id, &stat->stats[0], &stat->stats[1]);
+  stat->id = ue->ue_id;
+  udp_encap_get_stats (ue->ue_id, &stat->packets, &stat->bytes);
 
-  return (1);
+  return (WALK_CONTINUE);
 }
 
 static void
@@ -2213,23 +2211,14 @@
       /*
        * send to the shm q
        */
-      svm_queue_lock (q);
-      pause = svm_queue_is_full (q);
-
-      vl_msg_api_send_shmem_nolock (q, (u8 *) & mp);
-      svm_queue_unlock (q);
-      dsunlock (sm);
-
-      if (pause)
-	ip46_fib_stats_delay (sm, 0 /* sec */ ,
-			      STATS_RELEASE_DELAY_NS);
+      send_and_pause (sm, q, (u8 *) & mp);
     }
 }
 
 static void
 do_udp_encap_counters (stats_main_t * sm)
 {
-  udp_encap_stat_t *stat;
+  vl_api_udp_encap_counter_t *stat;
 
   udp_encap_stats_walk_t ctx = {
     .stats = NULL,
@@ -2242,6 +2231,100 @@
   udp_encap_ship (&ctx);
 }
 
+typedef struct bier_neighbor_stats_walk_t_
+{
+  vl_api_bier_neighbor_counter_t *stats;
+} bier_neighbor_stats_walk_t;
+
+static walk_rc_t
+bier_neighbor_stats_walk_cb (index_t bfmi, void *arg)
+{
+  bier_neighbor_stats_walk_t *ctx = arg;
+  vl_api_bier_neighbor_counter_t *stat;
+  fib_route_path_encode_t rpath;
+  bier_table_id_t btid;
+
+  vec_add2 (ctx->stats, stat, 1);
+
+  bier_fmask_encode (bfmi, &btid, &rpath);
+
+  stat->tbl_id.bt_set = btid.bti_set;
+  stat->tbl_id.bt_sub_domain = btid.bti_sub_domain;
+  stat->tbl_id.bt_hdr_len_id = btid.bti_hdr_len;
+  fib_api_path_encode (&rpath, &stat->path);
+  bier_fmask_get_stats (bfmi, &stat->packets, &stat->bytes);
+
+  return (WALK_CONTINUE);
+}
+
+static void
+bier_neighbor_ship (bier_neighbor_stats_walk_t * ctx)
+{
+  vl_api_vnet_bier_neighbor_counters_t *mp;
+  vl_shmem_hdr_t *shmem_hdr;
+  stats_main_t *sm;
+  api_main_t *am;
+  svm_queue_t *q;
+
+  mp = NULL;
+  sm = &stats_main;
+  am = sm->api_main;
+  shmem_hdr = am->shmem_hdr;
+  q = shmem_hdr->vl_input_queue;
+
+  /*
+   * If the walk context has counters, which may be left over from the last
+   * suspend, then we continue from there.
+   */
+  while (0 != vec_len (ctx->stats))
+    {
+      u32 n_items = MIN (vec_len (ctx->stats),
+			 BIER_NEIGHBOR_COUNTER_BATCH_SIZE);
+      u8 pause = 0;
+
+      dslock (sm, 0 /* release hint */ , 1 /* tag */ );
+
+      mp = vl_msg_api_alloc_as_if_client (sizeof (*mp) +
+					  (n_items *
+					   sizeof
+					   (vl_api_bier_neighbor_counter_t)));
+      mp->_vl_msg_id = ntohs (VL_API_VNET_BIER_NEIGHBOR_COUNTERS);
+      mp->count = ntohl (n_items);
+
+      /*
+       * copy the counters from the back of the context, then we can easily
+       * 'erase' them by resetting the vector length.
+       * The order we push the stats to the caller is not important.
+       */
+      clib_memcpy (mp->c,
+		   &ctx->stats[vec_len (ctx->stats) - n_items],
+		   n_items * sizeof (*ctx->stats));
+
+      _vec_len (ctx->stats) = vec_len (ctx->stats) - n_items;
+
+      /*
+       * send to the shm q
+       */
+      send_and_pause (sm, q, (u8 *) & mp);
+    }
+}
+
+static void
+do_bier_neighbor_counters (stats_main_t * sm)
+{
+  vl_api_bier_neighbor_counter_t *stat;
+
+  bier_neighbor_stats_walk_t ctx = {
+    .stats = NULL,
+  };
+
+  dslock (sm, 0 /* release hint */ , 1 /* tag */ );
+  bier_fmask_db_walk (bier_neighbor_stats_walk_cb, &ctx);
+  dsunlock (sm);
+
+  bier_neighbor_ship (&ctx);
+}
+
 int
 stats_set_poller_delay (u32 poller_delay_sec)
 {
@@ -2434,8 +2517,8 @@
       if (pool_elts (sm->stats_registrations[IDX_IP6_NBR_COUNTERS]))
 	do_ip6_nbr_counters (sm);
 
-      if (pool_elts (sm->stats_registrations[IDX_UDP_ENCAP_COUNTERS]))
-	do_udp_encap_counters (sm);
+      if (pool_elts (sm->stats_registrations[IDX_BIER_NEIGHBOR_COUNTERS]))
+	do_bier_neighbor_counters (sm);
     }
 }
 
@@ -2734,6 +2817,43 @@
 }
 
 static void
+vl_api_want_bier_neighbor_stats_t_handler (vl_api_want_bier_neighbor_stats_t *
+					   mp)
+{
+  stats_main_t *sm = &stats_main;
+  vpe_client_registration_t rp;
+  vl_api_want_bier_neighbor_stats_reply_t *rmp;
+  uword *p;
+  i32 retval = 0;
+  vl_api_registration_t *reg;
+  u32 fib;
+
+  fib = ~0;			//Using same mechanism as _per_interface_
+  rp.client_index = mp->client_index;
+  rp.client_pid = mp->pid;
+
+  handle_client_registration (&rp, IDX_BIER_NEIGHBOR_COUNTERS, fib,
+			      mp->enable);
+
+reply:
+  reg = vl_api_client_index_to_registration (mp->client_index);
+
+  if (!reg)
+    {
+      sm->enable_poller = clear_client_for_stat (IDX_BIER_NEIGHBOR_COUNTERS,
+						 fib, mp->client_index);
+      return;
+    }
+
+  rmp = vl_msg_api_alloc (sizeof (*rmp));
+  rmp->_vl_msg_id = ntohs (VL_API_WANT_BIER_NEIGHBOR_STATS_REPLY);
+  rmp->context = mp->context;
+  rmp->retval = retval;
+
+  vl_api_send_msg (reg, (u8 *) rmp);
+}
+
+static void
 vl_api_want_stats_t_handler (vl_api_want_stats_t * mp)
 {
   stats_main_t *sm = &stats_main;
diff --git a/src/vpp/stats/stats.reg b/src/vpp/stats/stats.reg
index dbec8c9..8983e39 100644
--- a/src/vpp/stats/stats.reg
+++ b/src/vpp/stats/stats.reg
@@ -42,3 +42,4 @@
 stats_reg (IP4_MFIB_COUNTERS)
 stats_reg (IP6_MFIB_COUNTERS)
 stats_reg (UDP_ENCAP_COUNTERS)
+stats_reg (BIER_NEIGHBOR_COUNTERS)
