From mboxrd@z Thu Jan  1 00:00:00 1970
Return-Path: <maxime.coquelin@redhat.com>
Received: from mx1.redhat.com (mx1.redhat.com [209.132.183.28])
 by dpdk.org (Postfix) with ESMTP id 13446952
 for <dev@dpdk.org>; Mon,  6 Mar 2017 09:27:51 +0100 (CET)
Received: from int-mx13.intmail.prod.int.phx2.redhat.com
 (int-mx13.intmail.prod.int.phx2.redhat.com [10.5.11.26])
 (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))
 (No client certificate requested)
 by mx1.redhat.com (Postfix) with ESMTPS id 1CC2E8553E;
 Mon,  6 Mar 2017 08:27:52 +0000 (UTC)
Received: from max-t460s.redhat.com (ovpn-116-235.ams2.redhat.com
 [10.36.116.235])
 by int-mx13.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id
 v268RmvA006934; Mon, 6 Mar 2017 03:27:49 -0500
From: Maxime Coquelin <maxime.coquelin@redhat.com>
To: aconole@redhat.com, sodey@sonusnet.com, yuanhan.liu@linux.intel.com,
 jianfeng.tan@intel.com, dev@dpdk.org
Cc: Maxime Coquelin <maxime.coquelin@redhat.com>
Date: Mon,  6 Mar 2017 09:27:33 +0100
Message-Id: <20170306082740.5675-1-maxime.coquelin@redhat.com>
In-Reply-To: <20170213142820.8964-1-maxime.coquelin@redhat.com>
References: <20170213142820.8964-1-maxime.coquelin@redhat.com>
X-Scanned-By: MIMEDefang 2.68 on 10.5.11.26
X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16
 (mx1.redhat.com [10.5.110.28]); Mon, 06 Mar 2017 08:27:52 +0000 (UTC)
Subject: [dpdk-dev] [PATCH v2 0/7] virtio/vhost: Add MTU feature support
X-BeenThere: dev@dpdk.org
X-Mailman-Version: 2.1.15
Precedence: list
List-Id: DPDK patches and discussions <dev.dpdk.org>
List-Unsubscribe: <http://dpdk.org/ml/options/dev>,
 <mailto:dev-request@dpdk.org?subject=unsubscribe>
List-Archive: <http://dpdk.org/ml/archives/dev/>
List-Post: <mailto:dev@dpdk.org>
List-Help: <mailto:dev-request@dpdk.org?subject=help>
List-Subscribe: <http://dpdk.org/ml/listinfo/dev>,
 <mailto:dev-request@dpdk.org?subject=subscribe>
X-List-Received-Date: Mon, 06 Mar 2017 08:27:52 -0000

This series adds support to new Virtio's MTU feature[1]. The MTU
value is set via QEMU parameters.

If the feature is negotiated (i.e supported by both host andcguest,
and valid MTU value is set in QEMU via its host_mtu parameter), QEMU
shares the configured MTU value throught dedicated Vhost protocol
feature.

On vhost side, the value is stored in the virtio_net structure, and
made available to the application thanks to new vhost lib's
rte_vhost_mtu_get() function.

To be able to set eth_dev's MTU value at the right time, i.e. to call
rte_vhost_mtu_get() just after Virtio features have been negotiated
and before the device is really started, a new vhost flag has been
introduced (VIRTIO_DEV_READY), because the VIRTIO_DEV_RUNNING flag is
set too late (after .new_device() ops is called).

Regarding valid MTU values, the maximum MTU value accepted on vhost
side is 65535 bytes, as defined in Virtio Spec and supported in
Virtio-net Kernel driver. But in Virtio PMD, current maximum frame
size is 9728 bytes (~9700 bytes MTU). So maximum MTU size accepted in
Virtio PMD is the minimum between ~9700 bytes and host's MTU.

Finally, this series also adds MTU value printing  in testpmd's
"show port info" command when non-zero.

This series target v17.05 release.

Cheers,
Maxime

[1]: https://lists.oasis-open.org/archives/virtio-dev/201609/msg00128.html

Changes since v1:
-----------------
* Rebased on top of v17.02
* Virtio PMD: ensure MTU value is valid before ack'ing the feature (Aaron)
* Vhost lib/PMD: Remove MTU setting API/op (Yuanhan)

Maxime Coquelin (7):
  vhost: Enable VIRTIO_NET_F_MTU feature
  vhost: vhost-user: Add MTU protocol feature support
  vhost: Add new ready status flag
  vhost: Add API to get MTU value
  net/vhost: Fill rte_eth_dev's MTU property
  net/virtio: Add MTU feature support
  app/testpmd: print MTU value in show port info

 app/test-pmd/config.c               |  5 +++++
 doc/guides/nics/features/virtio.ini |  1 +
 drivers/net/vhost/rte_eth_vhost.c   |  2 ++
 drivers/net/virtio/virtio_ethdev.c  | 45 +++++++++++++++++++++++++++++++++++--
 drivers/net/virtio/virtio_ethdev.h  |  3 ++-
 drivers/net/virtio/virtio_pci.h     |  3 +++
 lib/librte_vhost/rte_virtio_net.h   | 15 +++++++++++++
 lib/librte_vhost/vhost.c            | 22 +++++++++++++++++-
 lib/librte_vhost/vhost.h            |  9 +++++++-
 lib/librte_vhost/vhost_user.c       | 44 ++++++++++++++++++++++++++++++------
 lib/librte_vhost/vhost_user.h       |  5 ++++-
 11 files changed, 141 insertions(+), 13 deletions(-)

-- 
2.9.3