From: Zhike Wang Date: Fri, 5 Jan 2018 10:28:06 +0000 (-0800) Subject: net/virtio: init MTU in case no control channel X-Git-Tag: spdx-start~313 X-Git-Url: http://git.droids-corp.org/?a=commitdiff_plain;h=240da8b2143b7be372cf6388f028b26b15f16776;p=dpdk.git net/virtio: init MTU in case no control channel The max_mtu is kept as zero in case no CRTL channel, which leads to failure when calling virtio_mtu_set(). Signed-off-by: Zhike Wang Acked-by: Zhiyong Yang Acked-by: Yuanhan Liu --- diff --git a/drivers/net/virtio/virtio_ethdev.c b/drivers/net/virtio/virtio_ethdev.c index ebb968c4bb..954989efc0 100644 --- a/drivers/net/virtio/virtio_ethdev.c +++ b/drivers/net/virtio/virtio_ethdev.c @@ -1482,6 +1482,8 @@ virtio_init_device(struct rte_eth_dev *eth_dev, uint64_t req_features) } else { PMD_INIT_LOG(DEBUG, "config->max_virtqueue_pairs=1"); hw->max_queue_pairs = 1; + hw->max_mtu = VIRTIO_MAX_RX_PKTLEN - ETHER_HDR_LEN - + VLAN_TAG_LEN - hw->vtnet_hdr_size; } ret = virtio_alloc_queues(eth_dev);