From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mga03.intel.com (mga03.intel.com [143.182.124.21]) by dpdk.org (Postfix) with ESMTP id 4C9FC1FE for ; Tue, 26 Aug 2014 09:10:37 +0200 (CEST) Received: from azsmga001.ch.intel.com ([10.2.17.19]) by azsmga101.ch.intel.com with ESMTP; 26 Aug 2014 00:14:34 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.04,402,1406617200"; d="scan'208";a="472634374" Received: from fmsmsx108.amr.corp.intel.com ([10.18.124.206]) by azsmga001.ch.intel.com with ESMTP; 26 Aug 2014 00:14:34 -0700 Received: from fmsmsx101.amr.corp.intel.com (10.19.9.52) by FMSMSX108.amr.corp.intel.com (10.18.124.206) with Microsoft SMTP Server (TLS) id 14.3.195.1; Tue, 26 Aug 2014 00:14:33 -0700 Received: from shsmsx151.ccr.corp.intel.com (10.239.6.50) by FMSMSX101.amr.corp.intel.com (10.19.9.52) with Microsoft SMTP Server (TLS) id 14.3.195.1; Tue, 26 Aug 2014 00:14:33 -0700 Received: from shsmsx102.ccr.corp.intel.com ([169.254.2.246]) by SHSMSX151.ccr.corp.intel.com ([169.254.3.174]) with mapi id 14.03.0195.001; Tue, 26 Aug 2014 15:14:31 +0800 From: "Ouyang, Changchun" To: Stephen Hemminger Thread-Topic: [RFC 01/10] virtio: rearrange resource initialization Thread-Index: AQHPwNK/VppuR5sBVEyjUKd9gNM0e5vidxTQ Date: Tue, 26 Aug 2014 07:14:31 +0000 Message-ID: References: <20140826020746.062748014@networkplumber.org> <20140826020837.898427212@networkplumber.org> In-Reply-To: <20140826020837.898427212@networkplumber.org> Accept-Language: zh-CN, en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-originating-ip: [10.239.127.40] Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: base64 MIME-Version: 1.0 Cc: "dev@dpdk.org" Subject: Re: [dpdk-dev] [RFC 01/10] virtio: rearrange resource initialization 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: Tue, 26 Aug 2014 07:10:38 -0000 QWNrZWQtYnk6IENoYW5nY2h1biBPdXlhbmcgPENoYW5nY2h1bi5vdXlhbmdAaW50ZWwuY29tPg0K DQo+IC0tLS0tT3JpZ2luYWwgTWVzc2FnZS0tLS0tDQo+IEZyb206IFN0ZXBoZW4gSGVtbWluZ2Vy IFttYWlsdG86c3RlcGhlbkBuZXR3b3JrcGx1bWJlci5vcmddDQo+IFNlbnQ6IFR1ZXNkYXksIEF1 Z3VzdCAyNiwgMjAxNCAxMDowOCBBTQ0KPiBUbzogT3V5YW5nLCBDaGFuZ2NodW4NCj4gQ2M6IGRl dkBkcGRrLm9yZw0KPiBTdWJqZWN0OiBbUkZDIDAxLzEwXSB2aXJ0aW86IHJlYXJyYW5nZSByZXNv dXJjZSBpbml0aWFsaXphdGlvbg0KPiANCj4gRm9yIGNsYXJpdHkgbWFrZSB0aGUgc2V0dXAgb2Yg UENJIHJlc291cmNlcyBmb3IgTGludXggaW50byBhIGZ1bmN0aW9uIHJhdGhlcg0KPiB0aGFuIGJs b2NrIG9mIGNvZGUgI2lmZGVmJ2QgaW4gbWlkZGxlIG9mIGRldl9pbml0Lg0KPiANCj4gLS0tDQo+ ICBsaWIvbGlicnRlX3BtZF92aXJ0aW8vdmlydGlvX2V0aGRldi5jIHwgICA3NiArKysrKysrKysr KysrKysrKysrLS0tLS0tLS0tLQ0KPiAtLS0tLQ0KPiAgMSBmaWxlIGNoYW5nZWQsIDQzIGluc2Vy dGlvbnMoKyksIDMzIGRlbGV0aW9ucygtKQ0KPiANCj4gLS0tIGEvbGliL2xpYnJ0ZV9wbWRfdmly dGlvL3ZpcnRpb19ldGhkZXYuYwkyMDE0LTA4LTI1DQo+IDE5OjAwOjAzLjYyMjUxNTU3NCAtMDcw MA0KPiArKysgYi9saWIvbGlicnR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