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 232B52951 for ; Fri, 5 Jan 2018 01:54:32 +0100 (CET) Received: from USHUB01.360buyAD.local (172.26.2.75) by HUB01.360buyAD.local (172.17.27.15) with Microsoft SMTP Server (TLS) id 14.3.361.1; Fri, 5 Jan 2018 08:54:32 +0800 Received: from localhost.localdomain (39.109.125.70) by USHUB01.360buyAD.local (138.229.76.4) with Microsoft SMTP Server id 14.3.361.1; Fri, 5 Jan 2018 08:54:29 +0800 From: zhike wang To: CC: zhike wang Date: Thu, 4 Jan 2018 16:54:14 -0800 Message-ID: <1515113654-2738-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.70] 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: Fri, 05 Jan 2018 00:54: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: zhike wang --- 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 21f2131..b7b3364 100644 --- a/drivers/net/virtio/virtio_ethdev.c +++ b/drivers/net/virtio/virtio_ethdev.c @@ -1479,6 +1479,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