dpdk: Fix MTU calc for NICs that support mtu<9216 01/10601/3
authorNitin Saxena <nitin.saxena@cavium.com>
Fri, 16 Feb 2018 11:21:38 +0000 (11:21 +0000)
committerDamjan Marion <dmarion.lists@gmail.com>
Mon, 19 Feb 2018 20:14:51 +0000 (20:14 +0000)
commitfa957142beae75e4cf881f7e861cefd97f034a83
tree59768ec6ffa1370dab537cf075b880b3eaa0a12c
parentc6969b55e40613479183141c01f057f9253f17a8
dpdk: Fix MTU calc for NICs that support mtu<9216

Problem: rte_eth_dev_set_mtu() returns with failure from ThunderX NICVF
DPDK PMD driver which supports MTU less than ETHERNET_MAX_PACKET_BYTES.
rte_eth_dev_set_mtu() being called twice from dpdk_lib_init(): one via
dpdk_device_setup() and second in dpdk_lib_init() itself. Currently
dpdk_lib_init() passes vnet_hardware_interface->max_packet_bytes as an
argument to rte_eth_dev_set_mtu() without consulting dev_info.max_rx_pktlen.
NICs like i4oe, ixgbe can support MTU much greater than 9216 hence its not
a problem for those NICS.

Fix: This patch calculates dpdk_device->port_conf.rxmode.max_rx_pkt_len,
vnet_hardware_interface->max_packet_bytes and MTU by consulting
dev_info.max_rx_pktlen.

Change-Id: If04bbfae49ee971dac0063ff1835e4a9c3087865
Signed-off-by: Nitin Saxena <nitin.saxena@cavium.com>
src/plugins/dpdk/device/init.c