From patchwork Sun Mar 12 16:34:03 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Maxime Coquelin X-Patchwork-Id: 21713 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 [IPv6:::1]) by dpdk.org (Postfix) with ESMTP id 52EFFD145; Sun, 12 Mar 2017 17:35:10 +0100 (CET) Received: from mx1.redhat.com (mx1.redhat.com [209.132.183.28]) by dpdk.org (Postfix) with ESMTP id 05C4ACF7A for ; Sun, 12 Mar 2017 17:34:38 +0100 (CET) Received: from smtp.corp.redhat.com (int-mx16.intmail.prod.int.phx2.redhat.com [10.5.11.28]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 6604780467; Sun, 12 Mar 2017 16:34:38 +0000 (UTC) Received: from max-t460s.redhat.com (ovpn-116-39.ams2.redhat.com [10.36.116.39]) by smtp.corp.redhat.com (Postfix) with ESMTP id F32AD2D5C4; Sun, 12 Mar 2017 16:34:34 +0000 (UTC) From: Maxime Coquelin To: aconole@redhat.com, sodey@sonusnet.com, yuanhan.liu@linux.intel.com, jianfeng.tan@intel.com, thomas.monjalon@6wind.com, dev@dpdk.org Cc: Maxime Coquelin Date: Sun, 12 Mar 2017 17:34:03 +0100 Message-Id: <20170312163406.17714-7-maxime.coquelin@redhat.com> In-Reply-To: <20170312163406.17714-1-maxime.coquelin@redhat.com> References: <20170213142820.8964-1-maxime.coquelin@redhat.com> <20170312163406.17714-1-maxime.coquelin@redhat.com> X-Scanned-By: MIMEDefang 2.74 on 10.5.11.28 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.28]); Sun, 12 Mar 2017 16:34:38 +0000 (UTC) Subject: [dpdk-dev] [PATCH v3 6/9] net/vhost: Fill rte_eth_dev's MTU property 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" This patch adds a call to rte_vhost_mtu_get() at device creation time to fill device's MTU property when available. This makes the MTU value defined in QEMU cmdline accessible to the application by calling rte_eth_dev_get_mtu(). Signed-off-by: Maxime Coquelin --- drivers/net/vhost/rte_eth_vhost.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/drivers/net/vhost/rte_eth_vhost.c b/drivers/net/vhost/rte_eth_vhost.c index e98cffd..36814cb 100644 --- a/drivers/net/vhost/rte_eth_vhost.c +++ b/drivers/net/vhost/rte_eth_vhost.c @@ -575,6 +575,8 @@ new_device(int vid) for (i = 0; i < rte_vhost_get_queue_num(vid) * VIRTIO_QNUM; i++) rte_vhost_enable_guest_notification(vid, i, 0); + rte_vhost_get_mtu(vid, ð_dev->data->mtu); + eth_dev->data->dev_link.link_status = ETH_LINK_UP; rte_atomic32_set(&internal->dev_attached, 1);