net/iavf: set min and max MTU for VF
authorRobin Zhang <robinx.zhang@intel.com>
Sun, 27 Sep 2020 07:26:20 +0000 (07:26 +0000)
committerFerruh Yigit <ferruh.yigit@intel.com>
Fri, 9 Oct 2020 11:17:43 +0000 (13:17 +0200)
This commit sets the min and max supported MTU values for iavf VF
devices via the iavf_dev_info_get() function. Min MTU supported
is set to RTE_ETHER_MIN_MTU and max MTU is calculated as the max
packet length supported minus the transport overhead.

Signed-off-by: Robin Zhang <robinx.zhang@intel.com>
Acked-by: Qi Zhang <qi.z.zhang@intel.com>
drivers/net/iavf/iavf_ethdev.c

index ec19abb..81f2383 100644 (file)
@@ -540,6 +540,8 @@ iavf_dev_info_get(struct rte_eth_dev *dev, struct rte_eth_dev_info *dev_info)
        dev_info->max_tx_queues = vf->vsi_res->num_queue_pairs;
        dev_info->min_rx_bufsize = IAVF_BUF_SIZE_MIN;
        dev_info->max_rx_pktlen = IAVF_FRAME_SIZE_MAX;
+       dev_info->max_mtu = dev_info->max_rx_pktlen - IAVF_ETH_OVERHEAD;
+       dev_info->min_mtu = RTE_ETHER_MIN_MTU;
        dev_info->hash_key_size = vf->vf_res->rss_key_size;
        dev_info->reta_size = vf->vf_res->rss_lut_size;
        dev_info->flow_type_rss_offloads = IAVF_RSS_OFFLOAD_ALL;