diff --git a/src/vnet/api_errno.h b/src/vnet/api_errno.h
index 0d5b222..b87c197 100644
--- a/src/vnet/api_errno.h
+++ b/src/vnet/api_errno.h
@@ -109,7 +109,8 @@
 _(SVM_SEGMENT_CREATE_FAIL, -117, "svm segment create fail")		\
 _(APPLICATION_NOT_ATTACHED, -118, "application not attached")           \
 _(BD_ALREADY_EXISTS, -119, "Bridge domain already exists")              \
-_(BD_IN_USE, -120, "Bridge domain has member interfaces")
+_(BD_IN_USE, -120, "Bridge domain has member interfaces")		\
+_(UNSUPPORTED, -121, "Unsupported")
 
 typedef enum
 {
diff --git a/src/vnet/devices/af_packet/af_packet.c b/src/vnet/devices/af_packet/af_packet.c
index 92bd109..cb52e6d 100644
--- a/src/vnet/devices/af_packet/af_packet.c
+++ b/src/vnet/devices/af_packet/af_packet.c
@@ -195,6 +195,7 @@
   u8 hw_addr[6];
   clib_error_t *error;
   vnet_sw_interface_t *sw;
+  vnet_hw_interface_t *hw;
   vlib_thread_main_t *tm = vlib_get_thread_main ();
   vnet_main_t *vnm = vnet_get_main ();
   uword *p;
@@ -294,17 +295,21 @@
     }
 
   sw = vnet_get_hw_sw_interface (vnm, apif->hw_if_index);
+  hw = vnet_get_hw_interface (vnm, apif->hw_if_index);
   apif->sw_if_index = sw->sw_if_index;
-  vnet_set_device_input_node (vnm, apif->hw_if_index,
-			      af_packet_input_node.index);
-  vnet_device_input_assign_thread (vnm, apif->hw_if_index, 0,	/* queue */
-				   ~0 /* any cpu */ );
-  vnet_device_input_set_mode (vnm, apif->hw_if_index, 0,
-			      VNET_DEVICE_INPUT_MODE_INTERRUPT);
+  vnet_hw_interface_set_input_node (vnm, apif->hw_if_index,
+				    af_packet_input_node.index);
 
+  vnet_hw_interface_assign_rx_thread (vnm, apif->hw_if_index, 0,	/* queue */
+				      ~0 /* any cpu */ );
+
+  hw->flags |= VNET_HW_INTERFACE_FLAG_SUPPORTS_INT_MODE;
   vnet_hw_interface_set_flags (vnm, apif->hw_if_index,
 			       VNET_HW_INTERFACE_FLAG_LINK_UP);
 
+  vnet_hw_interface_set_rx_mode (vnm, apif->hw_if_index, 0,
+				 VNET_HW_INTERFACE_RX_MODE_INTERRUPT);
+
   mhash_set_mem (&apm->if_index_by_host_if_name, host_if_name_dup, &if_index,
 		 0);
   if (sw_if_index)
@@ -340,6 +345,7 @@
 
   /* bring down the interface */
   vnet_hw_interface_set_flags (vnm, apif->hw_if_index, 0);
+  vnet_hw_interface_unassign_rx_thread (vnm, apif->hw_if_index, 0);
 
   /* clean up */
   if (apif->unix_file_index != ~0)
diff --git a/src/vnet/devices/devices.c b/src/vnet/devices/devices.c
index 2f55adc..d75d905 100644
--- a/src/vnet/devices/devices.c
+++ b/src/vnet/devices/devices.c
@@ -119,8 +119,8 @@
 }
 
 void
-vnet_device_input_assign_thread (vnet_main_t * vnm, u32 hw_if_index,
-				 u16 queue_id, uword thread_index)
+vnet_hw_interface_assign_rx_thread (vnet_main_t * vnm, u32 hw_if_index,
+				    u16 queue_id, uword thread_index)
 {
   vnet_device_main_t *vdm = &vnet_device_main;
   vlib_main_t *vm;
@@ -149,16 +149,19 @@
   dq->hw_if_index = hw_if_index;
   dq->dev_instance = hw->dev_instance;
   dq->queue_id = queue_id;
+  dq->mode = VNET_HW_INTERFACE_RX_MODE_POLLING;
 
   vnet_device_queue_update (vnm, rt);
   vec_validate (hw->input_node_thread_index_by_queue, queue_id);
+  vec_validate (hw->rx_mode_by_queue, queue_id);
   hw->input_node_thread_index_by_queue[queue_id] = thread_index;
+  hw->rx_mode_by_queue[queue_id] = VNET_HW_INTERFACE_RX_MODE_POLLING;
   vlib_node_set_state (vm, hw->input_node_index, rt->enabled_node_state);
 }
 
 int
