summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJohn Lo <loj@cisco.com>2016-04-19 16:54:20 -0400
committerDamjan Marion <damarion@cisco.com>2016-04-20 17:25:27 +0000
commite5055d21a970f887a82e2153f87bc0f603a6e4bb (patch)
tree3ad4a167713b7a8f408e17dc19ae78444ee58988
parent6855f6cdfee8c479f1e0ae440ce87a91ff41a708 (diff)
Allow L3 forwarded jumbo packets on Bonded Interfaces
Set max L3 packet size allowed to the lowest value of the slave links. Also cleanup FIXME's for VMXNET3 driver. Change-Id: Ia5cf742f2ab13b8cdc8ea6286f56464ee4f8c51d Signed-off-by: John Lo <loj@cisco.com>
-rw-r--r--vnet/vnet/devices/dpdk/init.c32
1 files changed, 16 insertions, 16 deletions
diff --git a/vnet/vnet/devices/dpdk/init.c b/vnet/vnet/devices/dpdk/init.c
index 58bc7a1e40a..891190d30bd 100644
--- a/vnet/vnet/devices/dpdk/init.c
+++ b/vnet/vnet/devices/dpdk/init.c
@@ -503,15 +503,6 @@ dpdk_lib_init (dpdk_main_t * dm)
}
}
- /*
- * DAW-FIXME: VMXNET3 driver doesn't support jumbo / multi-buffer pkts
- */
- if (xd->pmd == VNET_DPDK_PMD_VMXNET3)
- {
- xd->port_conf.rxmode.max_rx_pkt_len = 1518;
- xd->port_conf.rxmode.jumbo_frame = 0;
- }
-
if (xd->pmd == VNET_DPDK_PMD_AF_PACKET)
{
f64 now = vlib_time_now(vm);
@@ -624,11 +615,6 @@ dpdk_lib_init (dpdk_main_t * dm)
vlan_off |= ETH_VLAN_STRIP_OFFLOAD;
rte_eth_dev_set_vlan_offload(xd->device_index, vlan_off);
}
- /*
- * DAW-FIXME: VMXNET3 driver doesn't support jumbo / multi-buffer pkts
- */
- else if (xd->pmd == VNET_DPDK_PMD_VMXNET3)
- hi->max_packet_bytes = 1518;
hi->max_l3_packet_bytes[VLIB_RX] = hi->max_l3_packet_bytes[VLIB_TX] =
xd->port_conf.rxmode.max_rx_pkt_len - sizeof(ethernet_header_t);
@@ -1409,8 +1395,12 @@ dpdk_process (vlib_main_t * vm,
dpdk_update_link_state (xd, now);
}
-{ // Setup MACs for bond interfaces and their links which was initialized in
- // dpdk_port_setup() but needs to be done again here to take effect.
+{ // 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.
int nports = rte_eth_dev_count();
if (nports > 0) {
for (i = 0; i < nports; i++) {
@@ -1436,6 +1426,10 @@ dpdk_process (vlib_main_t * vm,
bei = pool_elt_at_index(em->interfaces, bhi->hw_instance);
memcpy(bhi->hw_address, addr, 6);
memcpy(bei->address, addr, 6);
+ /* Init l3 packet size allowed on bonded interface */
+ bhi->max_l3_packet_bytes[VLIB_RX] =
+ bhi->max_l3_packet_bytes[VLIB_TX] =
+ ETHERNET_MAX_PACKET_BYTES - sizeof(ethernet_header_t);
while (nlink >= 1) { /* for all slave links */
int slave = slink[--nlink];
dpdk_device_t * sdev = &dm->devices[slave];
@@ -1452,6 +1446,12 @@ 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];
}
}
}