From mboxrd@z Thu Jan 1 00:00:00 1970 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) Received: from HUB09.360buyAD.local (172.17.27.46) by HUB01.360buyAD.local (172.17.27.15) with Microsoft SMTP Server (TLS) id 14.3.361.1; Thu, 26 Oct 2017 11:09:30 +0800 Received: from USHUB01.360buyAD.local (172.26.2.75) by HUB09.360buyAD.local (172.17.27.46) with Microsoft SMTP Server (TLS) id 14.3.361.1; Thu, 26 Oct 2017 11:09:27 +0800 Received: from localhost.localdomain (39.109.125.67) by USHUB01.360buyAD.local (138.229.76.4) with Microsoft SMTP Server id 14.3.361.1; Thu, 26 Oct 2017 11:09:15 +0800 From: wangzhike To: , CC: , wangzhike Date: Wed, 25 Oct 2017 20:09:06 -0700 Message-ID: <1508987346-68173-1-git-send-email-wangzhike@jd.com> X-Mailer: git-send-email 1.8.3.1 MIME-Version: 1.0 Content-Type: text/plain X-Originating-IP: [39.109.125.67] Subject: [dpdk-dev] [PATCH] net/virtio: init MTU in case no control channel X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 26 Oct 2017 03:09:34 -0000 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