From: Maxime Coquelin <maxime.coquelin@redhat.com>
To: mst@redhat.com, aconole@redhat.com, pbonzini@redhat.com,
qemu-devel@nongnu.org, jasowang@redhat.com,
yuanhan.liu@linux.intel.com
Cc: fbl@redhat.com, berrange@redhat.com, mlureau@redhat.com,
ktraynor@redhat.com, Maxime Coquelin <maxime.coquelin@redhat.com>
Subject: [Qemu-devel] [PATCH v4 2/3] vhost-net: Notify the backend about the host MTU
Date: Sat, 10 Dec 2016 16:30:37 +0100 [thread overview]
Message-ID: <20161210153038.9184-3-maxime.coquelin@redhat.com> (raw)
In-Reply-To: <20161210153038.9184-1-maxime.coquelin@redhat.com>
This patch provides a way for virtio-net to notify the
backend about the host MTU set by the user.
Cc: Michael S. Tsirkin <mst@redhat.com>
Cc: Aaron Conole <aconole@redhat.com>
Signed-off-by: Maxime Coquelin <maxime.coquelin@redhat.com>
---
hw/net/vhost_net.c | 18 ++++++++++++++++++
include/net/vhost_net.h | 2 ++
2 files changed, 20 insertions(+)
diff --git a/hw/net/vhost_net.c b/hw/net/vhost_net.c
index f2d49ad..6280422 100644
--- a/hw/net/vhost_net.c
+++ b/hw/net/vhost_net.c
@@ -51,6 +51,7 @@ static const int kernel_feature_bits[] = {
VIRTIO_RING_F_EVENT_IDX,
VIRTIO_NET_F_MRG_RXBUF,
VIRTIO_F_VERSION_1,
+ VIRTIO_NET_F_MTU,
VHOST_INVALID_FEATURE_BIT
};
@@ -74,6 +75,7 @@ static const int user_feature_bits[] = {
VIRTIO_NET_F_HOST_ECN,
VIRTIO_NET_F_HOST_UFO,
VIRTIO_NET_F_MRG_RXBUF,
+ VIRTIO_NET_F_MTU,
/* This bit implies RARP isn't sent by QEMU out of band */
VIRTIO_NET_F_GUEST_ANNOUNCE,
@@ -435,6 +437,17 @@ int vhost_set_vring_enable(NetClientState *nc, int enable)
return 0;
}
+int vhost_net_set_mtu(struct vhost_net *net, uint16_t mtu)
+{
+ const VhostOps *vhost_ops = net->dev.vhost_ops;
+
+ if (!vhost_ops->vhost_net_set_mtu) {
+ return 0;
+ }
+
+ return vhost_ops->vhost_net_set_mtu(&net->dev, mtu);
+}
+
#else
uint64_t vhost_net_get_max_queues(VHostNetState *net)
{
@@ -501,4 +514,9 @@ int vhost_set_vring_enable(NetClientState *nc, int enable)
{
return 0;
}
+
+int vhost_net_set_mtu(struct vhost_net *net, uint16_t mtu)
+{
+ return 0;
+}
#endif
diff --git a/include/net/vhost_net.h b/include/net/vhost_net.h
index 5a08eff..afc1499 100644
--- a/include/net/vhost_net.h
+++ b/include/net/vhost_net.h
@@ -35,4 +35,6 @@ int vhost_set_vring_enable(NetClientState * nc, int enable);
uint64_t vhost_net_get_acked_features(VHostNetState *net);
+int vhost_net_set_mtu(struct vhost_net *net, uint16_t mtu);
+
#endif
--
2.9.3
next prev parent reply other threads:[~2016-12-10 15:31 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-12-10 15:30 [Qemu-devel] [PATCH v4 0/3] virtio-net: Add support to MTU feature Maxime Coquelin
2016-12-10 15:30 ` [Qemu-devel] [PATCH v4 1/3] vhost-user: Add MTU protocol feature and op Maxime Coquelin
2016-12-10 15:30 ` Maxime Coquelin [this message]
2016-12-10 15:30 ` [Qemu-devel] [PATCH v4 3/3] virtio-net: Add MTU feature support Maxime Coquelin
2016-12-12 10:02 ` [Qemu-devel] [PATCH v4 0/3] virtio-net: Add support to MTU feature Daniel P. Berrange
2016-12-12 10:12 ` Maxime Coquelin
2016-12-12 10:34 ` Daniel P. Berrange
2016-12-13 13:04 ` Maxime Coquelin
2016-12-13 13:07 ` Daniel P. Berrange
2016-12-13 13:17 ` Maxime Coquelin
2017-01-10 3:43 ` Michael S. Tsirkin
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20161210153038.9184-3-maxime.coquelin@redhat.com \
--to=maxime.coquelin@redhat.com \
--cc=aconole@redhat.com \
--cc=berrange@redhat.com \
--cc=fbl@redhat.com \
--cc=jasowang@redhat.com \
--cc=ktraynor@redhat.com \
--cc=mlureau@redhat.com \
--cc=mst@redhat.com \
--cc=pbonzini@redhat.com \
--cc=qemu-devel@nongnu.org \
--cc=yuanhan.liu@linux.intel.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).