qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Maxime Coquelin <maxime.coquelin@redhat.com>
To: mst@redhat.com, qemu-devel@nongnu.org
Cc: jasowang@redhat.com, Maxime Coquelin <maxime.coquelin@redhat.com>,
	Aaron Conole <aconole@redhat.com>
Subject: [Qemu-devel] [RFC 3/4] vhost-net: Add new MTU feature support
Date: Tue,  6 Sep 2016 18:11:08 +0200	[thread overview]
Message-ID: <1473178269-16718-4-git-send-email-maxime.coquelin@redhat.com> (raw)
In-Reply-To: <1473178269-16718-1-git-send-email-maxime.coquelin@redhat.com>

If VHOST_USER_F_MTU feature is negociated, vhost-net makes the
advised MTU available to virtio-net through a vhost_net_get_mtu()
call.

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      | 11 +++++++++++
 include/net/vhost_net.h |  2 ++
 2 files changed, 13 insertions(+)

diff --git a/hw/net/vhost_net.c b/hw/net/vhost_net.c
index f2d49ad..21057d6 100644
--- a/hw/net/vhost_net.c
+++ b/hw/net/vhost_net.c
@@ -74,6 +74,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 +436,11 @@ int vhost_set_vring_enable(NetClientState *nc, int enable)
     return 0;
 }
 
+uint64_t vhost_net_get_mtu(struct vhost_net *net)
+{
+    return net->dev.mtu;
+}
+
 #else
 uint64_t vhost_net_get_max_queues(VHostNetState *net)
 {
@@ -501,4 +507,9 @@ int vhost_set_vring_enable(NetClientState *nc, int enable)
 {
     return 0;
 }
+
+uint64_t vhost_net_get_mtu(struct vhost_net *net)
+{
+    return 0;
+}
 #endif
diff --git a/include/net/vhost_net.h b/include/net/vhost_net.h
index 5a08eff..37de17b 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);
 
+uint64_t vhost_net_get_mtu(struct vhost_net *net);
+
 #endif
-- 
2.7.4

  parent reply	other threads:[~2016-09-06 16:11 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-09-06 16:11 [Qemu-devel] [RFC 0/4] virtio-net: Add support to MTU feature Maxime Coquelin
2016-09-06 16:11 ` [Qemu-devel] [RFC 1/4] virtio-net: reuse MTU related bits from Linux header Maxime Coquelin
2016-09-06 16:11 ` [Qemu-devel] [RFC 2/4] vhost-user: Add new protocol feature MTU Maxime Coquelin
2016-09-06 16:11 ` Maxime Coquelin [this message]
2016-09-06 16:11 ` [Qemu-devel] [RFC 4/4] virtio-net: Add MTU feature support Maxime Coquelin
2016-09-15 22:16   ` Paolo Bonzini
2016-09-16  6:36     ` Maxime Coquelin

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=1473178269-16718-4-git-send-email-maxime.coquelin@redhat.com \
    --to=maxime.coquelin@redhat.com \
    --cc=aconole@redhat.com \
    --cc=jasowang@redhat.com \
    --cc=mst@redhat.com \
    --cc=qemu-devel@nongnu.org \
    /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).