diff --git a/src/vnet/bonding/cli.c b/src/vnet/bonding/cli.c
index b2d66f9..7919b57 100644
--- a/src/vnet/bonding/cli.c
+++ b/src/vnet/bonding/cli.c
@@ -29,6 +29,7 @@
   uword p;
 
   bif = bond_get_master_by_dev_instance (sif->bif_dev_instance);
+  clib_spinlock_lock_if_init (&bif->lockp);
   vec_foreach_index (i, bif->active_slaves)
   {
     p = *vec_elt_at_index (bif->active_slaves, i);
@@ -39,6 +40,7 @@
 	break;
       }
   }
+  clib_spinlock_unlock_if_init (&bif->lockp);
 }
 
 void
@@ -47,12 +49,14 @@
   bond_if_t *bif;
 
   bif = bond_get_master_by_dev_instance (sif->bif_dev_instance);
+  clib_spinlock_lock_if_init (&bif->lockp);
   if (!hash_get (bif->active_slave_by_sw_if_index, sif->sw_if_index))
     {
       hash_set (bif->active_slave_by_sw_if_index, sif->sw_if_index,
 		sif->sw_if_index);
       vec_add1 (bif->active_slaves, sif->sw_if_index);
     }
+  clib_spinlock_unlock_if_init (&bif->lockp);
 }
 
 int
@@ -171,6 +175,7 @@
   slave_if_t *sif;
   vnet_hw_interface_t *hw;
   u32 *sif_sw_if_index;
+  u32 thread_index;
 
   hw = vnet_get_sup_hw_interface (vnm, sw_if_index);
   if (hw == NULL || bond_dev_class.index != hw->dev_class_index)
@@ -193,6 +198,12 @@
 
   clib_bitmap_free (bif->port_number_bitmap);
   hash_unset (bm->bond_by_sw_if_index, bif->sw_if_index);
+  for (thread_index = 0; thread_index < vlib_get_thread_main ()->n_vlib_mains;
+       thread_index++)
+    {
+      vec_free (bif->per_thread_info[thread_index].frame);
+    }
+  vec_free (bif->per_thread_info);
   memset (bif, 0, sizeof (*bif));
   pool_put (bm->interfaces, bif);
 
@@ -265,6 +276,11 @@
   sw = vnet_get_hw_sw_interface (vnm, bif->hw_if_index);
   bif->sw_if_index = sw->sw_if_index;
   bif->group = bif->sw_if_index;
+  vec_validate_aligned (bif->per_thread_info,
+			vlib_get_thread_main ()->n_vlib_mains - 1,
+			CLIB_CACHE_LINE_BYTES);
+  if (vlib_get_thread_main ()->n_vlib_mains > 1)
+    clib_spinlock_init (&bif->lockp);
 
   vnet_hw_interface_set_flags (vnm, bif->hw_if_index,
 			       VNET_HW_INTERFACE_FLAG_LINK_UP);
diff --git a/src/vnet/bonding/device.c b/src/vnet/bonding/device.c
index 8f9b3a9..cebfd69 100644
--- a/src/vnet/bonding/device.c
+++ b/src/vnet/bonding/device.c
@@ -351,9 +351,9 @@
   uword n_trace = vlib_get_trace_count (vm, node);
   u16 thread_index = vlib_get_thread_index ();
   vnet_main_t *vnm = vnet_get_main ();
-  u32 *to_next, *to_next1, *to_next2, *to_next3;
+  u32 *to_next;
   u32 sif_if_index, sif_if_index1, sif_if_index2, sif_if_index3;
-  vlib_frame_t *f, *f1, *f2, *f3;
+  vlib_frame_t *f;
 
   if (PREDICT_FALSE (bif->admin_up == 0))
     {
@@ -367,6 +367,7 @@
       return frame->n_vectors;
     }
 
+  clib_spinlock_lock_if_init (&bif->lockp);
   if (PREDICT_FALSE (vec_len (bif->active_slaves) == 0))
     {
       bi0 = from[0];
@@ -383,206 +384,245 @@
 				     frame->n_vectors);
       vlib_error_count (vm, node->node_index, BOND_TX_ERROR_NO_SLAVE,
 			frame->n_vectors);
+      clib_spinlock_unlock_if_init (&bif->lockp);
       return frame->n_vectors;
     }
 
