net/virtio: report maximum MTU in device info
authorIvan Ilchenko <ivan.ilchenko@oktetlabs.ru>
Wed, 21 Jul 2021 09:22:25 +0000 (12:22 +0300)
committerChenbo Xia <chenbo.xia@intel.com>
Wed, 28 Jul 2021 06:20:20 +0000 (08:20 +0200)
Fix the driver to report maximum MTU obtained from config if
VIRTIO_NET_F_MTU is supported or calculated based on maximum
Rx packet length.

Fixes: ad97ceece12c ("ethdev: add min/max MTU to device info")
Cc: stable@dpdk.org
Signed-off-by: Ivan Ilchenko <ivan.ilchenko@oktetlabs.ru>
Signed-off-by: Andrew Rybchenko <andrew.rybchenko@oktetlabs.ru>
Reviewed-by: Maxime Coquelin <maxime.coquelin@redhat.com>
drivers/net/virtio/virtio_ethdev.c

index 72d3dda..a4adeec 100644 (file)
@@ -2504,6 +2504,7 @@ virtio_dev_info_get(struct rte_eth_dev *dev, struct rte_eth_dev_info *dev_info)
        dev_info->min_rx_bufsize = VIRTIO_MIN_RX_BUFSIZE;
        dev_info->max_rx_pktlen = VIRTIO_MAX_RX_PKTLEN;
        dev_info->max_mac_addrs = VIRTIO_MAX_MAC_ADDRS;
+       dev_info->max_mtu = hw->max_mtu;
 
        host_features = VIRTIO_OPS(hw)->get_features(hw);
        dev_info->rx_offload_capa = DEV_RX_OFFLOAD_VLAN_STRIP;