-vnet_device_input_unassign_thread (vnet_main_t * vnm, u32 hw_if_index,
-				   u16 queue_id, uword thread_index)
+vnet_hw_interface_unassign_rx_thread (vnet_main_t * vnm, u32 hw_if_index,
+				      u16 queue_id)
 {
   vlib_main_t *vm;
   vnet_hw_interface_t *hw = vnet_get_hw_interface (vnm, hw_if_index);
@@ -190,6 +193,7 @@
 deleted:
 
   vnet_device_queue_update (vnm, rt);
+  hw->rx_mode_by_queue[queue_id] = VNET_HW_INTERFACE_RX_MODE_UNKNOWN;
 
   if (vec_len (rt->devices_and_queues) == 0)
     vlib_node_set_state (vm, hw->input_node_index, VLIB_NODE_STATE_DISABLED);
@@ -199,21 +203,28 @@
 
 
 int
-vnet_device_input_set_mode (vnet_main_t * vnm, u32 hw_if_index, u16 queue_id,
-			    vnet_device_input_mode_t mode)
+vnet_hw_interface_set_rx_mode (vnet_main_t * vnm, u32 hw_if_index,
+			       u16 queue_id, vnet_hw_interface_rx_mode mode)
 {
   vlib_main_t *vm;
   uword thread_index;
   vnet_device_and_queue_t *dq;
   vlib_node_state_t enabled_node_state;
-  ASSERT (mode < VNET_DEVICE_INPUT_N_MODES);
+  ASSERT (mode < VNET_HW_INTERFACE_NUM_RX_MODES);
   vnet_hw_interface_t *hw = vnet_get_hw_interface (vnm, hw_if_index);
   vnet_device_input_runtime_t *rt;
   int is_polling = 0;
 
-  if (hw->input_node_thread_index_by_queue == 0)
+  if (hw->input_node_thread_index_by_queue == 0 || hw->rx_mode_by_queue == 0)
     return VNET_API_ERROR_INVALID_INTERFACE;
 
+  if (hw->rx_mode_by_queue[queue_id] == mode)
+    return 0;
+
+  if (mode != VNET_HW_INTERFACE_RX_MODE_POLLING &&
+      (hw->flags & VNET_HW_INTERFACE_FLAG_SUPPORTS_INT_MODE) == 0)
+    return VNET_API_ERROR_UNSUPPORTED;
+
   thread_index = hw->input_node_thread_index_by_queue[queue_id];
   vm = vlib_mains[thread_index];
 
@@ -223,7 +234,7 @@
   {
     if (dq->hw_if_index == hw_if_index && dq->queue_id == queue_id)
       dq->mode = mode;
-    if (dq->mode == VNET_DEVICE_INPUT_MODE_POLLING)
+    if (dq->mode == VNET_HW_INTERFACE_RX_MODE_POLLING)
       is_polling = 1;
   }
 
@@ -244,8 +255,8 @@
 }
 
 int
-vnet_device_input_get_mode (vnet_main_t * vnm, u32 hw_if_index, u16 queue_id,
-			    vnet_device_input_mode_t * mode)
+vnet_hw_interface_get_rx_mode (vnet_main_t * vnm, u32 hw_if_index,
+			       u16 queue_id, vnet_hw_interface_rx_mode * mode)
 {
   vlib_main_t *vm;
   uword thread_index;
@@ -271,146 +282,7 @@
   return VNET_API_ERROR_INVALID_INTERFACE;
 }
 
-static clib_error_t *
-show_device_placement_fn (vlib_main_t * vm, unformat_input_t * input,
-			  vlib_cli_command_t * cmd)
-{
-  u8 *s = 0;
-  vnet_main_t *vnm = vnet_get_main ();
-  vnet_device_input_runtime_t *rt;
-  vnet_device_and_queue_t *dq;
-  vlib_node_t *pn = vlib_get_node_by_name (vm, (u8 *) "device-input");
-  uword si;
-  int index = 0;
 
-  /* *INDENT-OFF* */
-  foreach_vlib_main (({
-    clib_bitmap_foreach (si, pn->sibling_bitmap,
-      ({
-        rt = vlib_node_get_runtime_data (this_vlib_main, si);
-
-        if (vec_len (rt->devices_and_queues))
-          s = format (s, "  node %U:\n", format_vlib_node_name, vm, si);
-
-        vec_foreach (dq, rt->devices_and_queues)
-	  {
-	    s = format (s, "    %U queue %u (%s)\n",
-			format_vnet_sw_if_index_name, vnm, dq->hw_if_index,
-			dq->queue_id,
-			dq->mode == VNET_DEVICE_INPUT_MODE_POLLING ?
-			"polling" : "interrupt");
-	  }
-      }));
-    if (vec_len (s) > 0)
-      {
-        vlib_cli_output(vm, "Thread %u (%v):\n%v", index,
-			vlib_worker_threads[index].name, s);
-        vec_reset_length (s);
-      }
-    index++;
-  }));
-  /* *INDENT-ON* */
-
-  vec_free (s);
-  return 0;
-}
-
-/* *INDENT-OFF* */
-VLIB_CLI_COMMAND (memif_delete_command, static) = {
-  .path = "show interface placement",
-  .short_help = "show interface placement",
-  .function = show_device_placement_fn,
-};
-/* *INDENT-ON* */
-
-static clib_error_t *
-set_device_placement (vlib_main_t * vm, unformat_input_t * input,
-		      vlib_cli_command_t * cmd)
-{
-  clib_error_t *error = 0;
-  unformat_input_t _line_input, *line_input = &_line_input;
-  vnet_main_t *vnm = vnet_get_main ();
-  vnet_device_main_t *vdm = &vnet_device_main;
-  vnet_device_input_mode_t mode;
-  u32 hw_if_index = (u32) ~ 0;
-  u32 queue_id = (u32) 0;
-  u32 thread_index = (u32) ~ 0;
-  int rv;
-
-  if (!unformat_user (input, unformat_line_input, line_input))
-    return 0;
-
-  while (unformat_check_input (line_input) != UNFORMAT_END_OF_INPUT)
-    {
-      if (unformat
-	  (line_input, "%U", unformat_vnet_hw_interface, vnm, &hw_if_index))
-	;
-      else if (unformat (line_input, "queue %d", &queue_id))
-	;
-      else if (unformat (line_input, "main", &thread_index))
-	thread_index = 0;
-      else if (unformat (line_input, "worker %d", &thread_index))
-	thread_index += vdm->first_worker_thread_index;
-      else
-	{
-	  error = clib_error_return (0, "parse error: '%U'",
-				     format_unformat_error, line_input);
-	  unformat_free (line_input);
-	  return error;
-	}
-    }
-
-  unformat_free (line_input);
-
-  if (hw_if_index == (u32) ~ 0)
-    return clib_error_return (0, "please specify valid interface name");
-
-  if (thread_index > vdm->last_worker_thread_index)
-    return clib_error_return (0,
-			      "please specify valid worker thread or main");
-
-  rv = vnet_device_input_get_mode (vnm, hw_if_index, queue_id, &mode);
-
-  if (rv)
-    return clib_error_return (0, "not found");
-
-  rv = vnet_device_input_unassign_thread (vnm, hw_if_index, queue_id,
-					  thread_index);
-
-  if (rv)
-    return clib_error_return (0, "not found");
-
-  vnet_device_input_assign_thread (vnm, hw_if_index, queue_id, thread_index);
-  vnet_device_input_set_mode (vnm, hw_if_index, queue_id, mode);
-
-  return 0;
-}
-
-/*?
- * This command is used to assign a given interface, and optionally a
- * given queue, to a different thread. If the '<em>queue</em>' is not provided,
- * it defaults to 0.
- *
- * @cliexpar
- * Example of how to display the interface placement:
- * @cliexstart{show interface placement}
- * Thread 1 (vpp_wk_0):
- *   GigabitEthernet0/8/0 queue 0
- *   GigabitEthernet0/9/0 queue 0
- * Thread 2 (vpp_wk_1):
- *   GigabitEthernet0/8/0 queue 1
- *   GigabitEthernet0/9/0 queue 1
- * @cliexend
- * Example of how to assign a interface and queue to a thread:
- * @cliexcmd{set interface placement GigabitEthernet0/8/0 queue 1 thread 1}
-?*/
-/* *INDENT-OFF* */
-VLIB_CLI_COMMAND (cmd_set_dpdk_if_placement,static) = {
-    .path = "set interface placement",
-    .short_help = "set interface placement <interface> [queue <n>] [thread <n> | main]",
-    .function = set_device_placement,
-};
-/* *INDENT-ON* */
 
 static clib_error_t *
 vnet_device_init (vlib_main_t * vm)
diff --git a/src/vnet/devices/devices.h b/src/vnet/devices/devices.h
index baf03b7..f1f7e77 100644
--- a/src/vnet/devices/devices.h
+++ b/src/vnet/devices/devices.h
@@ -55,19 +55,12 @@
   uword next_worker_thread_index;
 } vnet_device_main_t;
 
