From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:53996) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bhIy2-00077F-Aw for qemu-devel@nongnu.org; Tue, 06 Sep 2016 12:11:23 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1bhIy0-00077B-6T for qemu-devel@nongnu.org; Tue, 06 Sep 2016 12:11:21 -0400 Received: from mx1.redhat.com ([209.132.183.28]:59850) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bhIy0-000775-0x for qemu-devel@nongnu.org; Tue, 06 Sep 2016 12:11:20 -0400 Received: from int-mx09.intmail.prod.int.phx2.redhat.com (int-mx09.intmail.prod.int.phx2.redhat.com [10.5.11.22]) (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 B4C1B80F7C for ; Tue, 6 Sep 2016 16:11:19 +0000 (UTC) From: Maxime Coquelin Date: Tue, 6 Sep 2016 18:11:08 +0200 Message-Id: <1473178269-16718-4-git-send-email-maxime.coquelin@redhat.com> In-Reply-To: <1473178269-16718-1-git-send-email-maxime.coquelin@redhat.com> References: <1473178269-16718-1-git-send-email-maxime.coquelin@redhat.com> Subject: [Qemu-devel] [RFC 3/4] vhost-net: Add new MTU feature support List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: mst@redhat.com, qemu-devel@nongnu.org Cc: jasowang@redhat.com, Maxime Coquelin , Aaron Conole 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 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