On bonded interface admin-down, should stop all slave links 91/1991/3
authorJohn Lo <loj@cisco.com>
Mon, 18 Jul 2016 22:06:14 +0000 (18:06 -0400)
committerDamjan Marion <dmarion.lists@gmail.com>
Tue, 19 Jul 2016 14:21:41 +0000 (14:21 +0000)
When bonded interface is set to admin down, all slave links should
also be stopped or they will continue to receive packets and then
be dropped because bonded interface is down.

Also remove setting bonded interface L3 packet size limit to that of
slave on startup - it is not needed and can cause undesirable side
effect if its value become incompatible with bonded interface MTU.

Change-Id: Ibdd8acac0ca41a867131441eb26518592bb7d98a
Signed-off-by: John Lo <loj@cisco.com>
vnet/vnet/devices/dpdk/device.c
vnet/vnet/devices/dpdk/init.c

index 35cf87f..27e3522 100644 (file)
@@ -1094,6 +1094,18 @@ dpdk_interface_admin_up_down (vnet_main_t * vnm, u32 hw_if_index, u32 flags)
        */
       if (xd->pmd != VNET_DPDK_PMD_VMXNET3)
          rte_eth_dev_stop (xd->device_index);
+
+      /* For bonded interface, stop slave links */
+      if (xd->pmd == VNET_DPDK_PMD_BOND) 
+        {
+         u8  slink[16];
+         int nlink = rte_eth_bond_slaves_get(xd->device_index, slink, 16);
+         while (nlink >=1) 
+           {
+             u8 dpdk_port = slink[--nlink];
+             rte_eth_dev_stop (dpdk_port);
+           }
+        }
     }
 
   if (rv < 0)
index d78f893..6ac5dbe 100644 (file)
@@ -1541,12 +1541,12 @@ dpdk_process (vlib_main_t * vm,
       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_port_setup() but needs to be done again here to take effect.
-  // 2. Set max L3 packet size of each bond interface to the lowerst value of 
-  //    its slave links 
-  // 3. Set up info for bond interface related CLI support.
+{ /
+   * Extra set up for bond interfaces:
+   *  1. Setup MACs for bond interfaces and their slave links which was set
+   *     in dpdk_port_setup() but needs to be done again here to take effect.
+   *  2. Set up info for bond interface related CLI support. 
+   */
   int nports = rte_eth_dev_count();
   if (nports > 0) {
       for (i = 0; i < nports; i++) {
@@ -1592,12 +1592,6 @@ dpdk_process (vlib_main_t * vm,
                      ssi = vnet_get_sw_interface(vnm, sdev->vlib_sw_if_index);
                      shi->bond_info = VNET_HW_INTERFACE_BOND_INFO_SLAVE;
                      ssi->flags |= VNET_SW_INTERFACE_FLAG_BOND_SLAVE;
-                     /* Set l3 packet size allowed as the lowest of slave */
-                     if (bhi->max_l3_packet_bytes[VLIB_RX] >
-                         shi->max_l3_packet_bytes[VLIB_RX]) 
-                         bhi->max_l3_packet_bytes[VLIB_RX] =
-                         bhi->max_l3_packet_bytes[VLIB_TX] =
-                             shi->max_l3_packet_bytes[VLIB_RX];
                  }
              }
          }