diff options
author | Steve Shin <jonshin@cisco.com> | 2016-09-07 08:25:04 -0700 |
---|---|---|
committer | Damjan Marion <dmarion.lists@gmail.com> | 2016-09-07 19:34:56 +0000 |
commit | bf1fa7fa397b3be95a9c83e27f18dc896a174287 (patch) | |
tree | e5d28260079d13130a21239f6ca835a108e62fda | |
parent | f5a0e73e5316fa5ed2c5f64aec43cbb78724cb65 (diff) |
Fix MTU size for the bonded interface
Configure the MTU/L3 packet size of the bonded interface
as the lowest value of the slave intefaces
Change-Id: I34fb4c2156e8ad3d9bf45efe332405d53f72867c
Signed-off-by: Steve Shin <jonshin@cisco.com>
-rw-r--r-- | vnet/vnet/devices/dpdk/init.c | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/vnet/vnet/devices/dpdk/init.c b/vnet/vnet/devices/dpdk/init.c index 2ecfa38481a..3de33ed1aa9 100644 --- a/vnet/vnet/devices/dpdk/init.c +++ b/vnet/vnet/devices/dpdk/init.c @@ -1688,6 +1688,7 @@ dpdk_process (vlib_main_t * vm, vlib_node_runtime_t * rt, vlib_frame_t * f) 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; bhi->max_l3_packet_bytes[VLIB_RX] = bhi->max_l3_packet_bytes[VLIB_TX] = ETHERNET_MAX_PACKET_BYTES - sizeof (ethernet_header_t); @@ -1713,6 +1714,17 @@ dpdk_process (vlib_main_t * vm, vlib_node_runtime_t * rt, vlib_frame_t * f) 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]; + + /* Set max 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; } } } |