From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from EUR04-VI1-obe.outbound.protection.outlook.com (mail-eopbgr80084.outbound.protection.outlook.com [40.107.8.84]) by dpdk.org (Postfix) with ESMTP id 2E2901E534 for ; Sun, 10 Jun 2018 14:59:11 +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=KJEsjH0NeQbmpBiQlxCQN/NuNcUAkG+L4/Wd467WDb8=; b=TyK7tkp0PzbRvFcHRvFJm0/KkNlegrn1IUc5y6/ZXgq7DOgpIVZRQOeVDloByjVmki0jFC+ezNJWn6cbXRUgyh+rh9K8w3Aeu+TrCxRi5Rl5kFXum3TtwJIkLepKfS5IQ7pEz3w9Gfc7xlUs+BTAnxEJuGGc9fQA9Tnh6umYrXc= Received: from VI1PR05MB1678.eurprd05.prod.outlook.com (10.165.235.152) by VI1PR05MB4432.eurprd05.prod.outlook.com (52.133.13.27) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.841.17; Sun, 10 Jun 2018 12:59:09 +0000 Received: from VI1PR05MB1678.eurprd05.prod.outlook.com ([fe80::e06e:5570:1949:413d]) by VI1PR05MB1678.eurprd05.prod.outlook.com ([fe80::e06e:5570:1949:413d%6]) with mapi id 15.20.0841.019; Sun, 10 Jun 2018 12:59:07 +0000 From: "Xueming(Steven) Li" To: Adrien Mazarguil , Shahaf Shuler CC: "dev@dpdk.org" Thread-Topic: [dpdk-dev] [PATCH 3/7] net/mlx5: split PCI from generic probing code Thread-Index: AQHT9EZ91HWudlq6q0aClPVMeFVfqqRZRVeg Date: Sun, 10 Jun 2018 12:59:06 +0000 Message-ID: References: <20180525161814.13873-1-adrien.mazarguil@6wind.com> <20180525161814.13873-4-adrien.mazarguil@6wind.com> In-Reply-To: <20180525161814.13873-4-adrien.mazarguil@6wind.com> Accept-Language: zh-CN, en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: authentication-results: spf=none (sender IP is ) smtp.mailfrom=xuemingl@mellanox.com; x-originating-ip: [180.174.142.249] x-ms-publictraffictype: Email x-microsoft-exchange-diagnostics: 1; VI1PR05MB4432; 7:Gx7LRNllwkn8JXyBWi8TXQfzic6RBnr+syFuGRwtFJn3eGsza6lykuwzknoe2V7SVgqxTPWwzlARibW6hs3mN/3tQlT8zaBmMIUBbu2DOeJi/GV4QbhRR17kMYPjUGIeu9PEP5dLEDYeHmIQOqBHG292aBaqblB+EbVarQgvCeO2YIf1/Dfui9/6EltrpE3bEZHpV3F0Bwnllhy75DY2J/5jBKUzpKLiIhT4C3Bu9hw2RajU5qA5o61laG/mBm8Z x-ms-exchange-antispam-srfa-diagnostics: SOS; x-ms-office365-filtering-ht: Tenant x-microsoft-antispam: UriScan:; BCL:0; PCL:0; RULEID:(7020095)(4652020)(48565401081)(5600026)(4534165)(4627221)(201703031133081)(201702281549075)(2017052603328)(7153060)(7193020); SRVR:VI1PR05MB4432; x-ms-traffictypediagnostic: VI1PR05MB4432: 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)(5005006)(8121501046)(3231254)(944501410)(52105095)(10201501046)(93006095)(93001095)(3002001)(6055026)(149027)(150027)(6041310)(20161123562045)(20161123564045)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(20161123558120)(20161123560045)(6072148)(201708071742011)(7699016); SRVR:VI1PR05MB4432; BCL:0; PCL:0; RULEID:; SRVR:VI1PR05MB4432; x-forefront-prvs: 0699FCD394 x-forefront-antispam-report: SFV:NSPM; SFS:(10009020)(39860400002)(396003)(39380400002)(366004)(346002)(376002)(189003)(199004)(13464003)(6116002)(4326008)(3660700001)(3280700002)(7696005)(76176011)(186003)(316002)(2906002)(26005)(99286004)(9686003)(86362001)(97736004)(2900100001)(486006)(229853002)(6506007)(59450400001)(53546011)(105586002)(5890100001)(106356001)(102836004)(11346002)(476003)(53946003)(305945005)(66066001)(55016002)(6436002)(5250100002)(446003)(6636002)(8936002)(14454004)(53936002)(25786009)(74316002)(33656002)(8676002)(81166006)(7736002)(110136005)(478600001)(81156014)(5660300001)(6246003)(68736007)(3846002)(41533002)(21314002)(309714004); DIR:OUT; SFP:1101; SCL:1; SRVR:VI1PR05MB4432; H:VI1PR05MB1678.eurprd05.prod.outlook.com; FPR:; SPF:None; LANG:en; PTR:InfoNoRecords; MX:1; A:1; received-spf: None (protection.outlook.com: mellanox.com does not designate permitted sender hosts) x-microsoft-antispam-message-info: PRc7e62nrvlYiRiojTtGZg0lY7PvmW5GvztBlyj8lifUaZCm2d+2WVvp5I2NdOdHLEHYcam/Si/UrigtwEHg/Fbx4Sjh3ls7tJWAt368ImMGaFJ3u3fzPIkRZfgIMiOzxd4wiJ7L26cohReWT8mqWwHxlL5SC3+LWze3lcuB3yTMpjcUZFhm4TveVA7Eghtw spamdiagnosticoutput: 1:99 spamdiagnosticmetadata: NSPM Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: base64 MIME-Version: 1.0 X-MS-Office365-Filtering-Correlation-Id: 5d428e14-91e0-46c5-b562-08d5ced1f378 X-OriginatorOrg: Mellanox.com X-MS-Exchange-CrossTenant-Network-Message-Id: 5d428e14-91e0-46c5-b562-08d5ced1f378 X-MS-Exchange-CrossTenant-originalarrivaltime: 10 Jun 2018 12:59:06.9452 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: a652971c-7d2e-4d9b-a6a4-d149256f461b X-MS-Exchange-Transport-CrossTenantHeadersStamped: VI1PR05MB4432 Subject: Re: [dpdk-dev] [PATCH 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: Sun, 10 Jun 2018 12:59:11 -0000 SGkgQWRyaWVuLA0KDQpUaGUgbG9naWMgbG9va3MgbXVjaCBtb3JlIGNsZWFyIG5vdyB3aXRoIHRo ZSBzcGxpdC4NCg0KPiAtLS0tLU9yaWdpbmFsIE1lc3NhZ2UtLS0tLQ0KPiBGcm9tOiBkZXYgPGRl di1ib3VuY2VzQGRwZGsub3JnPiBPbiBCZWhhbGYgT2YgQWRyaWVuIE1hemFyZ3VpbA0KPiBTZW50 OiBTYXR1cmRheSwgTWF5IDI2LCAyMDE4IDEyOjM1IEFNDQo+IFRvOiBTaGFoYWYgU2h1bGVyIDxz aGFoYWZzQG1lbGxhbm94LmNvbT4NCj4gQ2M6IGRldkBkcGRrLm9yZw0KPiBTdWJqZWN0OiBbZHBk ay1kZXZdIFtQQVRDSCAzLzddIG5ldC9tbHg1OiBzcGxpdCBQQ0kgZnJvbSBnZW5lcmljIHByb2Jp bmcgY29kZQ0KPiANCj4gQWxsIHRoZSBnZW5lcmljIHByb2JpbmcgY29kZSBuZWVkcyBpcyBhbiBJ QiBkZXZpY2UuIFdoaWxlIHRoaXMgZGV2aWNlIGlzIGN1cnJlbnRseSBzdXBwbGllZCBieSBhIFBD SQ0KPiBsb29rdXAsIG90aGVyIG1ldGhvZHMgd2lsbCBiZSBhZGRlZCBzb29uLg0KPiANCj4gVGhp cyBwYXRjaCBkaXZpZGVzIHRoZSBvcmlnaW5hbCBmdW5jdGlvbiwgd2hpY2ggaGFzIGJlY29tZSBo dWdlIG92ZXIgdGltZSwgYXMgZm9sbG93czoNCj4gDQo+IDEuIFBDSS1zcGVjaWZpYyAobWx4NV9w Y2lfcHJvYmUoKSkuDQo+IDIuIEFsbCBwb3J0cyBvZiBhIFZlcmJzIGRldmljZSAobWx4NV9kZXZf c3Bhd24oKSkuDQo+IDMu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