diff --git a/build/external/packages/dpdk.mk b/build/external/packages/dpdk.mk
index 286e3eb..17a2638 100644
--- a/build/external/packages/dpdk.mk
+++ b/build/external/packages/dpdk.mk
@@ -187,7 +187,7 @@
 	$(call set,RTE_PCI_CONFIG,y)
 	$(call set,RTE_PCI_EXTENDED_TAG,"on")
 	$(call set,RTE_PCI_MAX_READ_REQUEST_SIZE,4096)
-	$(call set,RTE_LIBRTE_PMD_BOND,y)
+	$(call set,RTE_LIBRTE_PMD_BOND,n)
 	$(call set,RTE_LIBRTE_IP_FRAG,y)
 	$(call set,RTE_LIBRTE_PMD_QAT,y)
 	$(call set,RTE_LIBRTE_PMD_QAT_SYM,y)
diff --git a/src/plugins/dpdk/device/cli.c b/src/plugins/dpdk/device/cli.c
index 2152354..416d973 100644
--- a/src/plugins/dpdk/device/cli.c
+++ b/src/plugins/dpdk/device/cli.c
@@ -1008,7 +1008,7 @@
   pci_dev = dpdk_get_pci_device (&dev_info);
 
   if (pci_dev)
-    {				/* bonded interface has no pci info */
+    {
       vlib_pci_addr_t pci_addr;
 
       pci_addr.domain = pci_dev->addr.domain;
@@ -1203,7 +1203,7 @@
   pci_dev = dpdk_get_pci_device (&dev_info);
 
   if (pci_dev)
-    {				/* bonded interface has no pci info */
+    {
       vlib_pci_addr_t pci_addr;
 
       pci_addr.domain = pci_dev->addr.domain;
diff --git a/src/plugins/dpdk/device/common.c b/src/plugins/dpdk/device/common.c
index b239616..11b0538 100644
--- a/src/plugins/dpdk/device/common.c
+++ b/src/plugins/dpdk/device/common.c
@@ -189,17 +189,6 @@
 
   rte_eth_allmulticast_enable (xd->port_id);
 
-  if (xd->pmd == VNET_DPDK_PMD_BOND)
-    {
-      dpdk_portid_t slink[16];
-      int nlink = rte_eth_bond_slaves_get (xd->port_id, slink, 16);
-      while (nlink >= 1)
-	{
-	  dpdk_portid_t dpdk_port = slink[--nlink];
-	  rte_eth_allmulticast_enable (dpdk_port);
-	}
-    }
-
   dpdk_log_info ("Interface %U started",
 		 format_dpdk_device_name, xd->port_id);
 }
@@ -214,82 +203,17 @@
   rte_eth_dev_stop (xd->port_id);
   clib_memset (&xd->link, 0, sizeof (struct rte_eth_link));
 
-  /* For bonded interface, stop slave links */
-  if (xd->pmd == VNET_DPDK_PMD_BOND)
-    {
-      dpdk_portid_t slink[16];
-      int nlink = rte_eth_bond_slaves_get (xd->port_id, slink, 16);
-      while (nlink >= 1)
-	{
-	  dpdk_portid_t dpdk_port = slink[--nlink];
-	  rte_eth_dev_stop (dpdk_port);
-	}
-    }
   dpdk_log_info ("Interface %U stopped",
 		 format_dpdk_device_name, xd->port_id);
 }
 
-/* Even type for send_garp_na_process */
-enum
-{
-  SEND_GARP_NA = 1,
-} dpdk_send_garp_na_process_event_t;
-
-static vlib_node_registration_t send_garp_na_proc_node;
-
-static uword
-send_garp_na_process (vlib_main_t * vm,
-		      vlib_node_runtime_t * rt, vlib_frame_t * f)
-{
-  uword event_type, *event_data = 0;
-
-  while (1)
-    {
-      u32 i;
-      uword dpdk_port;
-      vlib_process_wait_for_event (vm);
-      event_type = vlib_process_get_events (vm, &event_data);
-      ASSERT (event_type == SEND_GARP_NA);
-      for (i = 0; i < vec_len (event_data); i++)
-	{
-	  dpdk_port = event_data[i];
-	  if (i < 5)		/* wait 0.2 sec for link to settle, max total 1 sec */
-	    vlib_process_suspend (vm, 0.2);
-	  dpdk_device_t *xd = &dpdk_main.devices[dpdk_port];
-	  dpdk_update_link_state (xd, vlib_time_now (vm));
-	  send_ip4_garp (vm, xd->sw_if_index);
-	  send_ip6_na (vm, xd->sw_if_index);
-	}
-      vec_reset_length (event_data);
-    }
-  return 0;
-}
-
-/* *INDENT-OFF* */
-VLIB_REGISTER_NODE (send_garp_na_proc_node, static) = {
-    .function = send_garp_na_process,
-    .type = VLIB_NODE_TYPE_PROCESS,
-    .name = "send-garp-na-process",
-};
-/* *INDENT-ON* */
-
 void vl_api_force_rpc_call_main_thread (void *fp, u8 * data, u32 data_length);
 
-static void
-garp_na_proc_callback (uword * dpdk_port)
-{
-  vlib_main_t *vm = vlib_get_main ();
-  ASSERT (vlib_get_thread_index () == 0);
-  vlib_process_signal_event
-    (vm, send_garp_na_proc_node.index, SEND_GARP_NA, *dpdk_port);
-}
-
 always_inline int
 dpdk_port_state_callback_inline (dpdk_portid_t port_id,
 				 enum rte_eth_event_type type, void *param)
 {
   struct rte_eth_link link;
-  dpdk_device_t *xd = &dpdk_main.devices[port_id];
 
   RTE_SET_USED (param);
   if (type != RTE_ETH_EVENT_INTR_LSC)
@@ -300,36 +224,13 @@
 
   rte_eth_link_get_nowait (port_id, &link);
   u8 link_up = link.link_status;
-
-  if (xd->flags & DPDK_DEVICE_FLAG_BOND_SLAVE)
-    {
-      uword bd_port = xd->bond_port;
-      int bd_mode = rte_eth_bond_mode_get (bd_port);
-      dpdk_log_info ("Port %d state to %s, "
-		     "slave of port %d BondEthernet%d in mode %d",
-		     port_id, (link_up) ? "UP" : "DOWN",
-		     bd_port, xd->bond_instance_num, bd_mode);
-      if (bd_mode == BONDING_MODE_ACTIVE_BACKUP)
-	{
-	  vl_api_force_rpc_call_main_thread
-	    (garp_na_proc_callback, (u8 *) & bd_port, sizeof (uword));
-	}
-
-      if (link_up)
-	xd->flags |= DPDK_DEVICE_FLAG_BOND_SLAVE_UP;
-      else
-	xd->flags &= ~DPDK_DEVICE_FLAG_BOND_SLAVE_UP;
-    }
-  else				/* Should not happen as callback not setup for "normal" links */
-    {
-      if (link_up)
-	dpdk_log_info ("Port %d Link Up - speed %u Mbps - %s",
-		       port_id, (unsigned) link.link_speed,
-		       (link.link_duplex == ETH_LINK_FULL_DUPLEX) ?
-		       "full-duplex" : "half-duplex");
-      else
-	dpdk_log_info ("Port %d Link Down\n\n", port_id);
-    }
+  if (link_up)
+    dpdk_log_info ("Port %d Link Up - speed %u Mbps - %s",
+		   port_id, (unsigned) link.link_speed,
+		   (link.link_duplex == ETH_LINK_FULL_DUPLEX) ?
+		   "full-duplex" : "half-duplex");
+  else
+    dpdk_log_info ("Port %d Link Down\n\n", port_id);
 
   return 0;
 }
diff --git a/src/plugins/dpdk/device/dpdk.h b/src/plugins/dpdk/device/dpdk.h
index f79465c..eadf35d 100644
--- a/src/plugins/dpdk/device/dpdk.h
+++ b/src/plugins/dpdk/device/dpdk.h
@@ -38,7 +38,6 @@
 #include <rte_mempool.h>
 #include <rte_mbuf.h>
 #include <rte_version.h>
-#include <rte_eth_bond.h>
 #include <rte_sched.h>
 #include <rte_net.h>
 #include <rte_bus_pci.h>
@@ -73,7 +72,6 @@
   _ ("net_enic", ENIC)            \
   _ ("net_vmxnet3", VMXNET3)      \
   _ ("AF_PACKET PMD", AF_PACKET)  \
-  _ ("net_bonding", BOND)         \
   _ ("net_fm10k", FM10K)          \
   _ ("net_cxgbe", CXGBE)          \
   _ ("net_mlx4", MLX4)            \
@@ -108,7 +106,6 @@
   VNET_DPDK_PORT_TYPE_ETH_50G,
   VNET_DPDK_PORT_TYPE_ETH_56G,
   VNET_DPDK_PORT_TYPE_ETH_100G,
-  VNET_DPDK_PORT_TYPE_ETH_BOND,
   VNET_DPDK_PORT_TYPE_ETH_SWITCH,
   VNET_DPDK_PORT_TYPE_AF_PACKET,
   VNET_DPDK_PORT_TYPE_ETH_VF,
@@ -163,8 +160,6 @@
   _( 4, MAYBE_MULTISEG, "maybe-multiseg") \
   _( 5, HAVE_SUBIF, "subif") \
   _( 6, HQOS, "hqos") \
-  _( 7, BOND_SLAVE, "bond-slave") \
-  _( 8, BOND_SLAVE_UP, "bond-slave-up") \
   _( 9, TX_OFFLOAD, "tx-offload") \
   _(10, INTEL_PHDR_CKSUM, "intel-phdr-cksum") \
   _(11, RX_FLOW_OFFLOAD, "rx-flow-offload") \
@@ -243,13 +238,8 @@
   dpdk_device_hqos_per_worker_thread_t *hqos_wt;
   dpdk_device_hqos_per_hqos_thread_t *hqos_ht;
 
-  /* af_packet or BondEthernet instance number */
+  /* af_packet instance number */
   u16 af_packet_instance_num;
-  u16 bond_instance_num;
-
-  /* Bonded interface port# of a slave -
-     only valid if DPDK_DEVICE_FLAG_BOND_SLAVE bit is set */
-  dpdk_portid_t bond_port;
 
   struct rte_eth_link link;
   f64 time_last_link_update;
diff --git a/src/plugins/dpdk/device/format.c b/src/plugins/dpdk/device/format.c
index acc26ab..b7ceda0 100644
--- a/src/plugins/dpdk/device/format.c
+++ b/src/plugins/dpdk/device/format.c
@@ -195,9 +195,6 @@
       device_name = "HundredGigabitEthernet";
       break;
 
-    case VNET_DPDK_PORT_TYPE_ETH_BOND:
-      return format (s, "BondEthernet%d", xd->bond_instance_num);
-
     case VNET_DPDK_PORT_TYPE_ETH_SWITCH:
       device_name = "EthernetSwitch";
       break;
@@ -329,10 +326,6 @@
       dev_type = "af_packet";
       break;
 
-    case VNET_DPDK_PMD_BOND:
-      dev_type = "Ethernet Bonding";
-      break;
-
     case VNET_DPDK_PMD_DPAA2:
       dev_type = "NXP DPAA2 Mac";
       break;
diff --git a/src/plugins/dpdk/device/init.c b/src/plugins/dpdk/device/init.c
index 7e5cc08..fccefb1 100644
--- a/src/plugins/dpdk/device/init.c
+++ b/src/plugins/dpdk/device/init.c
@@ -219,7 +219,6 @@
 
   u32 next_hqos_cpu = 0;
   u8 af_packet_instance_num = 0;
-  u8 bond_ether_instance_num = 0;
   last_pci_addr.as_u32 = ~0;
 
   dm->hqos_cpu_first_index = 0;
@@ -291,7 +290,7 @@
 
       pci_dev = dpdk_get_pci_device (&dev_info);
 
-      if (pci_dev)	/* bonded interface has no pci info */
+      if (pci_dev)
 	{
 	  pci_addr.domain = pci_dev->addr.domain;
 	  pci_addr.bus = pci_dev->addr.bus;
@@ -513,11 +512,6 @@
 	      xd->af_packet_instance_num = af_packet_instance_num++;
 	      break;
 
-	    case VNET_DPDK_PMD_BOND:
-	      xd->port_type = VNET_DPDK_PORT_TYPE_ETH_BOND;
-	      xd->bond_instance_num = bond_ether_instance_num++;
-	      break;
-
 	    case VNET_DPDK_PMD_VIRTIO_USER:
 	      xd->port_type = VNET_DPDK_PORT_TYPE_VIRTIO_USER;
 	      break;
@@ -1505,14 +1499,6 @@
       ed->new_link_state = (u8) xd->link.link_status;
     }
 
-  if ((xd->flags & (DPDK_DEVICE_FLAG_ADMIN_UP | DPDK_DEVICE_FLAG_BOND_SLAVE))
-      && ((xd->link.link_status != 0) ^
-	  vnet_hw_interface_is_link_up (vnm, xd->hw_if_index)))
-    {
-      hw_flags_chg = 1;
-      hw_flags |= (xd->link.link_status ? VNET_HW_INTERFACE_FLAG_LINK_UP : 0);
-    }
-
   if (hw_flags_chg || (xd->link.link_duplex != prev_link.link_duplex))
     {
       hw_flags_chg = 1;
@@ -1561,13 +1547,9 @@
 dpdk_process (vlib_main_t * vm, vlib_node_runtime_t * rt, vlib_frame_t * f)
 {
   clib_error_t *error;
-  vnet_main_t *vnm = vnet_get_main ();
   dpdk_main_t *dm = &dpdk_main;
-  ethernet_main_t *em = &ethernet_main;
   dpdk_device_t *xd;
   vlib_thread_main_t *tm = vlib_get_thread_main ();
-  int i;
-  int j;
 
   error = dpdk_lib_init (dm);
 
@@ -1582,110 +1564,6 @@
     dpdk_update_link_state (xd, now);
   }
 
-  {
-    /*
-     * Extra set up for bond interfaces:
-     *  1. Setup MACs for bond interfaces and their slave links which was set
-     *     in dpdk_device_setup() but needs to be done again here to take
-     *     effect.
-     *  2. Set up info and register slave link state change callback handling.
-     *  3. Set up info for bond interface related CLI support.
-     */
-    int nports = rte_eth_dev_count_avail ();
-    if (nports > 0)
-      {
-	/* *INDENT-OFF* */
-	RTE_ETH_FOREACH_DEV(i)
-	  {
-	    xd = NULL;
-	    for (j = 0; j < nports; j++)
-	      {
-		if (dm->devices[j].port_id == i)
-		  {
-		    xd = &dm->devices[j];
-		  }
-	      }
-	    if (xd != NULL && xd->pmd == VNET_DPDK_PMD_BOND)
-	      {
-		u8 addr[6];
-		dpdk_portid_t slink[16];
-		int nlink = rte_eth_bond_slaves_get (i, slink, 16);
-		if (nlink > 0)
-		  {
-		    vnet_hw_interface_t *bhi;
-		    ethernet_interface_t *bei;
-		    int rv;
-
-		    /* Get MAC of 1st slave link */
-		    rte_eth_macaddr_get
-		      (slink[0], (struct ether_addr *) addr);
-
-		    /* Set MAC of bounded interface to that of 1st slave link */
-		    dpdk_log_info ("Set MAC for bond port %d BondEthernet%d",
-				   i, xd->bond_instance_num);
-		    rv = rte_eth_bond_mac_address_set
-		      (i, (struct ether_addr *) addr);
-		    if (rv)
-		      dpdk_log_warn ("Set MAC addr failure rv=%d", rv);
-
-		    /* Populate MAC of bonded interface in VPP hw tables */
-		    bhi = vnet_get_hw_interface
-		      (vnm, dm->devices[i].hw_if_index);
-		    bei = pool_elt_at_index
-		      (em->interfaces, bhi->hw_instance);
-		    clib_memcpy (bhi->hw_address, addr, 6);
-		    clib_memcpy (bei->address, addr, 6);
-
-		    /* Init l3 packet size allowed on bonded interface */
-		    bhi->max_packet_bytes = ETHERNET_MAX_PACKET_BYTES;
-		    while (nlink >= 1)
-		      {		/* for all slave links */
-			int slave = slink[--nlink];
-			dpdk_device_t *sdev = &dm->devices[slave];
-			vnet_hw_interface_t *shi;
-			vnet_sw_interface_t *ssi;
-			ethernet_interface_t *sei;
-			/* Add MAC to all slave links except the first one */
-			if (nlink)
-			  {
-			    dpdk_log_info ("Add MAC for slave port %d",
-					   slave);
-			    rv = rte_eth_dev_mac_addr_add
-			      (slave, (struct ether_addr *) addr, 0);
-			    if (rv)
-			      dpdk_log_warn ("Add MAC addr failure rv=%d",
-					     rv);
-			  }
-			/* Setup slave link state change callback handling */
-			rte_eth_dev_callback_register
-			  (slave, RTE_ETH_EVENT_INTR_LSC,
-			   dpdk_port_state_callback, NULL);
-			dpdk_device_t *sxd = &dm->devices[slave];
-			sxd->flags |= DPDK_DEVICE_FLAG_BOND_SLAVE;
-			sxd->bond_port = i;
-			/* Set slaves bitmap for bonded interface */
-			bhi->bond_info = clib_bitmap_set
-			  (bhi->bond_info, sdev->hw_if_index, 1);
-			/* Set MACs and slave link flags on slave interface */
-			shi = vnet_get_hw_interface (vnm, sdev->hw_if_index);
-			ssi = vnet_get_sw_interface (vnm, sdev->sw_if_index);
-			sei = pool_elt_at_index
-			  (em->interfaces, shi->hw_instance);
-			shi->bond_info = VNET_HW_INTERFACE_BOND_INFO_SLAVE;
-			ssi->flags |= VNET_SW_INTERFACE_FLAG_BOND_SLAVE;
-			clib_memcpy (shi->hw_address, addr, 6);
-			clib_memcpy (sei->address, addr, 6);
-			/* Set l3 packet size allowed as the lowest of slave */
-			if (bhi->max_packet_bytes > shi->max_packet_bytes)
-			  bhi->max_packet_bytes = shi->max_packet_bytes;
-		      }
-		  }
-	      }
-	  }
-	/* *INDENT-ON* */
-      }
-  }
-
   while (1)
     {
       /*
diff --git a/src/plugins/dpdk/device/node.c b/src/plugins/dpdk/device/node.c
index 222201d..e8a11a9 100644
--- a/src/plugins/dpdk/device/node.c
+++ b/src/plugins/dpdk/device/node.c
@@ -466,8 +466,6 @@
   foreach_device_and_queue (dq, rt->devices_and_queues)
     {
       xd = vec_elt_at_index(dm->devices, dq->dev_instance);
-      if (PREDICT_FALSE (xd->flags & DPDK_DEVICE_FLAG_BOND_SLAVE))
-	continue;	/* Do not poll slave to a bonded interface */
       n_rx_packets += dpdk_device_input (vm, dm, xd, node, thread_index,
 					 dq->queue_id);
     }
