summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJohn Lo <loj@cisco.com>2016-07-18 18:06:14 -0400
committerDamjan Marion <dmarion.lists@gmail.com>2016-07-19 14:21:41 +0000
commit3b2944d5f1bc7b42b31293d0d19f36b237490cd6 (patch)
treee4ac755d56b48080ccdc5af81081f4c32d22333f
parent69ae1878d51302a2c539fb0366a388ba28bea43f (diff)
On bonded interface admin-down, should stop all slave links
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>
-rw-r--r--vnet/vnet/devices/dpdk/device.c12
-rw-r--r--vnet/vnet/devices/dpdk/init.c18
2 files changed, 18 insertions, 12 deletions
diff --git a/vnet/vnet/devices/dpdk/device.c b/vnet/vnet/devices/dpdk/device.c
index 35cf87f0..27e35229 100644
--- a/vnet/vnet/devices/dpdk/device.c
+++ b/vnet/vnet/devices/dpdk/device.c
@@ -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)
diff --git a/vnet/vnet/devices/dpdk/init.c b/vnet/vnet/devices/dpdk/init.c
index d78f893f..6ac5dbec 100644
--- a/vnet/vnet/devices/dpdk/init.c
+++ b/vnet/vnet/devices/dpdk/init.c
@@ -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];
}
}
}