From patchwork Thu Oct 26 03:09:06 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: =?utf-8?b?546L5b+X5YWL?= X-Patchwork-Id: 30930 X-Patchwork-Delegate: yuanhan.liu@linux.intel.com Return-Path: X-Original-To: patchwork@dpdk.org Delivered-To: patchwork@dpdk.org Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id BFB731BA5A; Thu, 26 Oct 2017 05:09:35 +0200 (CEST) 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 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: , 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 Acked-by: Yuanhan Liu --- 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);