net/thunderx: populate max and min MTU values
authorHanumanth Pothula <hpothula@marvell.com>
Tue, 24 May 2022 08:42:35 +0000 (14:12 +0530)
committerJerin Jacob <jerinj@marvell.com>
Mon, 13 Jun 2022 07:29:24 +0000 (09:29 +0200)
Populate maximum and minimum MTU values while retrieving
device information.

Signed-off-by: Hanumanth Pothula <hpothula@marvell.com>
drivers/net/thunderx/nicvf_ethdev.c

index 0f79b02..262c024 100644 (file)
@@ -1479,6 +1479,10 @@ nicvf_dev_info_get(struct rte_eth_dev *dev, struct rte_eth_dev_info *dev_info)
        dev_info->max_mac_addrs = 1;
        dev_info->max_vfs = pci_dev->max_vfs;
 
+       dev_info->max_mtu = dev_info->max_rx_pktlen -
+                               (RTE_ETHER_HDR_LEN + RTE_ETHER_CRC_LEN);
+       dev_info->min_mtu = dev_info->min_rx_bufsize - NIC_HW_L2_OVERHEAD;
+
        dev_info->rx_offload_capa = NICVF_RX_OFFLOAD_CAPA;
        dev_info->tx_offload_capa = NICVF_TX_OFFLOAD_CAPA;
        dev_info->rx_queue_offload_capa = NICVF_RX_OFFLOAD_CAPA;