From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mga14.intel.com (mga14.intel.com [192.55.52.115]) by dpdk.org (Postfix) with ESMTP id 05B7A5AB9 for ; Wed, 6 Jul 2016 02:45:22 +0200 (CEST) Received: from orsmga002.jf.intel.com ([10.7.209.21]) by fmsmga103.fm.intel.com with ESMTP; 05 Jul 2016 17:45:21 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.28,316,1464678000"; d="c'?scan'208";a="1011506469" Received: from fmsmsx106.amr.corp.intel.com ([10.18.124.204]) by orsmga002.jf.intel.com with ESMTP; 05 Jul 2016 17:45:22 -0700 Received: from shsmsx103.ccr.corp.intel.com (10.239.4.69) by FMSMSX106.amr.corp.intel.com (10.18.124.204) with Microsoft SMTP Server (TLS) id 14.3.248.2; Tue, 5 Jul 2016 17:45:20 -0700 Received: from shsmsx102.ccr.corp.intel.com ([169.254.2.147]) by SHSMSX103.ccr.corp.intel.com ([169.254.4.181]) with mapi id 14.03.0248.002; Wed, 6 Jul 2016 08:45:18 +0800 From: "Lu, Wenzhuo" To: Luca Boccassi CC: "dev@dpdk.org" Thread-Topic: [dpdk-dev] [PATCH v6 0/4] support reset of VF link Thread-Index: AQHRyrx8LaSwDJ5M5U2GQJ01DKNhxKAH+1YAgAEbWACAABOhgIABfdMQ Date: Wed, 6 Jul 2016 00:45:18 +0000 Message-ID: <6A0DE07E22DDAD4C9103DF62FEBC09090348DB05@shsmsx102.ccr.corp.intel.com> References: <1465191653-28408-1-git-send-email-wenzhuo.lu@intel.com> <1466403870-6840-1-git-send-email-wenzhuo.lu@intel.com> <1467647287.32386.8.camel@brocade.com> <6A0DE07E22DDAD4C9103DF62FEBC09090348D343@shsmsx102.ccr.corp.intel.com> <1467712351.32466.11.camel@brocade.com> In-Reply-To: <1467712351.32466.11.camel@brocade.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: yes X-MS-TNEF-Correlator: x-originating-ip: [10.239.127.40] Content-Type: multipart/mixed; boundary="_002_6A0DE07E22DDAD4C9103DF62FEBC09090348DB05shsmsx102ccrcor_" MIME-Version: 1.0 Subject: Re: [dpdk-dev] [PATCH v6 0/4] support reset of VF link 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: Wed, 06 Jul 2016 00:45:24 -0000 --_002_6A0DE07E22DDAD4C9103DF62FEBC09090348DB05shsmsx102ccrcor_ Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: base64 SGkgTHVjYSwNCg0KPiAtLS0tLU9yaWdpbmFsIE1lc3NhZ2UtLS0tLQ0KPiBGcm9tOiBMdWNhIEJv Y2Nhc3NpIFttYWlsdG86bGJvY2Nhc3NAQnJvY2FkZS5jb21dDQo+IFNlbnQ6IFR1ZXNkYXksIEp1 bHkgNSwgMjAxNiA1OjUzIFBNDQo+IFRvOiBMdSwgV2Vuemh1bw0KPiBDYzogZGV2QGRwZGsub3Jn DQo+IFN1YmplY3Q6IFJlOiBbZHBkay1kZXZdIFtQQVRDSCB2NiAwLzRdIHN1cHBvcnQgcmVzZXQg b2YgVkYgbGluaw0KPiANCj4gT24gVHVlLCAyMDE2LTA3LTA1IGF0IDAwOjUyICswMDAwLCBMdSwg V2Vuemh1byB3cm90ZToNCj4gPiBIaSBMdWNhLA0KPiA+DQo+ID4NCj4gPiA+IC0tLS0tT3JpZ2lu YWwgTWVzc2FnZS0tLS0tDQo+ID4gPiBGcm9tOiBMdWNhIEJvY2Nhc3NpIFttYWlsdG86bGJvY2Nh c3NAQnJvY2FkZS5jb21dDQo+ID4gPiBTZW50OiBNb25kYXksIEp1bHkgNCwgMjAxNiAxMTo0OCBQ TQ0KPiA+ID4gVG86IEx1LCBXZW56aHVvDQo+ID4gPiBDYzogZGV2QGRwZGsub3JnDQo+ID4gPiBT dWJqZWN0OiBSZTogW2RwZGstZGV2XSBbUEFUQ0ggdjYgMC80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EdpdmVuIEkndmUgZ290IGEgdXNlIGNhc2Ugd2hlcmUgdGhpcyBpcyBo YXBwZW5pbmcsDQo+IGlmIGl0IGNhbiBiZSBoZWxwZnVsIGZvciB5b3UgSSdtIG1vcmUgdGhhbiBo YXBweSB0byBoZWxwIGFzIGEgZ3VpbmVhIHBpZy4gSWYgeW91DQo+IGNvdWxkIHBsZWFzZSBnaXZl IHNvbWUgZ3VpZGFuY2UvZ3VpZGVsaW5lcyB3aXRoIHJlZ2FyZHMgdG8gd2hpY2ggQVBJIHRvIHVz ZSB0bw0KPiBzb3J0IHRoZSBtYnVmIHByb2JsZW0sIEkgY2FuIHRyeSBpdCBvdXQgYW5kIGdpdmUg YmFjayBzb21lIGZlZWRiYWNrLg0KPiANCj4gVGhhbmtzIQ0KSSBtYWRlIGEgc3R1cGlkIG1pc3Rh a2UgYW5kIGRlbGV0ZWQgYWxsIG15IGNvZGUuIFNvLCBJIGhhdmUgdG8gdGFrZSBzb21lIHRpbWUg dG8gcmV3cml0ZSBpdCA6KA0KQXR0YWNoZWQgdGhlIGV4YW1wbGUgSSB1c2VkIHRvIHRlc3QgdGhl IHJlc2V0IEFQSS4gSXQncyBtb2RpZmllZCBmcm9tIHRoZSBsMmZ3ZCBleGFtcGxlLiBTbyB5b3Ug Y2FuIGNvbXBhcmUgaXQgd2l0aCBsMmZ3ZCB0byBzZWUgd2hhdCBuZWVkIHRvIGJlIGFkZGVkLg0K SG9wZWZ1bGx5IGl0IGNhbiBoZWxwIDopDQoNCj4gDQo+IC0tDQo+IEtpbmQgcmVnYXJkcywNCj4g THVjYSBCb2NjYXNzaQ0K --_002_6A0DE07E22DDAD4C9103DF62FEBC09090348DB05shsmsx102ccrcor_ Content-Type: text/plain; name="main.c" Content-Description: main.c Content-Disposition: attachment; filename="main.c"; size=20990; creation-date="Wed, 06 Jul 2016 00:44:18 GMT"; modification-date="Wed, 06 Jul 2016 00:44:18 GMT" Content-Transfer-Encoding: base64 LyotCiAqICAgQlNEIExJQ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