From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mga01.intel.com (mga01.intel.com [192.55.52.88]) by dpdk.org (Postfix) with ESMTP id 5B343234 for ; Sat, 28 Feb 2015 02:45:59 +0100 (CET) Received: from orsmga002.jf.intel.com ([10.7.209.21]) by fmsmga101.fm.intel.com with ESMTP; 27 Feb 2015 17:45:57 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.09,664,1418112000"; d="scan'208";a="691894339" Received: from pgsmsx103.gar.corp.intel.com ([10.221.44.82]) by orsmga002.jf.intel.com with ESMTP; 27 Feb 2015 17:45:56 -0800 Received: from shsmsx103.ccr.corp.intel.com (10.239.110.14) by PGSMSX103.gar.corp.intel.com (10.221.44.82) with Microsoft SMTP Server (TLS) id 14.3.195.1; Sat, 28 Feb 2015 09:45:53 +0800 Received: from shsmsx102.ccr.corp.intel.com ([169.254.2.62]) by SHSMSX103.ccr.corp.intel.com ([169.254.4.197]) with mapi id 14.03.0195.001; Sat, 28 Feb 2015 09:45:52 +0800 From: "Liang, Cunming" To: Thomas Monjalon Thread-Topic: [PATCH v6 4/8] eal/linux: add per rx queue interrupt handling based on VFIO Thread-Index: AQHQUknOQ3MHRChp+UyMD7WQ/m/TEZ0DxxqAgACXEnD//6Y5gIABNJBQ Date: Sat, 28 Feb 2015 01:45:52 +0000 Message-ID: References: <1424710542-14637-1-git-send-email-danny.zhou@intel.com> <7961783.gxFFSSThyb@xps13> In-Reply-To: <7961783.gxFFSSThyb@xps13> 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] [PATCH v6 4/8] eal/linux: add per rx queue interrupt handling based on VFIO 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: Sat, 28 Feb 2015 01:46:00 -0000 VGhhbmtzIFRob21hcy4NCkl0J3MgbXkgZmF1bHQgdGhhdCBkaXJlY3RseSByZXBseSBEYXZpZCdz IG1haWwsIGhhdmVuJ3Qgbm90aWNlIGhpcyBtYWlsIGlzbid0IGluIGEgcGxhaW4gdGV4dCBtb2Rl Lg0KDQo+IC0tLS0tT3JpZ2luYWwgTWVzc2FnZS0tLS0tDQo+IEZyb206IFRob21hcyBNb25qYWxv biBbbWFpbHRvOnRob21hcy5tb25qYWxvbkA2d2luZC5jb21dDQo+IFNlbnQ6IEZyaWRheSwgRmVi cnVhcnkgMjcsIDIwMTUgMTA6MTMgUE0NCj4gVG86IExpYW5nLCBDdW5taW5nDQo+IENjOiBEYXZp ZCBNYXJjaGFuZDsgZGV2QGRwZGsub3JnOyBTdGVwaGVuIEhlbW1pbmdlcjsgWmhvdSwgRGFubnkN Cj4gU3ViamVjdDogUmU6IFtQQVRDSCB2NiA0LzhdIGVhbC9saW51eDogYWRkIHBlciByeCBxdWV1 ZSBpbnRlcnJ1cHQgaGFuZGxpbmcgYmFzZWQNCj4gb24gVkZJTw0KPiANCj4gSGkgQ3VubWluZywN Cj4gDQo+IEZpcnN0LCBzb3JyeSB0byBoYXZlIHRvIHNheSB0aGF0LCBidXQgaXQgaXMgbm90IGVh c3kgdG8gcmVhZCBkaXNjdXNzaW9ucw0KPiB3aGVyZSBxdW90ZSBtYXJrcyBhcmUgbm90IHVzZWQu IEkgcmUtaW5zZXJ0IHRoZW0gZm9yIGNsYXJpdHkuDQo+IA0KPiBDb21tZW50cyBiZWxvdy4NCj4g DQo+IDIwMTUtMDItMjcgMTI6MjIsIExpYW5nLCBDdW5taW5nOg0KPiA+IEZyb206IERhdmlkIE1h cmNoYW5kIFttYWlsdG86ZGF2aWQubWFyY2hhbmRANndpbmQuY29tXQ0KPiA+IFNlbnQ6IEZyaWRh eSwgRmVicnVhcnkgMjcs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eF9p bnRlcnJ1cHRzKHN0cnVjdCBydGVfaW50cl9oYW5kbGUgKmludHJfaGFuZGxlLA0KPiA+ID4gPiAr ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBzdHJ1Y3QgZXBvbGxfZXZlbnQgKmV2ZW50 cywNCj4gPiA+ID4gKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdWludDMyX3QgKnZl YywgaW50IG5mZHMpDQo+ID4gPiA+ICt7DQo+ID4gPiA+ICsgICAgICAgaW50IGksIGJ5dGVzX3Jl YWQ7DQo+ID4gPiA+ICsgICAgICAgdW5pb24gcnRlX2ludHJfcmVhZF9idWZmZXIgYnVmOw0KPiA+ ID4gPiArICAgICAgIGludCBmZDsNCj4gPiA+ID4gKw0KPiA+ID4gPiArICAgICAgIGZvciAoaSA9 IDA7IGkgPCBuZmRzOyBpKyspIHsNCj4gPiA+ID4gKyAgICAgICAgICAgICAgIC8qIHNldCB0aGUg bGVuZ3RoIHRvIGJlIHJlYWQgZm9yIGRpZmZlcmVudCBoYW5kbGUgdHlwZSAqLw0KPiA+ID4gPiAr ICAgICAgICAgICAgICAgc3dpdGNoIChpbnRyX2hhbmRsZS0+dHlwZSkgew0KPiA+ID4gPiArICAg ICAgICAgICAgICAgY2FzZSBSVEVfSU5UUl9IQU5ETEVfVUlPOg0KPiA+ID4gPiArICAgICAgICAg ICAgICAgICAgICAgICBieXRlc19yZWFkID0gc2l6ZW9mKGJ1Zi51aW9faW50cl9jb3VudCk7DQo+ ID4gPiA+ICsgICAgICAgICAgICAgICAgICAgICAgIGJyZWFrOw0KPiA+ID4gPiArICAgICAgICAg ICAgICAgY2FzZSBSVEVfSU5UUl9IQU5ETEVfQUxBUk06DQo+ID4gPiA+ICsgICAgICAgICAgICAg ICAgICAgICAgIGJ5dGVzX3JlYWQgPSBzaXplb2YoYnVmLnRpbWVyZmRfbnVtKTsNCj4gPiA+ID4g KyAgICAgICAgICAgICAgICAgICAgICAgYnJlYWs7DQo+ID4gPiA+ICsjaWZkZWYgVkZJT19QUkVT RU5UDQo+ID4gPiA+ICsgICAgICAgICAgICAgICBjYXNlIFJURV9JTlRSX0hBTkRMRV9WRklPX01T SVg6DQo+ID4gPiA+ICsgICAgICAgICAgICAgICBjYXNlIFJURV9JTlRSX0hBTkRMRV9WRklPX01T SToNCj4gPiA+ID4gKyAgICAgICAgICAgICAgIGNhc2UgUlRFX0lOVFJfSEFORExFX1ZGSU9fTEVH QUNZOg0KPiA+ID4gPiArICAgICAgICAgICAgICAgICAgICAgICBieXRlc19yZWFkID0gc2l6ZW9m KGJ1Zi52ZmlvX2ludHJfY291bnQpOw0KPiA+ID4gPiArICAgICAgICAgICAgICAgICAgICAgICBi cmVhazsNCj4gPiA+ID4gKyNlbmRpZg0KPiA+ID4gPiArICAgICAgICAgICAgICAgZGVmYXVsdDoN Cj4gPiA+ID4gKyAgICAgICAgICAgICAgICAgICAgICAgYnl0ZXNfcmVhZCA9IDE7DQo+ID4gPiA+ ICsgICAgICAgICAgICAgICAgICAgICAgIGJyZWFrOw0KPiA+ID4gPiArICAgICAgICAgICAgICAg fQ0KPiA+ID4gPiArDQo+ID4gPiA+ICsgICAgICAgICAgICAgICAvKioNCj4gPiA+ID4gKyAgICAg ICAgICAgICAgICogcmVhZCBvdXQgdG8gY2xlYXIgdGhlIHJlYWR5LXRvLWJlLXJlYWQgZmxhZw0K PiA+ID4gPiArICAgICAgICAgICAgICAgKiBmb3IgZXBvbGxfd2FpdC4NCj4gPiA+ID4gKyAgICAg ICAgICAgICAgICovDQo+ID4gPiA+ICsgICAgICAgICAgICAgICB2ZWNbaV0gPSBldmVudHNbaV0u ZGF0YS51MzI7DQo+ID4gPiA+ICsgICAgICAgICAgICAgICBhc3NlcnQodmVjW2ldIDwgVkZJT19N QVhfUlhUWF9JTlRSX0lEKTsNCj4gPiA+ID4gKw0KPiA+ID4gPiArICAgICAgICAgICAgICAgZmQg PSBpbnRyX2hhbmRsZS0+ZWZkc1t2ZWNbaV1dOw0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TlRSX0VQT0xMX1dBSVRfRk9S RVZFUik7DQo+ID4gPiA+ICsgICAgICAgICAgICAgICBpZiAodW5saWtlbHkocmV0IDwgMCkpIHsN Cj4gPiA+ID4gKyAgICAgICAgICAgICAgICAgICAgICAgLyogZXBvbGxfd2FpdCBmYWlsICovDQo+ ID4gPiA+ICsgICAgICAgICAgICAgICAgICAgICAgIFJURV9MT0coRVJSLCBFQUwsICJlcG9sbF93 YWl0IHJldHVybnMgd2l0aCBmYWlsXG4iKTsNCj4gPiA+ID4gKyAgICAgICAgICAgICAgICAgICAg ICAgcmV0dXJuIC0xOw0KPiA+ID4gPiArICAgICAgICAgICAgICAgfSBlbHNlIGlmIChyZXQgPiAw KSB7DQo+ID4gPiA+ICsgICAgICAgICAgICAgICAgICAgICAgIC8qIGVwb2xsX3dhaXQgaGFzIGF0 IGxlYXN0IG9uZSBmZCByZWFkeSB0byByZWFkICovDQo+ID4gPiA+ICsgICAgICAgICAgICAgICAg ICAgICAgIGVhbF9pbnRyX3Byb2Nlc3Nfcnh0eF9pbnRlcnJ1cHRzKGludHJfaGFuZGxlLCBldmVu dHMsDQo+ID4gPiA+ICsgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgIHZlYywgcmV0KTsNCj4gPiA+ID4gKyAgICAgICAgICAgICAgICAgICAgICAg bnVtIC09IHJldDsNCj4gPiA+ID4gKyAgICAgICAgICAgICAgICAgICAgICAgdmVjICs9IHJldDsN Cj4gPiA+ID4gKyAgICAgICAgICAgICAgICAgICAgICAgbmZkcyArPSByZXQ7DQo+ID4gPiA+ICsg ICAgICAgICAgICAgICB9IGVsc2UgaWYgKG5mZHMgPiAwKQ0KPiA+ID4gPiArICAgICAgICAgICAg ICAgICAgICAgICBicmVhazsNCj4gPiA+ID4gKyAgICAgICB9IHdoaWxlIChudW0gPiAwKTsNCj4g PiA+ID4gKw0KPiA+ID4gPiArICAgICAgIHJldHVybiBuZmRzOw0KPiA+ID4g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jdG9yIGRvZXMgbm90IHN1cHBvcnQgZXZlbnRmZCFc biIpOw0KPiA+ID4gPiArICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIiAg aW50ZXJydXB0IHZlY3RvciAiDQo+ID4gPiA+ICsgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAiZG9lcyBub3Qgc3VwcG9ydCBldmVudGZkIVxuIik7PiA+DQo+ID4gPg0KPiA+ ID4gSWRlbS4NCj4gPg0KPiA+IFtMaWFuZywgQ3VubWluZ10gVGhlIHNhbWUuDQo+IA0KPiA+ID4g PiAtICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgImVycm9yICVpICglcylc biIsIGVycm5vLCBzdHJlcnJvcihlcnJubykpOw0KPiA+ID4gPiArICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICJlcnJvciAlaSAoJXMpXG4iLCBlcnJubywgc3RyZXJyb3IoZXJybm8pKTsN Cj4gPiA+DQo+ID4gPiBJZGVtLg0KPiA+DQo+ID4gW0xpYW5nLCBDdW5taW5nXSBUaGUgc2FtZS4N Cj4gDQo+ID4gPiA+ICAgICAgICAgICAgICAgICBkZXYtPmludHJfaGFuZGxlLnZmaW9fZGV2X2Zk ID0gdmZpb19kZXZfZmQ7DQo+ID4gPiA+IC0NCj4gPiA+DQo+ID4gPiBJZGVtLg0KPiA+DQo+ID4g W0xpYW5nLCBDdW5taW5nXSBBY2NlcHQuDQoNCg==