diff --git a/vnet/vnet/nsh-gre/decap.c b/vnet/vnet/nsh-gre/decap.c
index 9ef52ff..2b6ae9a 100644
--- a/vnet/vnet/nsh-gre/decap.c
+++ b/vnet/vnet/nsh-gre/decap.c
@@ -95,14 +95,20 @@
 {
   u32 n_left_from, next_index, * from, * to_next;
   nsh_gre_main_t * ngm = &nsh_gre_main;
+  vnet_main_t * vnm = ngm->vnet_main;
+  vnet_interface_main_t * im = &vnm->interface_main;
   u32 last_tunnel_index = ~0;
   u64 last_key = ~0ULL;
   u32 pkts_decapsulated = 0;
+  u32 cpu_index = os_get_cpu_number();
+  u32 stats_sw_if_index, stats_n_packets, stats_n_bytes;
 
   from = vlib_frame_vector_args (from_frame);
   n_left_from = from_frame->n_vectors;
 
   next_index = node->cached_next_index;
+  stats_sw_if_index = node->runtime_data[0];
+  stats_n_packets = stats_n_bytes = 0;
 
   while (n_left_from > 0)
     {
@@ -122,6 +128,7 @@
           nsh_gre_tunnel_t * t0, * t1;
           u64 key0, key1;
           u32 error0, error1;
+          u32 sw_if_index0, sw_if_index1, len0, len1;
 
 	  /* Prefetch next iteration. */
 	  {
@@ -185,6 +192,10 @@
 
           t0 = pool_elt_at_index (ngm->tunnels, tunnel_index0);
 
+          next0 = t0->decap_next_index;
+          sw_if_index0 = t0->sw_if_index;
+          len0 = vlib_buffer_length_in_chain(vm, b0);
+
           /* Required to make the l2 tag push / pop code work on l2 subifs */
           vnet_update_l2_len (b0);
 
@@ -193,6 +204,23 @@
           /* ip[46] lookup in the configured FIB, otherwise an opaque */
           vnet_buffer(b0)->sw_if_index[VLIB_TX] = t0->decap_fib_index;
 
+          pkts_decapsulated++;
+          stats_n_packets += 1;
+          stats_n_bytes += len0;
+
+          if (PREDICT_FALSE(sw_if_index0 != stats_sw_if_index))
+          {
+            stats_n_packets -= 1;
+            stats_n_bytes -= len0;
+            if (stats_n_packets)
+              vlib_increment_combined_counter(
+                  im->combined_sw_if_counters + VNET_INTERFACE_COUNTER_RX,
+                  cpu_index, stats_sw_if_index, stats_n_packets, stats_n_bytes);
+            stats_n_packets = 1;
+            stats_n_bytes = len0;
+            stats_sw_if_index = sw_if_index0;
+          }
+
         trace0:
           b0->error = error0 ? node->errors[error0] : 0;
 
@@ -224,6 +252,10 @@
 
           t1 = pool_elt_at_index (ngm->tunnels, tunnel_index1);
 
+          next1 = t1->decap_next_index;
+          sw_if_index1 = t1->sw_if_index;
+          len1 = vlib_buffer_length_in_chain(vm, b1);
+
           /* Required to make the l2 tag push / pop code work on l2 subifs */
           vnet_update_l2_len (b1);
 
@@ -232,7 +264,24 @@
           /* ip[46] lookup in the configured FIB, otherwise an opaque */
           vnet_buffer(b1)->sw_if_index[VLIB_TX] = t1->decap_fib_index;
 
-          pkts_decapsulated +=2;
+          pkts_decapsulated++;
+          stats_n_packets += 1;
+          stats_n_bytes += len1;
+          /* Batch stats increment on the same nsh-gre tunnel so counter
+           is not incremented per packet */
+          if (PREDICT_FALSE(sw_if_index1 != stats_sw_if_index))
+          {
+            stats_n_packets -= 1;
+            stats_n_bytes -= len1;
+            if (stats_n_packets)
+              vlib_increment_combined_counter(
+                  im->combined_sw_if_counters + VNET_INTERFACE_COUNTER_RX,
+                  cpu_index, stats_sw_if_index, stats_n_packets, stats_n_bytes);
+            stats_n_packets = 1;
+            stats_n_bytes = len1;
+            stats_sw_if_index = sw_if_index1;
+          }
+          vnet_buffer(b1)->sw_if_index[VLIB_TX] = t1->decap_fib_index;
 
         trace1:
           b1->error = error1 ? node->errors[error1] : 0;
@@ -263,6 +312,7 @@
           nsh_gre_tunnel_t * t0;
           u64 key0;
           u32 error0;
+          u32 sw_if_index0, len0;
 
 	  bi0 = from[0];
 	  to_next[0] = bi0;
@@ -302,6 +352,10 @@
 
           t0 = pool_elt_at_index (ngm->tunnels, tunnel_index0);
 
+          next0 = t0->decap_next_index;
+          sw_if_index0 = t0->sw_if_index;
+          len0 = vlib_buffer_length_in_chain(vm, b0);
+
           /* Required to make the l2 tag push / pop code work on l2 subifs */
           vnet_update_l2_len (b0);
 
@@ -311,6 +365,24 @@
           vnet_buffer(b0)->sw_if_index[VLIB_TX] = t0->decap_fib_index;
           pkts_decapsulated ++;
 
+          stats_n_packets += 1;
+          stats_n_bytes += len0;
+
+          /* Batch stats increment on the same nsh-gre tunnel so counter
+           is not incremented per packet */
+          if (PREDICT_FALSE(sw_if_index0 != stats_sw_if_index))
+          {
+            stats_n_packets -= 1;
+            stats_n_bytes -= len0;
+            if (stats_n_packets)
+              vlib_increment_combined_counter(
+                  im->combined_sw_if_counters + VNET_INTERFACE_COUNTER_RX,
+                  cpu_index, stats_sw_if_index, stats_n_packets, stats_n_bytes);
+            stats_n_packets = 1;
+            stats_n_bytes = len0;
+            stats_sw_if_index = sw_if_index0;
+          }
+
         trace00:
           b0->error = error0 ? node->errors[error0] : 0;
 
@@ -333,6 +405,14 @@
   vlib_node_increment_counter (vm, nsh_gre_input_node.index,
                                NSH_GRE_ERROR_DECAPSULATED, 
                                pkts_decapsulated);
+  /* Increment any remaining batch stats */
+  if (stats_n_packets)
+  {
+    vlib_increment_combined_counter(
+        im->combined_sw_if_counters + VNET_INTERFACE_COUNTER_RX, cpu_index,
+        stats_sw_if_index, stats_n_packets, stats_n_bytes);
+    node->runtime_data[0] = stats_sw_if_index;
+  }
   return from_frame->n_vectors;
 }
 
