From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from EUR01-HE1-obe.outbound.protection.outlook.com (mail-he1eur01on0040.outbound.protection.outlook.com [104.47.0.40]) by dpdk.org (Postfix) with ESMTP id AE6041B4AC for ; Sat, 16 Jun 2018 10:29:34 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=Mellanox.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=18qrlyJm8/WiX47H4Kzv+jzBTN43j1UZJCVpccSEK4Y=; b=LEMbaPjn1+4+qezaWsjO7TreWb8e0MYzz+GiGYKnANyuifm+gUoP9QKHj4lZmi+ffiVLuAJqGhiNu8SU1XTSvnO1o5y0+5OilwlPND0SXeFpEFKCaxtn1JhIrgIkJjBsevI/RhQj27AZsPL5n9hnXs5lSZNr7pQM2qnLKu9OFnc= Received: from AM5PR0501MB2420.eurprd05.prod.outlook.com (10.169.149.146) by AM5PR0501MB2146.eurprd05.prod.outlook.com (10.167.215.27) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.863.14; Sat, 16 Jun 2018 08:29:33 +0000 Received: from AM5PR0501MB2420.eurprd05.prod.outlook.com ([fe80::e852:af25:231c:79c1]) by AM5PR0501MB2420.eurprd05.prod.outlook.com ([fe80::e852:af25:231c:79c1%10]) with mapi id 15.20.0863.016; Sat, 16 Jun 2018 08:29:33 +0000 From: "Xueming(Steven) Li" To: Adrien Mazarguil , Shahaf Shuler CC: "dev@dpdk.org" Thread-Topic: [dpdk-dev] [PATCH v2 3/7] net/mlx5: split PCI from generic probing code Thread-Index: AQHUA7q1KwGwJiLCBEKjpwtRzWrxmaRikNLQ Date: Sat, 16 Jun 2018 08:29:32 +0000 Message-ID: References: <20180525161814.13873-1-adrien.mazarguil@6wind.com> <20180614083047.10812-1-adrien.mazarguil@6wind.com> <20180614083047.10812-4-adrien.mazarguil@6wind.com> In-Reply-To: <20180614083047.10812-4-adrien.mazarguil@6wind.com> Accept-Language: zh-CN, en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-originating-ip: [180.174.142.249] x-ms-publictraffictype: Email x-microsoft-exchange-diagnostics: 1; AM5PR0501MB2146; 7:zj282ISYK1ce98xx+ca3NHsyzN/dDC1xLklbNYibdeYKRFY0Rkt5nlUpjnqSrrbvwz6bt8PfIrgwGqOwjoUVkR9KQAoLSHmccUDSdJvqTlpy06QyA3VMdax79jode2pUilgarceQoZ8QMrcbhqKC5oJ2u33p3enu1EyNJcE2e8M+BpF9lzjpTSeEMZKDz2b6zA+u76qXbWS6Vo322hmVShEzXZQ+v3wVaae6MnsuTCzt/RrcLpYypxIIrsiTrCKV x-ms-exchange-antispam-srfa-diagnostics: SOS; x-ms-office365-filtering-ht: Tenant x-ms-office365-filtering-correlation-id: 598ab32f-3a43-4aaf-e56e-08d5d3634988 x-microsoft-antispam: UriScan:; BCL:0; PCL:0; RULEID:(7020095)(4652020)(4534165)(4627221)(201703031133081)(201702281549075)(48565401081)(5600026)(711020)(2017052603328)(7153060)(7193020); SRVR:AM5PR0501MB2146; x-ms-traffictypediagnostic: AM5PR0501MB2146: authentication-results: spf=none (sender IP is ) smtp.mailfrom=xuemingl@mellanox.com; x-ld-processed: a652971c-7d2e-4d9b-a6a4-d149256f461b,ExtAddr x-microsoft-antispam-prvs: x-exchange-antispam-report-test: UriScan:; x-ms-exchange-senderadcheck: 1 x-exchange-antispam-report-cfa-test: BCL:0; PCL:0; RULEID:(8211001083)(6040522)(2401047)(8121501046)(5005006)(10201501046)(3002001)(93006095)(93001095)(3231254)(944501410)(52105095)(6055026)(149027)(150027)(6041310)(20161123560045)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(20161123564045)(20161123562045)(20161123558120)(6072148)(201708071742011)(7699016); SRVR:AM5PR0501MB2146; BCL:0; PCL:0; RULEID:; SRVR:AM5PR0501MB2146; x-forefront-prvs: 0705EB1700 x-forefront-antispam-report: SFV:NSPM; SFS:(10009020)(346002)(376002)(366004)(39860400002)(396003)(39380400002)(199004)(189003)(13464003)(6436002)(9686003)(33656002)(5660300001)(478600001)(7696005)(3660700001)(5250100002)(2906002)(6116002)(97736004)(3846002)(14454004)(6636002)(102836004)(59450400001)(53546011)(55016002)(6506007)(186003)(3280700002)(68736007)(305945005)(7736002)(105586002)(74316002)(106356001)(26005)(76176011)(25786009)(476003)(316002)(66066001)(486006)(86362001)(8936002)(110136005)(81156014)(81166006)(229853002)(53946003)(6246003)(53936002)(4326008)(99286004)(2900100001)(11346002)(446003)(5890100001)(41533002)(21314002)(309714004); DIR:OUT; SFP:1101; SCL:1; SRVR:AM5PR0501MB2146; H:AM5PR0501MB2420.eurprd05.prod.outlook.com; FPR:; SPF:None; LANG:en; PTR:InfoNoRecords; A:1; MX:1; received-spf: None (protection.outlook.com: mellanox.com does not designate permitted sender hosts) x-microsoft-antispam-message-info: LrDD0eoFfpuJMU+arO1tIjEnI2jR49UOhYVcLzIYjVZb8t9vgHifECY0f265DLTw4n5nhW5iTpcFuC+zzl5XskE7f/grQI9qT15ARBecoHNZqiey4yDLjVCMFHSZ9PVqFsns2eQjTZnxH/A1PQ3lpdW5ITWIe9QzP8ApD7HAPjov66Igr2mb8nsGl7eyEASm spamdiagnosticoutput: 1:99 spamdiagnosticmetadata: NSPM Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: base64 MIME-Version: 1.0 X-OriginatorOrg: Mellanox.com X-MS-Exchange-CrossTenant-Network-Message-Id: 598ab32f-3a43-4aaf-e56e-08d5d3634988 X-MS-Exchange-CrossTenant-originalarrivaltime: 16 Jun 2018 08:29:33.0183 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: a652971c-7d2e-4d9b-a6a4-d149256f461b X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM5PR0501MB2146 Subject: Re: [dpdk-dev] [PATCH v2 3/7] net/mlx5: split PCI from generic probing code X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 16 Jun 2018 08:29:35 -0000 UmV2aWV3ZWQtYnk6IFh1ZW1pbmcgTGkgPHh1ZW1pbmdsQG1lbGxhbm94LmNvbT4NCg0KPiAtLS0t LU9yaWdpbmFsIE1lc3NhZ2UtLS0tLQ0KPiBGcm9tOiBkZXYgPGRldi1ib3VuY2VzQGRwZGsub3Jn PiBPbiBCZWhhbGYgT2YgQWRyaWVuIE1hemFyZ3VpbA0KPiBTZW50OiBUaHVyc2RheSwgSnVuZSAx NCwgMjAxOCA0OjM1IFBNDQo+IFRvOiBTaGFoYWYgU2h1bGVyIDxzaGFoYWZzQG1lbGxhbm94LmNv bT4NCj4gQ2M6IGRldkBkcGRrLm9yZw0KPiBTdWJqZWN0OiBbZHBkay1kZXZdIFtQQVRDSCB2MiAz LzddIG5ldC9tbHg1OiBzcGxpdCBQQ0kgZnJvbSBnZW5lcmljIHByb2JpbmcgY29kZQ0KPiANCj4g QWxsIHRoZSBnZW5lcmljIHByb2JpbmcgY29kZSBuZWVkcyBpcyBhbiBJQiBkZXZpY2UuIFdoaWxl IHRoaXMgZGV2aWNlIGlzIGN1cnJlbnRseSBzdXBwbGllZCBieSBhIFBDSQ0KPiBsb29rdXAsIG90 aGVyIG1ldGhvZHMgd2lsbCBiZSBhZGRlZCBzb29uLg0KPiANCj4gVGhpcyBwYXRjaCBkaXZpZGVz IHRoZSBvcmlnaW5hbCBmdW5jdGlvbiwgd2hpY2ggaGFzIGJlY29tZSBodWdlIG92ZXIgdGltZSwg YXMgZm9sbG93czoNCj4gDQo+IDEuIFBDSS1zcGVjaWZpYyAobWx4NV9wY2lfcHJvYmUoKSkuDQo+ IDIuIEFsbCBwb3J0cyBvZiBhIFZlcmJzIGRldmljZSAobWx4NV9kZXZfc3Bhd24oKS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