From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mga04.intel.com (mga04.intel.com [192.55.52.120]) by dpdk.org (Postfix) with ESMTP id 4A5718D97 for ; Mon, 18 Jan 2016 17:50:20 +0100 (CET) Received: from fmsmga002.fm.intel.com ([10.253.24.26]) by fmsmga104.fm.intel.com with ESMTP; 18 Jan 2016 08:50:19 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.22,313,1449561600"; d="scan'208";a="895818347" Received: from fmsmsx107.amr.corp.intel.com ([10.18.124.205]) by fmsmga002.fm.intel.com with ESMTP; 18 Jan 2016 08:50:20 -0800 Received: from fmsmsx111.amr.corp.intel.com (10.18.116.5) by fmsmsx107.amr.corp.intel.com (10.18.124.205) with Microsoft SMTP Server (TLS) id 14.3.248.2; Mon, 18 Jan 2016 08:50:19 -0800 Received: from shsmsx152.ccr.corp.intel.com (10.239.6.52) by fmsmsx111.amr.corp.intel.com (10.18.116.5) with Microsoft SMTP Server (TLS) id 14.3.248.2; Mon, 18 Jan 2016 08:50:18 -0800 Received: from shsmsx101.ccr.corp.intel.com ([169.254.1.215]) by SHSMSX152.ccr.corp.intel.com ([169.254.6.209]) with mapi id 14.03.0248.002; Tue, 19 Jan 2016 00:50:16 +0800 From: "Xie, Huawei" To: Yuanhan Liu , "dev@dpdk.org" Thread-Topic: [PATCH v4 7/8] virtio: add 1.0 support Thread-Index: AdFSEE7F024IClH9QuSR9YlAzWxVyw== Date: Mon, 18 Jan 2016 16:50:16 +0000 Message-ID: References: <1452581944-24838-1-git-send-email-yuanhan.liu@linux.intel.com> <1452832571-6156-1-git-send-email-yuanhan.liu@linux.intel.com> <1452832571-6156-8-git-send-email-yuanhan.liu@linux.intel.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-originating-ip: [10.239.4.80] Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Subject: Re: [dpdk-dev] [PATCH v4 7/8] virtio: add 1.0 support X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: patches and discussions about DPDK List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 18 Jan 2016 16:50:20 -0000 On 1/15/2016 12:34 PM, Yuanhan Liu wrote:=0A= > -static void=0A= > +static int=0A= > virtio_negotiate_features(struct virtio_hw *hw)=0A= > {=0A= > uint64_t host_features;=0A= > @@ -949,6 +949,22 @@ virtio_negotiate_features(struct virtio_hw *hw)=0A= > hw->guest_features =3D vtpci_negotiate_features(hw, host_features);=0A= =0A= Here if we are not modern device, we should remove VIRTIO_F_VERSION_1 in=0A= guest features.=0A= =0A= > PMD_INIT_LOG(DEBUG, "features after negotiate =3D %"PRIx64,=0A= > hw->guest_features);=0A= > +=0A= > + if (hw->modern) {=0A= > + if (!vtpci_with_feature(hw, VIRTIO_F_VERSION_1)) {=0A= > + PMD_INIT_LOG(ERR,=0A= > + "VIRTIO_F_VERSION_1 features is not enabled.");=0A= > + return -1;=0A= > + }=0A= > + vtpci_set_status(hw, VIRTIO_CONFIG_STATUS_FEATURES_OK);=0A= > + if (!(vtpci_get_status(hw) & VIRTIO_CONFIG_STATUS_FEATURES_OK)) {=0A= > + PMD_INIT_LOG(ERR,=0A= > + "failed to set FEATURES_OK status!");=0A= > + return -1;=0A= > + }=0A= > + }=0A= > +=0A= > + return 0;=0A= > }=0A= =0A=