From patchwork Wed May 11 09:52:04 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Denis V. Lunev" X-Patchwork-Id: 9066961 Return-Path: X-Original-To: patchwork-qemu-devel@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork2.web.kernel.org (Postfix) with ESMTP id 5014ABF29F for ; Wed, 11 May 2016 09:52:42 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id A6CB3201BB for ; Wed, 11 May 2016 09:52:41 +0000 (UTC) Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id D97CD20123 for ; Wed, 11 May 2016 09:52:40 +0000 (UTC) Received: from localhost ([::1]:51313 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1b0Qoq-0001KI-3K for patchwork-qemu-devel@patchwork.kernel.org; Wed, 11 May 2016 05:52:40 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:37731) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1b0Qod-0001Dk-2G for qemu-devel@nongnu.org; Wed, 11 May 2016 05:52:28 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1b0QoX-0000vH-1I for qemu-devel@nongnu.org; Wed, 11 May 2016 05:52:25 -0400 Received: from mailhub.sw.ru ([195.214.232.25]:37670 helo=relay.sw.ru) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1b0QoW-0000tj-JC for qemu-devel@nongnu.org; Wed, 11 May 2016 05:52:20 -0400 Received: from hades.sw.ru ([10.30.8.132]) by relay.sw.ru (8.13.4/8.13.4) with ESMTP id u4B9q52c026714; Wed, 11 May 2016 12:52:09 +0300 (MSK) From: "Denis V. Lunev" To: qemu-devel@nongnu.org Date: Wed, 11 May 2016 12:52:04 +0300 Message-Id: <1462960324-4655-3-git-send-email-den@openvz.org> X-Mailer: git-send-email 2.5.0 In-Reply-To: <1462960324-4655-1-git-send-email-den@openvz.org> References: <1462960324-4655-1-git-send-email-den@openvz.org> X-detected-operating-system: by eggs.gnu.org: OpenBSD 3.x X-Received-From: 195.214.232.25 Subject: [Qemu-devel] [RFC 2/2] virtio: show features acked by guest in 'info qtree' dump X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: den@openvz.org, "Michael S. Tsirkin" Errors-To: qemu-devel-bounces+patchwork-qemu-devel=patchwork.kernel.org@nongnu.org Sender: "Qemu-devel" X-Spam-Status: No, score=-6.9 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_HI, UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP It is very convinient and useful for debug purpose to expose the set of features negotiated with guest. The patch exports those features via read-only bit properties. Signed-off-by: Denis V. Lunev CC: Michael S. Tsirkin CC: Eric Blake --- hw/net/virtio-net.c | 44 ++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 44 insertions(+) diff --git a/hw/net/virtio-net.c b/hw/net/virtio-net.c index 5798f87..cb9ce9c 100644 --- a/hw/net/virtio-net.c +++ b/hw/net/virtio-net.c @@ -1904,6 +1904,50 @@ static Property virtio_net_properties[] = { DEFINE_PROP_BIT("ctrl_guest_offloads", VirtIONet, host_features, VIRTIO_NET_F_CTRL_GUEST_OFFLOADS, true), DEFINE_PROP_BIT("mq", VirtIONet, host_features, VIRTIO_NET_F_MQ, false), + + DEFINE_PROP_RO_BIT64("csum_acked", VirtIODevice, guest_features, + VIRTIO_NET_F_CSUM), + DEFINE_PROP_RO_BIT64("guest_csum_acked", VirtIODevice, guest_features, + VIRTIO_NET_F_GUEST_CSUM), + DEFINE_PROP_RO_BIT64("gso_acked", VirtIODevice, guest_features, + VIRTIO_NET_F_GSO), + DEFINE_PROP_RO_BIT64("guest_tso4_acked", VirtIODevice, guest_features, + VIRTIO_NET_F_GUEST_TSO4), + DEFINE_PROP_RO_BIT64("guest_tso6_acked", VirtIODevice, guest_features, + VIRTIO_NET_F_GUEST_TSO6), + DEFINE_PROP_RO_BIT64("guest_ecn_acked", VirtIODevice, guest_features, + VIRTIO_NET_F_GUEST_ECN), + DEFINE_PROP_RO_BIT64("guest_ufo_acked", VirtIODevice, guest_features, + VIRTIO_NET_F_GUEST_UFO), + DEFINE_PROP_RO_BIT64("guest_announce_acked", VirtIODevice, guest_features, + VIRTIO_NET_F_GUEST_ANNOUNCE), + DEFINE_PROP_RO_BIT64("host_tso4_acked", VirtIODevice, guest_features, + VIRTIO_NET_F_HOST_TSO4), + DEFINE_PROP_RO_BIT64("host_tso6_acked", VirtIODevice, guest_features, + VIRTIO_NET_F_HOST_TSO6), + DEFINE_PROP_RO_BIT64("host_ecn_acked", VirtIODevice, guest_features, + VIRTIO_NET_F_HOST_ECN), + DEFINE_PROP_RO_BIT64("host_ufo_acked", VirtIODevice, guest_features, + VIRTIO_NET_F_HOST_UFO), + DEFINE_PROP_RO_BIT64("mrg_rxbuf_acked", VirtIODevice, guest_features, + VIRTIO_NET_F_MRG_RXBUF), + DEFINE_PROP_RO_BIT64("status_acked", VirtIODevice, guest_features, + VIRTIO_NET_F_STATUS), + DEFINE_PROP_RO_BIT64("ctrl_vq_acked", VirtIODevice, guest_features, + VIRTIO_NET_F_CTRL_VQ), + DEFINE_PROP_RO_BIT64("ctrl_rx_acked", VirtIODevice, guest_features, + VIRTIO_NET_F_CTRL_RX), + DEFINE_PROP_RO_BIT64("ctrl_vlan_acked", VirtIODevice, guest_features, + VIRTIO_NET_F_CTRL_VLAN), + DEFINE_PROP_RO_BIT64("ctrl_rx_extra_acked", VirtIODevice, guest_features, + VIRTIO_NET_F_CTRL_RX_EXTRA), + DEFINE_PROP_RO_BIT64("ctrl_mac_addr_acked", VirtIODevice, guest_features, + VIRTIO_NET_F_CTRL_MAC_ADDR), + DEFINE_PROP_RO_BIT64("ctrl_guest_offloads_acked", VirtIODevice, + guest_features, VIRTIO_NET_F_CTRL_GUEST_OFFLOADS), + DEFINE_PROP_RO_BIT64("mq_acked", VirtIODevice, guest_features, + VIRTIO_NET_F_MQ), + DEFINE_NIC_PROPERTIES(VirtIONet, nic_conf), DEFINE_PROP_UINT32("x-txtimer", VirtIONet, net_conf.txtimer, TX_TIMER_INTERVAL),