-typedef enum
-{
-  VNET_DEVICE_INPUT_MODE_POLLING = 0,
-  VNET_DEVICE_INPUT_MODE_INTERRUPT,
-  VNET_DEVICE_INPUT_N_MODES,
-} vnet_device_input_mode_t;
-
 typedef struct
 {
   u32 hw_if_index;
   u32 dev_instance;
   u16 queue_id;
-  vnet_device_input_mode_t mode;
+  vnet_hw_interface_rx_mode mode;
   uword interrupt_pending;
 } vnet_device_and_queue_t;
 
@@ -82,22 +75,23 @@
 extern const u32 device_input_next_node_advance[];
 
 static inline void
-vnet_set_device_input_node (vnet_main_t * vnm, u32 hw_if_index,
-			    u32 node_index)
+vnet_hw_interface_set_input_node (vnet_main_t * vnm, u32 hw_if_index,
+				  u32 node_index)
 {
   vnet_hw_interface_t *hw = vnet_get_hw_interface (vnm, hw_if_index);
   hw->input_node_index = node_index;
 }
 
-void vnet_device_input_assign_thread (vnet_main_t * vnm, u32 hw_if_index,
-				      u16 queue_id, uword thread_index);
-int vnet_device_input_unassign_thread (vnet_main_t * vnm, u32 hw_if_index,
-				       u16 queue_id, uword thread_index);
-int vnet_device_input_set_mode (vnet_main_t * vnm, u32 hw_if_index,
-				u16 queue_id, vnet_device_input_mode_t mode);
-int vnet_device_input_get_mode (vnet_main_t * vnm, u32 hw_if_index,
-				u16 queue_id,
-				vnet_device_input_mode_t * mode);
+void vnet_hw_interface_assign_rx_thread (vnet_main_t * vnm, u32 hw_if_index,
+					 u16 queue_id, uword thread_index);
+int vnet_hw_interface_unassign_rx_thread (vnet_main_t * vnm, u32 hw_if_index,
+					  u16 queue_id);
+int vnet_hw_interface_set_rx_mode (vnet_main_t * vnm, u32 hw_if_index,
+				   u16 queue_id,
+				   vnet_hw_interface_rx_mode mode);
+int vnet_hw_interface_get_rx_mode (vnet_main_t * vnm, u32 hw_if_index,
+				   u16 queue_id,
+				   vnet_hw_interface_rx_mode * mode);
 
 static inline u64
 vnet_get_aggregate_rx_packets (void)
