net/vhost: set MTU
authorMaxime Coquelin <maxime.coquelin@redhat.com>
Sun, 12 Mar 2017 16:34:03 +0000 (17:34 +0100)
committerYuanhan Liu <yuanhan.liu@linux.intel.com>
Sat, 1 Apr 2017 08:36:17 +0000 (10:36 +0200)
This patch adds a call to rte_vhost_mtu_get() at device creation
time to fill device's MTU property when available.

This makes the MTU value defined in QEMU cmdline accessible to the
application by calling rte_eth_dev_get_mtu().

Signed-off-by: Maxime Coquelin <maxime.coquelin@redhat.com>
Acked-by: Yuanhan Liu <yuanhan.liu@linux.intel.com>
drivers/net/vhost/rte_eth_vhost.c

index 21a4c01..a72c060 100644 (file)
@@ -598,6 +598,8 @@ new_device(int vid)
        for (i = 0; i < rte_vhost_get_queue_num(vid) * VIRTIO_QNUM; i++)
                rte_vhost_enable_guest_notification(vid, i, 0);
 
+       rte_vhost_get_mtu(vid, &eth_dev->data->mtu);
+
        eth_dev->data->dev_link.link_status = ETH_LINK_UP;
 
        rte_atomic32_set(&internal->dev_attached, 1);