Return-Path: Received: from mga03.intel.com ([134.134.136.65]:57360 "EHLO mga03.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751548AbbDGVga (ORCPT ); Tue, 7 Apr 2015 17:36:30 -0400 From: "Hefty, Sean" To: Michael Wang , Roland Dreier , "linux-rdma@vger.kernel.org" , "linux-kernel@vger.kernel.org" , "linux-nfs@vger.kernel.org" , "netdev@vger.kernel.org" CC: Hal Rosenstock , Tom Tucker , Steve Wise , Hoang-Nam Nguyen , Christoph Raisch , infinipath , Eli Cohen , "Latif, Faisal" , Upinder Malhi , "Trond Myklebust" , "J. Bruce Fields" , "David S. Miller" , "Weiny, Ira" , PJ Waskiewicz , "Nikolova, Tatyana E" , Or Gerlitz , Jack Morgenstein , "Haggai Eran" , Ilya Nelkenbaum , "Yann Droneaud" , Bart Van Assche , Shachar Raindel , Sagi Grimberg , Devesh Sharma , Matan Barak , Moni Shoua , Jiri Kosina , Selvin Xavier , Mitesh Ahuja , "Li RongQing" , Rasmus Villemoes , "Estrin, Alex" , "Doug Ledford" , Eric Dumazet , "Erez Shitrit" , Tom Gundersen , Chuck Lever Subject: RE: [PATCH v2 13/17] IB/Verbs: Reform cma/ucma with management helpers Date: Tue, 7 Apr 2015 21:36:26 +0000 Message-ID: <1828884A29C6694DAF28B7E6B8A82373A8FBE42B@ORSMSX109.amr.corp.intel.com> References: <5523CCD5.6030401@profitbricks.com> <5523CF74.8020004@profitbricks.com> In-Reply-To: <5523CF74.8020004@profitbricks.com> Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Sender: linux-nfs-owner@vger.kernel.org List-ID: PiBkaWZmIC0tZ2l0IGEvZHJpdmVycy9pbmZpbmliYW5kL2NvcmUvY21hLmMgYi9kcml2ZXJzL2lu ZmluaWJhbmQvY29yZS9jbWEuYw0KPiBpbmRleCBkOGE4ZWE3Li5jMjNmNDgzIDEwMDY0NA0KPiAt LS0gYS9kcml2ZXJzL2luZmluaWJhbmQvY29yZS9jbWEu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