From patchwork Wed Apr 29 15:24:03 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Shannon Zhao X-Patchwork-Id: 47726 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-lb0-f200.google.com (mail-lb0-f200.google.com [209.85.217.200]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id E7D832121F for ; Wed, 29 Apr 2015 15:26:13 +0000 (UTC) Received: by lbbqq2 with SMTP id qq2sf7253166lbb.0 for ; Wed, 29 Apr 2015 08:26:12 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:delivered-to:from:to:date :message-id:in-reply-to:references:cc:subject:precedence:list-id :list-unsubscribe:list-archive:list-post:list-help:list-subscribe :errors-to:sender:x-original-sender :x-original-authentication-results:mailing-list; bh=eW1f1GMAb9eG1XYp0AtMzOWVm7XBOgn7ZGl0fx3WL7k=; b=g3p2lZlZqSQzkyuFpZI/iYh5s6TNKu0TCZbYBfz59XUR/xTfV2+y2a43DZ92PS8PJH enxtZW/hloH3H362hDahXGH6xrbf5JuYanqZfH+ijtVWtEG/1r29ghU6qWJytLRQQG43 SMpbWbd3mKyaimUBkP2FlZn4s0atKGoyuAFLoSa66ooWP928E9UOH7WDOpQ8u7J3rrGi 8D8fcrokU1q89PVI1EPBzKPaeXqVEwZNeSIDcqTGUCBYDsnDcb3MAZVPHQsiHD4UIX2F +K+CsUNPd+/YaY3OWV27pVpXUPQKiHPezjNwCc4ZxiYO1JS/b2Tqrn1pSNAeOqziEuiJ aJ2w== X-Gm-Message-State: ALoCoQlbeQ2zD1Ufs0kuu9RM0eWot4UoWc6vjDqw3EdW9vmff7lA/ubuqBoYaRZ2sprjSC3Q5MAA X-Received: by 10.180.216.12 with SMTP id om12mr2191198wic.1.1430321172891; Wed, 29 Apr 2015 08:26:12 -0700 (PDT) MIME-Version: 1.0 X-BeenThere: patchwork-forward@linaro.org Received: by 10.152.182.228 with SMTP id eh4ls229706lac.45.gmail; Wed, 29 Apr 2015 08:26:12 -0700 (PDT) X-Received: by 10.112.230.37 with SMTP id sv5mr18988216lbc.85.1430321172655; Wed, 29 Apr 2015 08:26:12 -0700 (PDT) Received: from mail-lb0-f179.google.com (mail-lb0-f179.google.com. [209.85.217.179]) by mx.google.com with ESMTPS id ur11si19598334lac.39.2015.04.29.08.26.12 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 29 Apr 2015 08:26:12 -0700 (PDT) Received-SPF: pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.217.179 as permitted sender) client-ip=209.85.217.179; Received: by lbbqq2 with SMTP id qq2so22975037lbb.3 for ; Wed, 29 Apr 2015 08:26:12 -0700 (PDT) X-Received: by 10.112.161.226 with SMTP id xv2mr19551268lbb.106.1430321172488; Wed, 29 Apr 2015 08:26:12 -0700 (PDT) X-Forwarded-To: patchwork-forward@linaro.org X-Forwarded-For: patch@linaro.org patchwork-forward@linaro.org Delivered-To: patch@linaro.org Received: by 10.112.67.65 with SMTP id l1csp2573971lbt; Wed, 29 Apr 2015 08:26:11 -0700 (PDT) X-Received: by 10.55.15.213 with SMTP id 82mr28874186qkp.86.1430321171000; Wed, 29 Apr 2015 08:26:11 -0700 (PDT) Received: from lists.gnu.org (lists.gnu.org. [2001:4830:134:3::11]) by mx.google.com with ESMTPS id i101si21216939qkh.59.2015.04.29.08.26.10 for (version=TLSv1 cipher=RC4-SHA bits=128/128); Wed, 29 Apr 2015 08:26:10 -0700 (PDT) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 2001:4830:134:3::11 as permitted sender) client-ip=2001:4830:134:3::11; Received: from localhost ([::1]:39639 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YnTsI-0006i9-3R for patch@linaro.org; Wed, 29 Apr 2015 11:26:10 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:36525) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YnTrI-0005wq-2X for qemu-devel@nongnu.org; Wed, 29 Apr 2015 11:25:14 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1YnTrE-0004EK-CQ for qemu-devel@nongnu.org; Wed, 29 Apr 2015 11:25:08 -0400 Received: from mail-pa0-f45.google.com ([209.85.220.45]:35033) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YnTrE-0004DJ-4n for qemu-devel@nongnu.org; Wed, 29 Apr 2015 11:25:04 -0400 Received: by pabtp1 with SMTP id tp1so30790939pab.2 for ; Wed, 29 Apr 2015 08:25:03 -0700 (PDT) X-Received: by 10.67.7.162 with SMTP id dd2mr41911361pad.151.1430321103456; Wed, 29 Apr 2015 08:25:03 -0700 (PDT) Received: from localhost.localdomain ([180.150.153.56]) by mx.google.com with ESMTPSA id cu8sm25875045pad.1.2015.04.29.08.24.58 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Wed, 29 Apr 2015 08:25:02 -0700 (PDT) From: Shannon Zhao To: qemu-devel@nongnu.org Date: Wed, 29 Apr 2015 23:24:03 +0800 Message-Id: <1430321049-11859-2-git-send-email-shannon.zhao@linaro.org> X-Mailer: git-send-email 2.1.0 In-Reply-To: <1430321049-11859-1-git-send-email-shannon.zhao@linaro.org> References: <1430321049-11859-1-git-send-email-shannon.zhao@linaro.org> X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] [fuzzy] X-Received-From: 209.85.220.45 Cc: peter.maydell@linaro.org, hangaohuai@huawei.com, mst@redhat.com, peter.huangpeng@huawei.com, shannon.zhao@linaro.org, zhaoshenglong@huawei.com, pbonzini@redhat.com, christoffer.dall@linaro.org Subject: [Qemu-devel] [PATCH 1/7] virtio-net: move qdev properties into virtio-net.c X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: , List-Help: , List-Subscribe: , Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: qemu-devel-bounces+patch=linaro.org@nongnu.org X-Removed-Original-Auth: Dkim didn't pass. X-Original-Sender: shannon.zhao@linaro.org X-Original-Authentication-Results: mx.google.com; spf=pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.217.179 as permitted sender) smtp.mail=patch+caf_=patchwork-forward=linaro.org@linaro.org Mailing-list: list patchwork-forward@linaro.org; contact patchwork-forward+owners@linaro.org X-Google-Group-Id: 836684582541 As only one place in virtio-net.c uses DEFINE_VIRTIO_NET_FEATURES, there is no need to expose it. Inline it into virtio-net.c to avoid wrongly use. Signed-off-by: Shannon Zhao Signed-off-by: Shannon Zhao --- hw/net/virtio-net.c | 42 +++++++++++++++++++++++++++++++++++++++++- include/hw/virtio/virtio-net.h | 24 ------------------------ 2 files changed, 41 insertions(+), 25 deletions(-) diff --git a/hw/net/virtio-net.c b/hw/net/virtio-net.c index 5c38ac2..6ed2e78 100644 --- a/hw/net/virtio-net.c +++ b/hw/net/virtio-net.c @@ -1725,7 +1725,47 @@ static void virtio_net_instance_init(Object *obj) } static Property virtio_net_properties[] = { - DEFINE_VIRTIO_NET_FEATURES(VirtIONet, host_features), + DEFINE_PROP_BIT("any_layout", VirtIONet, host_features, VIRTIO_F_ANY_LAYOUT, + true), + DEFINE_PROP_BIT("csum", VirtIONet, host_features, VIRTIO_NET_F_CSUM, true), + DEFINE_PROP_BIT("guest_csum", VirtIONet, host_features, + VIRTIO_NET_F_GUEST_CSUM, true), + DEFINE_PROP_BIT("gso", VirtIONet, host_features, VIRTIO_NET_F_GSO, true), + DEFINE_PROP_BIT("guest_tso4", VirtIONet, host_features, + VIRTIO_NET_F_GUEST_TSO4, true), + DEFINE_PROP_BIT("guest_tso6", VirtIONet, host_features, + VIRTIO_NET_F_GUEST_TSO6, true), + DEFINE_PROP_BIT("guest_ecn", VirtIONet, host_features, + VIRTIO_NET_F_GUEST_ECN, true), + DEFINE_PROP_BIT("guest_ufo", VirtIONet, host_features, + VIRTIO_NET_F_GUEST_UFO, true), + DEFINE_PROP_BIT("guest_announce", VirtIONet, host_features, + VIRTIO_NET_F_GUEST_ANNOUNCE, true), + DEFINE_PROP_BIT("host_tso4", VirtIONet, host_features, + VIRTIO_NET_F_HOST_TSO4, true), + DEFINE_PROP_BIT("host_tso6", VirtIONet, host_features, + VIRTIO_NET_F_HOST_TSO6, true), + DEFINE_PROP_BIT("host_ecn", VirtIONet, host_features, VIRTIO_NET_F_HOST_ECN, + true), + DEFINE_PROP_BIT("host_ufo", VirtIONet, host_features, VIRTIO_NET_F_HOST_UFO, + true), + DEFINE_PROP_BIT("mrg_rxbuf", VirtIONet, host_features, + VIRTIO_NET_F_MRG_RXBUF, true), + DEFINE_PROP_BIT("status", VirtIONet, host_features, VIRTIO_NET_F_STATUS, + true), + DEFINE_PROP_BIT("ctrl_vq", VirtIONet, host_features, VIRTIO_NET_F_CTRL_VQ, + true), + DEFINE_PROP_BIT("ctrl_rx", VirtIONet, host_features, VIRTIO_NET_F_CTRL_RX, + true), + DEFINE_PROP_BIT("ctrl_vlan", VirtIONet, host_features, + VIRTIO_NET_F_CTRL_VLAN, true), + DEFINE_PROP_BIT("ctrl_rx_extra", VirtIONet, host_features, + VIRTIO_NET_F_CTRL_RX_EXTRA, true), + DEFINE_PROP_BIT("ctrl_mac_addr", VirtIONet, host_features, + VIRTIO_NET_F_CTRL_MAC_ADDR, true), + 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_NIC_PROPERTIES(VirtIONet, nic_conf), DEFINE_PROP_UINT32("x-txtimer", VirtIONet, net_conf.txtimer, TX_TIMER_INTERVAL), diff --git a/include/hw/virtio/virtio-net.h b/include/hw/virtio/virtio-net.h index e0dbb41..c142b42 100644 --- a/include/hw/virtio/virtio-net.h +++ b/include/hw/virtio/virtio-net.h @@ -109,30 +109,6 @@ typedef struct VirtIONet { #define VIRTIO_NET_CTRL_GUEST_OFFLOADS 5 #define VIRTIO_NET_CTRL_GUEST_OFFLOADS_SET 0 -#define DEFINE_VIRTIO_NET_FEATURES(_state, _field) \ - DEFINE_PROP_BIT("any_layout", _state, _field, VIRTIO_F_ANY_LAYOUT, true), \ - DEFINE_PROP_BIT("csum", _state, _field, VIRTIO_NET_F_CSUM, true), \ - DEFINE_PROP_BIT("guest_csum", _state, _field, VIRTIO_NET_F_GUEST_CSUM, true), \ - DEFINE_PROP_BIT("gso", _state, _field, VIRTIO_NET_F_GSO, true), \ - DEFINE_PROP_BIT("guest_tso4", _state, _field, VIRTIO_NET_F_GUEST_TSO4, true), \ - DEFINE_PROP_BIT("guest_tso6", _state, _field, VIRTIO_NET_F_GUEST_TSO6, true), \ - DEFINE_PROP_BIT("guest_ecn", _state, _field, VIRTIO_NET_F_GUEST_ECN, true), \ - DEFINE_PROP_BIT("guest_ufo", _state, _field, VIRTIO_NET_F_GUEST_UFO, true), \ - DEFINE_PROP_BIT("guest_announce", _state, _field, VIRTIO_NET_F_GUEST_ANNOUNCE, true), \ - DEFINE_PROP_BIT("host_tso4", _state, _field, VIRTIO_NET_F_HOST_TSO4, true), \ - DEFINE_PROP_BIT("host_tso6", _state, _field, VIRTIO_NET_F_HOST_TSO6, true), \ - DEFINE_PROP_BIT("host_ecn", _state, _field, VIRTIO_NET_F_HOST_ECN, true), \ - DEFINE_PROP_BIT("host_ufo", _state, _field, VIRTIO_NET_F_HOST_UFO, true), \ - DEFINE_PROP_BIT("mrg_rxbuf", _state, _field, VIRTIO_NET_F_MRG_RXBUF, true), \ - DEFINE_PROP_BIT("status", _state, _field, VIRTIO_NET_F_STATUS, true), \ - DEFINE_PROP_BIT("ctrl_vq", _state, _field, VIRTIO_NET_F_CTRL_VQ, true), \ - DEFINE_PROP_BIT("ctrl_rx", _state, _field, VIRTIO_NET_F_CTRL_RX, true), \ - DEFINE_PROP_BIT("ctrl_vlan", _state, _field, VIRTIO_NET_F_CTRL_VLAN, true), \ - DEFINE_PROP_BIT("ctrl_rx_extra", _state, _field, VIRTIO_NET_F_CTRL_RX_EXTRA, true), \ - DEFINE_PROP_BIT("ctrl_mac_addr", _state, _field, VIRTIO_NET_F_CTRL_MAC_ADDR, true), \ - DEFINE_PROP_BIT("ctrl_guest_offloads", _state, _field, VIRTIO_NET_F_CTRL_GUEST_OFFLOADS, true), \ - DEFINE_PROP_BIT("mq", _state, _field, VIRTIO_NET_F_MQ, false) - #define DEFINE_VIRTIO_NET_PROPERTIES(_state, _field) \ DEFINE_PROP_UINT32("x-txtimer", _state, _field.txtimer, TX_TIMER_INTERVAL),\ DEFINE_PROP_INT32("x-txburst", _state, _field.txburst, TX_BURST), \