net/thunderx: fix MTU configuration for jumbo packets
authorNitin Saxena <nitin.saxena@caviumnetworks.com>
Mon, 16 Apr 2018 10:44:47 +0000 (10:44 +0000)
committerFerruh Yigit <ferruh.yigit@intel.com>
Fri, 27 Apr 2018 14:54:56 +0000 (15:54 +0100)
commitc77875fbb8004c22e9910338f93b7be3e29ab9f9
tree5560ce66bc2eda9e09fc66eab6eb577a9643eac6
parent9a7a9072e7cd1745750bb63a3d02f053b2a830c3
net/thunderx: fix MTU configuration for jumbo packets

thunderx pmd driver passes dev_info.max_rx_pktlen as
9200 (via rte_eth_dev_info_get()) to application.
But, when application tries to set MTU as
(9200 - sizeof(ethernet_header_t)) the operation fails
because of missing CRC and VLAN additions.

This patch fixes the following for thunderx pmd driver:
 - Sets NIC_HW_MAX_FRS to 9216 (instead of 9200)
 - Sets NIC_HW_MAX_MTU to 9190 (NIC_HW_MAX_FRS - ETH_HLEN
   - ETHER_CRC_LEN - 2*VLAN_HLEN)
 - Sets dev_info->max_rx_pkt_len to NIC_HW_MAX_MTU +
   ETH_HLEN (instead of 9200)
 - Allows rte_eth_dev_set_mtu() to pass if application
   (like VPP) calls rte_eth_dev_set_mtu() before
   rte_eth_dev_start() by putting appropriate check for
   dev->data->dev_started

Fixes: 65d9804edc05 ("net/thunderx: support MTU configuration")
Cc: stable@dpdk.org
Signed-off-by: Nitin Saxena <nitin.saxena@caviumnetworks.com>
Acked-by: Jerin Jacob <jerin.jacob@caviumnetworks.com>
drivers/net/thunderx/base/nicvf_hw_defs.h
drivers/net/thunderx/nicvf_ethdev.c