From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:45037) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1c7VKu-0002xm-5K for qemu-devel@nongnu.org; Thu, 17 Nov 2016 17:39:17 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1c7VKq-0006lo-Ng for qemu-devel@nongnu.org; Thu, 17 Nov 2016 17:39:16 -0500 Received: from mx1.redhat.com ([209.132.183.28]:45090) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1c7VKq-0006kO-I0 for qemu-devel@nongnu.org; Thu, 17 Nov 2016 17:39:12 -0500 Date: Fri, 18 Nov 2016 00:39:10 +0200 From: "Michael S. Tsirkin" Message-ID: <20161118003856-mutt-send-email-mst@kernel.org> References: <1479419887-10515-1-git-send-email-maxime.coquelin@redhat.com> <1479419887-10515-3-git-send-email-maxime.coquelin@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1479419887-10515-3-git-send-email-maxime.coquelin@redhat.com> Subject: Re: [Qemu-devel] [RFC v2 2/3] vhost-net: Add new MTU feature support List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Maxime Coquelin Cc: aconole@redhat.com, pbonzini@redhat.com, qemu-devel@nongnu.org, jasowang@redhat.com, yuanhan.liu@linux.intel.com On Thu, Nov 17, 2016 at 10:58:06PM +0100, Maxime Coquelin wrote: > If VHOST_USER_F_MTU feature is negociated, vhost-net makes the negotiated > advised MTU available to virtio-net through a vhost_net_get_mtu() > call. > > Cc: Michael S. Tsirkin > Cc: Aaron Conole > Signed-off-by: Maxime Coquelin > --- > 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