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>
This commit is contained in:
John Lo
2016-07-18 18:06:14 -04:00
committed by Damjan Marion
parent 69ae1878d5
commit 3b2944d5f1
2 changed files with 18 additions and 12 deletions

View 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)

View 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];
}
}
}