@@ -161,7 +155,7 @@
 #define foreach_device_and_queue(var,vec) \
   for (var = (vec); var < vec_end (vec); var++)			\
     if (clib_smp_swap (&((var)->interrupt_pending), 0) ||	\
-	var->mode == VNET_DEVICE_INPUT_MODE_POLLING)
+	var->mode == VNET_HW_INTERFACE_RX_MODE_POLLING)
 
 #endif /* included_vnet_vnet_device_h */
 
diff --git a/src/vnet/interface.h b/src/vnet/interface.h
index 9c22304..2344348 100644
--- a/src/vnet/interface.h
+++ b/src/vnet/interface.h
@@ -405,6 +405,9 @@
 #define VNET_HW_INTERFACE_FLAG_L2OUTPUT_SHIFT	9
 #define VNET_HW_INTERFACE_FLAG_L2OUTPUT_MAPPED	(1 << 9)
 
+  /* rx mode flags */
+#define VNET_HW_INTERFACE_FLAG_SUPPORTS_INT_MODE (1 << 10)
+
   /* Hardware address as vector.  Zero (e.g. zero-length vector) if no
      address for this class (e.g. PPP). */
   u8 *hw_address;
@@ -470,6 +473,9 @@
   /* input node cpu index by queue */
   u32 *input_node_thread_index_by_queue;
 
