From patchwork Fri Apr 17 12:13:45 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Shannon Zhao X-Patchwork-Id: 47286 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-wi0-f200.google.com (mail-wi0-f200.google.com [209.85.212.200]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id AB8882121F for ; Fri, 17 Apr 2015 13:16:57 +0000 (UTC) Received: by widjs5 with SMTP id js5sf4169477wid.3 for ; Fri, 17 Apr 2015 06:16:57 -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=lGHgvjdXMc6EaVXBhhJCy+ST/cIcS/vmZrrDcBay3YM=; b=Vxuyo9uiLt0HyTkmvvkjNoA0a81iAQVCEf7vRz9y3tNejgJHRzvotiXF54FeDJh840 Jvds5bx44qB8LDqoWuT46WDVa8RQKxUWoXKX2dv/LoYX5J+yKLJOtzZvbSoTKcMIuvpN 1/JF90h+89ZC7dGdPkp9Eemf+igJd0+IP3Fgjfyq/fCvNgMZnh8uW+qtDvX+IqRXmSpO dVwU4NVULTkoczy268yPy6ckomhI8GwHzjsNg3vErCZ27VhWHz+mviH0wokrvWuL9jUq m91cWaEIloexwyIoteT8PamdBUi9Fe28njz9luAnuoE23FE6mC4btam9fDxVD/4RTK2v g21Q== X-Gm-Message-State: ALoCoQk1o6ImMaxFP5+ZE436qfZLJdNvB6yl0I4JN4ug/NUQ9DEoRwJKKac6Qah/FB2uZ8qJ9Wy4 X-Received: by 10.152.5.168 with SMTP id t8mr1441348lat.3.1429276617020; Fri, 17 Apr 2015 06:16:57 -0700 (PDT) MIME-Version: 1.0 X-BeenThere: patchwork-forward@linaro.org Received: by 10.152.205.70 with SMTP id le6ls518161lac.50.gmail; Fri, 17 Apr 2015 06:16:56 -0700 (PDT) X-Received: by 10.152.120.106 with SMTP id lb10mr3503423lab.92.1429276616880; Fri, 17 Apr 2015 06:16:56 -0700 (PDT) Received: from mail-lb0-f176.google.com (mail-lb0-f176.google.com. [209.85.217.176]) by mx.google.com with ESMTPS id k7si3033591lbj.50.2015.04.17.06.16.56 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 17 Apr 2015 06:16:56 -0700 (PDT) Received-SPF: pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.217.176 as permitted sender) client-ip=209.85.217.176; Received: by lbbuc2 with SMTP id uc2so82621828lbb.2 for ; Fri, 17 Apr 2015 06:16:56 -0700 (PDT) X-Received: by 10.152.116.11 with SMTP id js11mr3563785lab.106.1429276616755; Fri, 17 Apr 2015 06:16:56 -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 l1csp3730681lbt; Fri, 17 Apr 2015 06:16:56 -0700 (PDT) X-Received: by 10.140.91.18 with SMTP id y18mr3230693qgd.90.1429276615530; Fri, 17 Apr 2015 06:16:55 -0700 (PDT) Received: from lists.gnu.org (lists.gnu.org. [2001:4830:134:3::11]) by mx.google.com with ESMTPS id 81si11595564qkv.15.2015.04.17.06.16.54 for (version=TLSv1 cipher=RC4-SHA bits=128/128); Fri, 17 Apr 2015 06:16:55 -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]:41342 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Yj68c-0008KX-D0 for patch@linaro.org; Fri, 17 Apr 2015 09:16:54 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:57075) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Yj5Ah-0005Lb-Cf for qemu-devel@nongnu.org; Fri, 17 Apr 2015 08:15:00 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Yj5Ad-00023M-3N for qemu-devel@nongnu.org; Fri, 17 Apr 2015 08:14:59 -0400 Received: from mail-pa0-f53.google.com ([209.85.220.53]:33504) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Yj5Ac-000237-UM for qemu-devel@nongnu.org; Fri, 17 Apr 2015 08:14:55 -0400 Received: by paboj16 with SMTP id oj16so123772447pab.0 for ; Fri, 17 Apr 2015 05:14:54 -0700 (PDT) X-Received: by 10.68.252.106 with SMTP id zr10mr5006031pbc.79.1429272894536; Fri, 17 Apr 2015 05:14:54 -0700 (PDT) Received: from localhost.localdomain ([180.150.153.56]) by mx.google.com with ESMTPSA id nb10sm10006492pdb.76.2015.04.17.05.14.51 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Fri, 17 Apr 2015 05:14:53 -0700 (PDT) From: Shannon Zhao To: qemu-devel@nongnu.org Date: Fri, 17 Apr 2015 20:13:45 +0800 Message-Id: <1429272826-4145-4-git-send-email-shannon.zhao@linaro.org> X-Mailer: git-send-email 2.1.0 In-Reply-To: <1429272826-4145-1-git-send-email-shannon.zhao@linaro.org> References: <1429272826-4145-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.53 X-Mailman-Approved-At: Fri, 17 Apr 2015 09:13:08 -0400 Cc: peter.maydell@linaro.org, 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 3/4] hw/net/virtio-net: Move DEFINE_VIRTIO_NET_FEATURES to virtio-net 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.176 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 Move DEFINE_VIRTIO_NET_FEATURES to the backend virtio-net. The transports just sync the host features from backend. Signed-off-by: Shannon Zhao Signed-off-by: Shannon Zhao --- hw/net/virtio-net.c | 4 ++++ hw/s390x/s390-virtio-bus.c | 1 - hw/s390x/virtio-ccw.c | 1 - hw/virtio/virtio-pci.c | 1 - include/hw/virtio/virtio-net.h | 1 + 5 files changed, 5 insertions(+), 3 deletions(-) diff --git a/hw/net/virtio-net.c b/hw/net/virtio-net.c index 27adcc5..5d72e2d 100644 --- a/hw/net/virtio-net.c +++ b/hw/net/virtio-net.c @@ -446,6 +446,9 @@ static uint32_t virtio_net_get_features(VirtIODevice *vdev, uint32_t features) VirtIONet *n = VIRTIO_NET(vdev); NetClientState *nc = qemu_get_queue(n->nic); + /* First sync all virtio-net possible supported features */ + features |= n->host_features; + virtio_add_feature(&features, VIRTIO_NET_F_MAC); if (!peer_has_vnet_hdr(n)) { @@ -1714,6 +1717,7 @@ static void virtio_net_instance_init(Object *obj) } static Property virtio_net_properties[] = { + DEFINE_VIRTIO_NET_FEATURES(VirtIONet, host_features), DEFINE_NIC_PROPERTIES(VirtIONet, nic_conf), DEFINE_PROP_UINT32("x-txtimer", VirtIONet, net_conf.txtimer, TX_TIMER_INTERVAL), diff --git a/hw/s390x/s390-virtio-bus.c b/hw/s390x/s390-virtio-bus.c index 31fdf94..49c13e2 100644 --- a/hw/s390x/s390-virtio-bus.c +++ b/hw/s390x/s390-virtio-bus.c @@ -517,7 +517,6 @@ static void virtio_s390_device_plugged(DeviceState *d) static Property s390_virtio_net_properties[] = { DEFINE_VIRTIO_COMMON_FEATURES(VirtIOS390Device, host_features), - DEFINE_VIRTIO_NET_FEATURES(VirtIOS390Device, host_features), DEFINE_PROP_END_OF_LIST(), }; diff --git a/hw/s390x/virtio-ccw.c b/hw/s390x/virtio-ccw.c index 30ca377..acd3844 100644 --- a/hw/s390x/virtio-ccw.c +++ b/hw/s390x/virtio-ccw.c @@ -1409,7 +1409,6 @@ static void virtio_ccw_device_plugged(DeviceState *d) static Property virtio_ccw_net_properties[] = { DEFINE_PROP_STRING("devno", VirtioCcwDevice, bus_id), - DEFINE_VIRTIO_NET_FEATURES(VirtioCcwDevice, host_features[0]), DEFINE_PROP_BIT("ioeventfd", VirtioCcwDevice, flags, VIRTIO_CCW_FLAG_USE_IOEVENTFD_BIT, true), DEFINE_PROP_END_OF_LIST(), diff --git a/hw/virtio/virtio-pci.c b/hw/virtio/virtio-pci.c index c7c3f72..772244e 100644 --- a/hw/virtio/virtio-pci.c +++ b/hw/virtio/virtio-pci.c @@ -1360,7 +1360,6 @@ static Property virtio_net_properties[] = { DEFINE_PROP_BIT("ioeventfd", VirtIOPCIProxy, flags, VIRTIO_PCI_FLAG_USE_IOEVENTFD_BIT, false), DEFINE_PROP_UINT32("vectors", VirtIOPCIProxy, nvectors, 3), - DEFINE_VIRTIO_NET_FEATURES(VirtIOPCIProxy, host_features), DEFINE_PROP_END_OF_LIST(), }; diff --git a/include/hw/virtio/virtio-net.h b/include/hw/virtio/virtio-net.h index 4c2fe83..5bee4df 100644 --- a/include/hw/virtio/virtio-net.h +++ b/include/hw/virtio/virtio-net.h @@ -68,6 +68,7 @@ typedef struct VirtIONet { uint32_t has_vnet_hdr; size_t host_hdr_len; size_t guest_hdr_len; + uint32_t host_features; uint8_t has_ufo; int mergeable_rx_bufs; uint8_t promisc;