+  vec_validate_aligned (bif->per_thread_info[thread_index].frame,
+			vec_len (bif->active_slaves), CLIB_CACHE_LINE_BYTES);
+
   /* Number of buffers / pkts */
   n_left_from = frame->n_vectors;
 
-  while (n_left_from >= 8)
+  while (n_left_from > 0)
     {
-      // Prefetch next iteration
-      {
-	vlib_buffer_t *p4, *p5, *p6, *p7;
-
-	p4 = vlib_get_buffer (vm, from[4]);
-	p5 = vlib_get_buffer (vm, from[5]);
-	p6 = vlib_get_buffer (vm, from[6]);
-	p7 = vlib_get_buffer (vm, from[7]);
-
-	vlib_prefetch_buffer_header (p4, STORE);
-	vlib_prefetch_buffer_header (p5, STORE);
-	vlib_prefetch_buffer_header (p6, STORE);
-	vlib_prefetch_buffer_header (p7, STORE);
-
-	CLIB_PREFETCH (p4->data, CLIB_CACHE_LINE_BYTES, LOAD);
-	CLIB_PREFETCH (p5->data, CLIB_CACHE_LINE_BYTES, LOAD);
-	CLIB_PREFETCH (p6->data, CLIB_CACHE_LINE_BYTES, LOAD);
-	CLIB_PREFETCH (p7->data, CLIB_CACHE_LINE_BYTES, LOAD);
-      }
-
-      bi0 = from[0];
-      bi1 = from[1];
-      bi2 = from[2];
-      bi3 = from[3];
-
-      b0 = vlib_get_buffer (vm, bi0);
-      b1 = vlib_get_buffer (vm, bi1);
-      b2 = vlib_get_buffer (vm, bi2);
-      b3 = vlib_get_buffer (vm, bi3);
-
-      VLIB_BUFFER_TRACE_TRAJECTORY_INIT (b0);
-      VLIB_BUFFER_TRACE_TRAJECTORY_INIT (b1);
-      VLIB_BUFFER_TRACE_TRAJECTORY_INIT (b2);
-      VLIB_BUFFER_TRACE_TRAJECTORY_INIT (b3);
-
-      sw_if_index = vnet_buffer (b0)->sw_if_index[VLIB_TX];
-      sw_if_index1 = vnet_buffer (b1)->sw_if_index[VLIB_TX];
-      sw_if_index2 = vnet_buffer (b2)->sw_if_index[VLIB_TX];
-      sw_if_index3 = vnet_buffer (b3)->sw_if_index[VLIB_TX];
-
-      port =
-	(bond_load_balance_table[bif->lb]).load_balance (vm, node, bif, b0);
-      port1 =
-	(bond_load_balance_table[bif->lb]).load_balance (vm, node, bif, b1);
-      port2 =
-	(bond_load_balance_table[bif->lb]).load_balance (vm, node, bif, b2);
-      port3 =
-	(bond_load_balance_table[bif->lb]).load_balance (vm, node, bif, b3);
-
-      sif_if_index = *vec_elt_at_index (bif->active_slaves, port);
-      sif_if_index1 = *vec_elt_at_index (bif->active_slaves, port1);
-      sif_if_index2 = *vec_elt_at_index (bif->active_slaves, port2);
-      sif_if_index3 = *vec_elt_at_index (bif->active_slaves, port3);
-
-      vnet_buffer (b0)->sw_if_index[VLIB_TX] = sif_if_index;
-      vnet_buffer (b1)->sw_if_index[VLIB_TX] = sif_if_index1;
-      vnet_buffer (b2)->sw_if_index[VLIB_TX] = sif_if_index2;
-      vnet_buffer (b3)->sw_if_index[VLIB_TX] = sif_if_index3;
-
-      f = vnet_get_frame_to_sw_interface (vnm, sif_if_index);
-      f1 = vnet_get_frame_to_sw_interface (vnm, sif_if_index1);
-      f2 = vnet_get_frame_to_sw_interface (vnm, sif_if_index2);
-      f3 = vnet_get_frame_to_sw_interface (vnm, sif_if_index3);
-
-      to_next = vlib_frame_vector_args (f);
-      to_next1 = vlib_frame_vector_args (f1);
-      to_next2 = vlib_frame_vector_args (f2);
-      to_next3 = vlib_frame_vector_args (f3);
-
-      to_next += f->n_vectors;
-      to_next1 += f1->n_vectors;
-      to_next2 += f2->n_vectors;
-      to_next3 += f3->n_vectors;
-
-      to_next[0] = vlib_get_buffer_index (vm, b0);
-      to_next1[0] = vlib_get_buffer_index (vm, b1);
-      to_next2[0] = vlib_get_buffer_index (vm, b2);
-      to_next3[0] = vlib_get_buffer_index (vm, b3);
-
-      f->n_vectors++;
-      f1->n_vectors++;
-      f2->n_vectors++;
-      f3->n_vectors++;
-
-      vnet_put_frame_to_sw_interface (vnm, sif_if_index, f);
-      vnet_put_frame_to_sw_interface (vnm, sif_if_index1, f1);
-      vnet_put_frame_to_sw_interface (vnm, sif_if_index2, f2);
-      vnet_put_frame_to_sw_interface (vnm, sif_if_index3, f3);
-
-      if (PREDICT_FALSE (n_trace > 0))
+      while (n_left_from >= 4)
 	{
-	  vlib_trace_buffer (vm, node, next0, b0, 0 /* follow_chain */ );
-	  vlib_set_trace_count (vm, node, --n_trace);
-	  t0 = vlib_add_trace (vm, node, b0, sizeof (*t0));
-	  eth = (ethernet_header_t *) vlib_buffer_get_current (b0);
-	  t0->ethernet = *eth;
-	  t0->sw_if_index = sw_if_index;
-	  t0->bond_sw_if_index = vnet_buffer (b0)->sw_if_index[VLIB_TX];
-
-	  if (PREDICT_TRUE (n_trace > 0))
+	  // Prefetch next iteration
+	  if (n_left_from >= 8)
 	    {
-	      vlib_trace_buffer (vm, node, next1, b1, 0 /* follow_chain */ );
+	      vlib_buffer_t *p4, *p5, *p6, *p7;
+
+	      p4 = vlib_get_buffer (vm, from[4]);
+	      p5 = vlib_get_buffer (vm, from[5]);
+	      p6 = vlib_get_buffer (vm, from[6]);
+	      p7 = vlib_get_buffer (vm, from[7]);
+
+	      vlib_prefetch_buffer_header (p4, STORE);
+	      vlib_prefetch_buffer_header (p5, STORE);
+	      vlib_prefetch_buffer_header (p6, STORE);
+	      vlib_prefetch_buffer_header (p7, STORE);
+
+	      CLIB_PREFETCH (p4->data, CLIB_CACHE_LINE_BYTES, LOAD);
+	      CLIB_PREFETCH (p5->data, CLIB_CACHE_LINE_BYTES, LOAD);
+	      CLIB_PREFETCH (p6->data, CLIB_CACHE_LINE_BYTES, LOAD);
+	      CLIB_PREFETCH (p7->data, CLIB_CACHE_LINE_BYTES, LOAD);
+	    }
+
+	  bi0 = from[0];
+	  bi1 = from[1];
+	  bi2 = from[2];
+	  bi3 = from[3];
+
+	  b0 = vlib_get_buffer (vm, bi0);
+	  b1 = vlib_get_buffer (vm, bi1);
+	  b2 = vlib_get_buffer (vm, bi2);
+	  b3 = vlib_get_buffer (vm, bi3);
+
+	  VLIB_BUFFER_TRACE_TRAJECTORY_INIT (b0);
+	  VLIB_BUFFER_TRACE_TRAJECTORY_INIT (b1);
+	  VLIB_BUFFER_TRACE_TRAJECTORY_INIT (b2);
+	  VLIB_BUFFER_TRACE_TRAJECTORY_INIT (b3);
+
+	  sw_if_index = vnet_buffer (b0)->sw_if_index[VLIB_TX];
+	  sw_if_index1 = vnet_buffer (b1)->sw_if_index[VLIB_TX];
+	  sw_if_index2 = vnet_buffer (b2)->sw_if_index[VLIB_TX];
+	  sw_if_index3 = vnet_buffer (b3)->sw_if_index[VLIB_TX];
+
+	  port =
+	    (bond_load_balance_table[bif->lb]).load_balance (vm, node, bif,
+							     b0);
+	  port1 =
+	    (bond_load_balance_table[bif->lb]).load_balance (vm, node, bif,
+							     b1);
+	  port2 =
+	    (bond_load_balance_table[bif->lb]).load_balance (vm, node, bif,
+							     b2);
+	  port3 =
+	    (bond_load_balance_table[bif->lb]).load_balance (vm, node, bif,
+							     b3);
+
+	  sif_if_index = *vec_elt_at_index (bif->active_slaves, port);
+	  sif_if_index1 = *vec_elt_at_index (bif->active_slaves, port1);
+	  sif_if_index2 = *vec_elt_at_index (bif->active_slaves, port2);
+	  sif_if_index3 = *vec_elt_at_index (bif->active_slaves, port3);
+
+	  vnet_buffer (b0)->sw_if_index[VLIB_TX] = sif_if_index;
+	  vnet_buffer (b1)->sw_if_index[VLIB_TX] = sif_if_index1;
+	  vnet_buffer (b2)->sw_if_index[VLIB_TX] = sif_if_index2;
+	  vnet_buffer (b3)->sw_if_index[VLIB_TX] = sif_if_index3;
+
+	  if (bif->per_thread_info[thread_index].frame[port] == 0)
+	    bif->per_thread_info[thread_index].frame[port] =
+	      vnet_get_frame_to_sw_interface (vnm, sif_if_index);
+
+	  if (bif->per_thread_info[thread_index].frame[port1] == 0)
+	    bif->per_thread_info[thread_index].frame[port1] =
+	      vnet_get_frame_to_sw_interface (vnm, sif_if_index1);
+
+	  if (bif->per_thread_info[thread_index].frame[port2] == 0)
+	    bif->per_thread_info[thread_index].frame[port2] =
+	      vnet_get_frame_to_sw_interface (vnm, sif_if_index2);
+
+	  if (bif->per_thread_info[thread_index].frame[port3] == 0)
+	    bif->per_thread_info[thread_index].frame[port3] =
+	      vnet_get_frame_to_sw_interface (vnm, sif_if_index3);
+
+	  f = bif->per_thread_info[thread_index].frame[port];
+	  to_next = vlib_frame_vector_args (f);
+	  to_next += f->n_vectors;
+	  to_next[0] = vlib_get_buffer_index (vm, b0);
+	  f->n_vectors++;
+
+	  f = bif->per_thread_info[thread_index].frame[port1];
+	  to_next = vlib_frame_vector_args (f);
+	  to_next += f->n_vectors;
+	  to_next[0] = vlib_get_buffer_index (vm, b1);
+	  f->n_vectors++;
+
+	  f = bif->per_thread_info[thread_index].frame[port2];
+	  to_next = vlib_frame_vector_args (f);
+	  to_next += f->n_vectors;
+	  to_next[0] = vlib_get_buffer_index (vm, b2);
+	  f->n_vectors++;
+
+	  f = bif->per_thread_info[thread_index].frame[port3];
+	  to_next = vlib_frame_vector_args (f);
+	  to_next += f->n_vectors;
+	  to_next[0] = vlib_get_buffer_index (vm, b3);
+	  f->n_vectors++;
+
+	  if (PREDICT_FALSE (n_trace > 0))
+	    {
+	      vlib_trace_buffer (vm, node, next0, b0, 0 /* follow_chain */ );
 	      vlib_set_trace_count (vm, node, --n_trace);
-	      t0 = vlib_add_trace (vm, node, b1, sizeof (*t0));
-	      eth = (ethernet_header_t *) vlib_buffer_get_current (b1);
+	      t0 = vlib_add_trace (vm, node, b0, sizeof (*t0));
+	      eth = (ethernet_header_t *) vlib_buffer_get_current (b0);
 	      t0->ethernet = *eth;
-	      t0->sw_if_index = sw_if_index1;
-	      t0->bond_sw_if_index = vnet_buffer (b1)->sw_if_index[VLIB_TX];
+	      t0->sw_if_index = sw_if_index;
+	      t0->bond_sw_if_index = vnet_buffer (b0)->sw_if_index[VLIB_TX];
 
 	      if (PREDICT_TRUE (n_trace > 0))
 		{
-		  vlib_trace_buffer (vm, node, next2, b2,
+		  vlib_trace_buffer (vm, node, next1, b1,
 				     0 /* follow_chain */ );
 		  vlib_set_trace_count (vm, node, --n_trace);
-		  t0 = vlib_add_trace (vm, node, b2, sizeof (*t0));
-		  eth = (ethernet_header_t *) vlib_buffer_get_current (b2);
+		  t0 = vlib_add_trace (vm, node, b1, sizeof (*t0));
+		  eth = (ethernet_header_t *) vlib_buffer_get_current (b1);
 		  t0->ethernet = *eth;
-		  t0->sw_if_index = sw_if_index2;
+		  t0->sw_if_index = sw_if_index1;
 		  t0->bond_sw_if_index =
-		    vnet_buffer (b2)->sw_if_index[VLIB_TX];
+		    vnet_buffer (b1)->sw_if_index[VLIB_TX];
 
 		  if (PREDICT_TRUE (n_trace > 0))
 		    {
-		      vlib_trace_buffer (vm, node, next3, b3,
+		      vlib_trace_buffer (vm, node, next2, b2,
 					 0 /* follow_chain */ );
 		      vlib_set_trace_count (vm, node, --n_trace);
-		      t0 = vlib_add_trace (vm, node, b3, sizeof (*t0));
+		      t0 = vlib_add_trace (vm, node, b2, sizeof (*t0));
 		      eth =
-			(ethernet_header_t *) vlib_buffer_get_current (b3);
+			(ethernet_header_t *) vlib_buffer_get_current (b2);
 		      t0->ethernet = *eth;
-		      t0->sw_if_index = sw_if_index3;
+		      t0->sw_if_index = sw_if_index2;
 		      t0->bond_sw_if_index =
-			vnet_buffer (b3)->sw_if_index[VLIB_TX];
+			vnet_buffer (b2)->sw_if_index[VLIB_TX];
+
+		      if (PREDICT_TRUE (n_trace > 0))
+			{
+			  vlib_trace_buffer (vm, node, next3, b3,
+					     0 /* follow_chain */ );
+			  vlib_set_trace_count (vm, node, --n_trace);
+			  t0 = vlib_add_trace (vm, node, b3, sizeof (*t0));
+			  eth =
+			    (ethernet_header_t *)
+			    vlib_buffer_get_current (b3);
+			  t0->ethernet = *eth;
+			  t0->sw_if_index = sw_if_index3;
+			  t0->bond_sw_if_index =
+			    vnet_buffer (b3)->sw_if_index[VLIB_TX];
+			}
 		    }
 		}
 	    }
+	  from += 4;
+	  n_left_from -= 4;
 	}
 
-      from += 4;
-      n_left_from -= 4;
+      while (n_left_from > 0)
+	{
+	  // Prefetch next iteration
+	  if (n_left_from > 1)
+	    {
+	      vlib_buffer_t *p2;
+
+	      p2 = vlib_get_buffer (vm, from[1]);
+	      vlib_prefetch_buffer_header (p2, STORE);
+	      CLIB_PREFETCH (p2->data, CLIB_CACHE_LINE_BYTES, LOAD);
+	    }
+
+	  bi0 = from[0];
+	  b0 = vlib_get_buffer (vm, bi0);
+
+	  VLIB_BUFFER_TRACE_TRAJECTORY_INIT (b0);
+
+	  sw_if_index = vnet_buffer (b0)->sw_if_index[VLIB_TX];
+
+	  port =
+	    (bond_load_balance_table[bif->lb]).load_balance (vm, node, bif,
+							     b0);
+	  sif_if_index = *vec_elt_at_index (bif->active_slaves, port);
+	  vnet_buffer (b0)->sw_if_index[VLIB_TX] = sif_if_index;
+	  if (bif->per_thread_info[thread_index].frame[port] == 0)
+	    bif->per_thread_info[thread_index].frame[port] =
+	      vnet_get_frame_to_sw_interface (vnm, sif_if_index);
+	  f = bif->per_thread_info[thread_index].frame[port];
+	  to_next = vlib_frame_vector_args (f);
+	  to_next += f->n_vectors;
+	  to_next[0] = vlib_get_buffer_index (vm, b0);
+	  f->n_vectors++;
+
+	  if (PREDICT_FALSE (n_trace > 0))
+	    {
+	      vlib_trace_buffer (vm, node, next0, b0, 0 /* follow_chain */ );
+	      vlib_set_trace_count (vm, node, --n_trace);
+	      t0 = vlib_add_trace (vm, node, b0, sizeof (*t0));
+	      eth = (ethernet_header_t *) vlib_buffer_get_current (b0);
+	      t0->ethernet = *eth;
+	      t0->sw_if_index = sw_if_index;
+	      t0->bond_sw_if_index = vnet_buffer (b0)->sw_if_index[VLIB_TX];
+	    }
+
+	  from += 1;
+	  n_left_from -= 1;
+	}
     }
 
-  while (n_left_from > 0)
+  for (port = 0; port < vec_len (bif->active_slaves); port++)
     {
-      // Prefetch next iteration
-      if (n_left_from > 1)
-	{
-	  vlib_buffer_t *p2;
+      f = bif->per_thread_info[thread_index].frame[port];
+      if (f == 0)
+	continue;
 
-	  p2 = vlib_get_buffer (vm, from[1]);
-	  vlib_prefetch_buffer_header (p2, STORE);
-	  CLIB_PREFETCH (p2->data, CLIB_CACHE_LINE_BYTES, LOAD);
-	}
-
-      bi0 = from[0];
-      b0 = vlib_get_buffer (vm, bi0);
-
-      VLIB_BUFFER_TRACE_TRAJECTORY_INIT (b0);
-
-      sw_if_index = vnet_buffer (b0)->sw_if_index[VLIB_TX];
-
-      port =
-	(bond_load_balance_table[bif->lb]).load_balance (vm, node, bif, b0);
-      sif_if_index = *vec_elt_at_index (bif->active_slaves, port);
-      vnet_buffer (b0)->sw_if_index[VLIB_TX] = sif_if_index;
-      f = vnet_get_frame_to_sw_interface (vnm, sif_if_index);
-      to_next = vlib_frame_vector_args (f);
-      to_next += f->n_vectors;
-
-      to_next[0] = vlib_get_buffer_index (vm, b0);
-      f->n_vectors++;
-      vnet_put_frame_to_sw_interface (vnm, sif_if_index, f);
-
-      if (PREDICT_FALSE (n_trace > 0))
-	{
-	  vlib_trace_buffer (vm, node, next0, b0, 0 /* follow_chain */ );
-	  vlib_set_trace_count (vm, node, --n_trace);
-	  t0 = vlib_add_trace (vm, node, b0, sizeof (*t0));
-	  eth = (ethernet_header_t *) vlib_buffer_get_current (b0);
-	  t0->ethernet = *eth;
-	  t0->sw_if_index = sw_if_index;
-	  t0->bond_sw_if_index = vnet_buffer (b0)->sw_if_index[VLIB_TX];
-	}
-
-      from += 1;
-      n_left_from -= 1;
+      sw_if_index = *vec_elt_at_index (bif->active_slaves, port);
+      vnet_put_frame_to_sw_interface (vnm, sw_if_index, f);
+      bif->per_thread_info[thread_index].frame[port] = 0;
     }
 
   vlib_increment_simple_counter (vnet_main.interface_main.sw_if_counters
 				 + VNET_INTERFACE_COUNTER_TX, thread_index,
 				 bif->sw_if_index, frame->n_vectors);
 
+  clib_spinlock_unlock_if_init (&bif->lockp);
   return frame->n_vectors;
 }
 
diff --git a/src/vnet/bonding/node.h b/src/vnet/bonding/node.h
index 74f3b1a..ae811a1 100644
--- a/src/vnet/bonding/node.h
+++ b/src/vnet/bonding/node.h
@@ -131,6 +131,12 @@
 
 typedef struct
 {
+  vlib_frame_t **frame;
+
+} bond_if_per_thread_t;
+
+typedef struct
+{
   u8 admin_up;
   u8 mode;
   u8 lb;
@@ -159,6 +165,9 @@
   uword *port_number_bitmap;
   u8 use_custom_mac;
   u8 hw_address[6];
+
+  clib_spinlock_t lockp;
+  bond_if_per_thread_t *per_thread_info;
 } bond_if_t;
 
 typedef struct