+  /* vnet_hw_interface_rx_mode by queue */
+  u8 *rx_mode_by_queue;
+
   /* device input device_and_queue runtime index */
   uword *dq_runtime_index_by_queue;
 
@@ -486,6 +492,15 @@
   VNET_SW_INTERFACE_TYPE_SUB,
 } vnet_sw_interface_type_t;
 
+typedef enum
+{
+  VNET_HW_INTERFACE_RX_MODE_UNKNOWN,
+  VNET_HW_INTERFACE_RX_MODE_POLLING,
+  VNET_HW_INTERFACE_RX_MODE_INTERRUPT,
+  VNET_HW_INTERFACE_RX_MODE_ADAPTIVE,
+  VNET_HW_INTERFACE_NUM_RX_MODES,
+} vnet_hw_interface_rx_mode;
+
 typedef struct
 {
   /*
diff --git a/src/vnet/interface_cli.c b/src/vnet/interface_cli.c
index 94eb7ea..bfce03e 100644
--- a/src/vnet/interface_cli.c
+++ b/src/vnet/interface_cli.c
@@ -1175,7 +1175,245 @@
 };
 /* *INDENT-ON* */
 
+static clib_error_t *
+set_interface_rx_mode (vlib_main_t * vm, unformat_input_t * input,
+		       vlib_cli_command_t * cmd)
+{
+  clib_error_t *error = 0;
+  unformat_input_t _line_input, *line_input = &_line_input;
+  vnet_main_t *vnm = vnet_get_main ();
+  vnet_hw_interface_t *hw;
+  u32 hw_if_index = (u32) ~ 0;
+  u32 queue_id = (u32) ~ 0;
+  vnet_hw_interface_rx_mode mode = VNET_HW_INTERFACE_RX_MODE_UNKNOWN;
+  int i, rv = 0;
 
+  if (!unformat_user (input, unformat_line_input, line_input))
+    return 0;
+
+  while (unformat_check_input (line_input) != UNFORMAT_END_OF_INPUT)
+    {
+      if (unformat
+	  (line_input, "%U", unformat_vnet_hw_interface, vnm, &hw_if_index))
+	;
+      else if (unformat (line_input, "queue %d", &queue_id))
+	;
+      else if (unformat (line_input, "polling"))
+	mode = VNET_HW_INTERFACE_RX_MODE_POLLING;
+      else if (unformat (line_input, "interrupt"))
+	mode = VNET_HW_INTERFACE_RX_MODE_INTERRUPT;
+      else if (unformat (line_input, "adaptive"))
+	mode = VNET_HW_INTERFACE_RX_MODE_ADAPTIVE;
+      else
+	{
+	  error = clib_error_return (0, "parse error: '%U'",
+				     format_unformat_error, line_input);
+	  unformat_free (line_input);
+	  return error;
+	}
+    }
+
+  unformat_free (line_input);
+
+  if (hw_if_index == (u32) ~ 0)
+    return clib_error_return (0, "please specify valid interface name");
+
+  if (mode == VNET_HW_INTERFACE_RX_MODE_UNKNOWN)
+    return clib_error_return (0, "please specify valid rx-mode");
+
+  hw = vnet_get_hw_interface (vnm, hw_if_index);
+
+  if (queue_id == ~0)
+    for (i = 0; i < vec_len (hw->dq_runtime_index_by_queue); i++)
+      {
+	rv = vnet_hw_interface_set_rx_mode (vnm, hw_if_index, i, mode);
+	if (rv)
+	  goto error;
+      }
+  else
+    rv = vnet_hw_interface_set_rx_mode (vnm, hw_if_index, queue_id, mode);
+
+  if (rv)
+    goto error;
+
+  return 0;
+
+error:
+  if (rv == VNET_API_ERROR_UNSUPPORTED)
+    return clib_error_return (0, "unsupported");
+
+  if (rv == VNET_API_ERROR_INVALID_INTERFACE)
+    return clib_error_return (0, "invalid interfaace");
+
+  return clib_error_return (0, "unknown error");
+}
+
+/*?
+ * This command is used to assign a given interface, and optionally a
+ * given queue, to a different thread. If the '<em>queue</em>' is not provided,
+ * it defaults to 0.
+ *
+ * @cliexpar
+ * Example of how to display the interface placement:
+ * @cliexstart{show interface rx-placement}
+ * Thread 1 (vpp_wk_0):
+ *   GigabitEthernet0/8/0 queue 0
+ *   GigabitEthernet0/9/0 queue 0
+ * Thread 2 (vpp_wk_1):
+ *   GigabitEthernet0/8/0 queue 1
+ *   GigabitEthernet0/9/0 queue 1
+ * @cliexend
+ * Example of how to assign a interface and queue to a thread:
+ * @cliexcmd{set interface placement GigabitEthernet0/8/0 queue 1 thread 1}
+?*/
+/* *INDENT-OFF* */
+VLIB_CLI_COMMAND (cmd_set_if_rx_mode,static) = {
+    .path = "set interface rx-mode",
+    .short_help = "set interface rx-mode <interface> [queue <n>] [polling | interrupt | adaptive]",
+    .function = set_interface_rx_mode,
+};
+/* *INDENT-ON* */
+
+static clib_error_t *
+show_interface_rx_placement_fn (vlib_main_t * vm, unformat_input_t * input,
+				vlib_cli_command_t * cmd)
+{
+  u8 *s = 0;
+  vnet_main_t *vnm = vnet_get_main ();
+  vnet_device_input_runtime_t *rt;
+  vnet_device_and_queue_t *dq;
+  vlib_node_t *pn = vlib_get_node_by_name (vm, (u8 *) "device-input");
+  uword si;
+  int index = 0;
+
+  /* *INDENT-OFF* */
+  foreach_vlib_main (({
+    clib_bitmap_foreach (si, pn->sibling_bitmap,
+      ({
+        rt = vlib_node_get_runtime_data (this_vlib_main, si);
+
+        if (vec_len (rt->devices_and_queues))
+          s = format (s, "  node %U:\n", format_vlib_node_name, vm, si);
+
+        vec_foreach (dq, rt->devices_and_queues)
+	  {
+	    s = format (s, "    %U queue %u (%U)\n",
+			format_vnet_sw_if_index_name, vnm, dq->hw_if_index,
+			dq->queue_id,
+			format_vnet_hw_interface_rx_mode, dq->mode);
+	  }
+      }));
+    if (vec_len (s) > 0)
+      {
+        vlib_cli_output(vm, "Thread %u (%v):\n%v", index,
+			vlib_worker_threads[index].name, s);
+        vec_reset_length (s);
+      }
+    index++;
+  }));
+  /* *INDENT-ON* */
+
+  vec_free (s);
+  return 0;
+}
+
+/* *INDENT-OFF* */
+VLIB_CLI_COMMAND (show_interface_rx_placement, static) = {
+  .path = "show interface rx-placement",
+  .short_help = "show interface rx-placement",
+  .function = show_interface_rx_placement_fn,
+};
+/* *INDENT-ON* */
+
+static clib_error_t *
+set_interface_rx_placement (vlib_main_t * vm, unformat_input_t * input,
+			    vlib_cli_command_t * cmd)
+{
+  clib_error_t *error = 0;
+  unformat_input_t _line_input, *line_input = &_line_input;
+  vnet_main_t *vnm = vnet_get_main ();
+  vnet_device_main_t *vdm = &vnet_device_main;
+  vnet_hw_interface_rx_mode mode;
+  u32 hw_if_index = (u32) ~ 0;
+  u32 queue_id = (u32) 0;
+  u32 thread_index = (u32) ~ 0;
+  int rv;
+
+  if (!unformat_user (input, unformat_line_input, line_input))
+    return 0;
+
+  while (unformat_check_input (line_input) != UNFORMAT_END_OF_INPUT)
+    {
+      if (unformat
+	  (line_input, "%U", unformat_vnet_hw_interface, vnm, &hw_if_index))
+	;
+      else if (unformat (line_input, "queue %d", &queue_id))
+	;
+      else if (unformat (line_input, "main", &thread_index))
+	thread_index = 0;
+      else if (unformat (line_input, "worker %d", &thread_index))
+	thread_index += vdm->first_worker_thread_index;
+      else
+	{
+	  error = clib_error_return (0, "parse error: '%U'",
+				     format_unformat_error, line_input);
+	  unformat_free (line_input);
+	  return error;
+	}
+    }
+
+  unformat_free (line_input);
+
+  if (hw_if_index == (u32) ~ 0)
+    return clib_error_return (0, "please specify valid interface name");
+
+  if (thread_index > vdm->last_worker_thread_index)
+    return clib_error_return (0,
+			      "please specify valid worker thread or main");
+
+  rv = vnet_hw_interface_get_rx_mode (vnm, hw_if_index, queue_id, &mode);
+
+  if (rv)
+    return clib_error_return (0, "not found");
+
+  rv = vnet_hw_interface_unassign_rx_thread (vnm, hw_if_index, queue_id);
+
+  if (rv)
+    return clib_error_return (0, "not found");
+
+  vnet_hw_interface_assign_rx_thread (vnm, hw_if_index, queue_id,
+				      thread_index);
+  vnet_hw_interface_set_rx_mode (vnm, hw_if_index, queue_id, mode);
+
+  return 0;
+}
+
+/*?
+ * This command is used to assign a given interface, and optionally a
+ * given queue, to a different thread. If the '<em>queue</em>' is not provided,
+ * it defaults to 0.
+ *
+ * @cliexpar
+ * Example of how to display the interface placement:
+ * @cliexstart{show interface placement}
+ * Thread 1 (vpp_wk_0):
+ *   GigabitEthernet0/8/0 queue 0
+ *   GigabitEthernet0/9/0 queue 0
+ * Thread 2 (vpp_wk_1):
+ *   GigabitEthernet0/8/0 queue 1
+ *   GigabitEthernet0/9/0 queue 1
+ * @cliexend
+ * Example of how to assign a interface and queue to a thread:
+ * @cliexcmd{set interface placement GigabitEthernet0/8/0 queue 1 thread 1}
+?*/
+/* *INDENT-OFF* */
+VLIB_CLI_COMMAND (cmd_set_if_rx_placement,static) = {
+    .path = "set interface rx-placement",
+    .short_help = "set interface rx-placement <hw-interface> [queue <n>] [thread <n> | main]",
+    .function = set_interface_rx_placement,
+};
+
+/* *INDENT-ON* */
 /*
  * fd.io coding-style-patch-verification: ON
  *
diff --git a/src/vnet/interface_format.c b/src/vnet/interface_format.c
index b961c77..03caf5c 100644
--- a/src/vnet/interface_format.c
+++ b/src/vnet/interface_format.c
@@ -59,6 +59,23 @@
 }
 
 u8 *
+format_vnet_hw_interface_rx_mode (u8 * s, va_list * args)
+{
+  vnet_hw_interface_rx_mode mode = va_arg (*args, vnet_hw_interface_rx_mode);
+
+  if (mode == VNET_HW_INTERFACE_RX_MODE_POLLING)
+    return format (s, "polling");
+
+  if (mode == VNET_HW_INTERFACE_RX_MODE_INTERRUPT)
+    return format (s, "interrupt");
+
+  if (mode == VNET_HW_INTERFACE_RX_MODE_ADAPTIVE)
+    return format (s, "adaptive");
+
+  return format (s, "unknown");
+}
+
+u8 *
 format_vnet_hw_interface (u8 * s, va_list * args)
 {
   vnet_main_t *vnm = va_arg (*args, vnet_main_t *);
diff --git a/src/vnet/interface_funcs.h b/src/vnet/interface_funcs.h
index b3aca2f..999b72e 100644
--- a/src/vnet/interface_funcs.h
+++ b/src/vnet/interface_funcs.h
@@ -277,6 +277,7 @@
 
 /* Formats sw/hw interface. */
 format_function_t format_vnet_hw_interface;
+format_function_t format_vnet_hw_interface_rx_mode;
 format_function_t format_vnet_sw_interface;
 format_function_t format_vnet_sw_interface_name;
 format_function_t format_vnet_sw_interface_name_override;
