From mboxrd@z Thu Jan 1 00:00:00 1970 From: wangzhike Subject: [PATCH] net/virtio: init MTU in case no control channel Date: Wed, 25 Oct 2017 20:09:06 -0700 Message-ID: <1508987346-68173-1-git-send-email-wangzhike@jd.com> Mime-Version: 1.0 Content-Type: text/plain Cc: , wangzhike To: , Return-path: Received: from smtp.jd.com (smtp.jd.com [58.83.206.59]) by dpdk.org (Postfix) with ESMTP id 9BD781BA22 for ; Thu, 26 Oct 2017 05:09:33 +0200 (CEST) List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" The max_mtu is kept as zero in case no CRTL channel, which leads to failure when calling virtio_mtu_set(). Signed-off-by: wangzhike --- drivers/net/virtio/virtio_ethdev.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/drivers/net/virtio/virtio_ethdev.c b/drivers/net/virtio/virtio_ethdev.c index bfbd737..823b3fd 100644 --- a/drivers/net/virtio/virtio_ethdev.c +++ b/drivers/net/virtio/virtio_ethdev.c @@ -1474,6 +1474,8 @@ static int virtio_dev_xstats_get_names(struct rte_eth_dev *dev, } 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); -- 1.8.3.1