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 843061B026 for ; Fri, 5 Jan 2018 11:28:35 +0100 (CET) Received: from USHUB02.360buyAD.local (172.26.2.76) by hub04.360buyAD.local (172.17.27.18) with Microsoft SMTP Server (TLS) id 14.3.361.1; Fri, 5 Jan 2018 18:28:33 +0800 Received: from localhost.localdomain (39.109.125.70) by USHUB02.360buyAD.local (138.229.76.5) with Microsoft SMTP Server id 14.3.361.1; Fri, 5 Jan 2018 18:28:17 +0800 From: Zhike Wang To: CC: zhike wang Date: Fri, 5 Jan 2018 02:28:06 -0800 Message-ID: <1515148086-38104-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 10:28:36 -0000 From: zhike wang 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