From patchwork Wed Jun 15 06:28:05 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Hefty, Sean" X-Patchwork-Id: 881282 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by demeter2.kernel.org (8.14.4/8.14.4) with ESMTP id p5F6S6D4010041 for ; Wed, 15 Jun 2011 06:28:17 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752642Ab1FOG2Q (ORCPT ); Wed, 15 Jun 2011 02:28:16 -0400 Received: from mga01.intel.com ([192.55.52.88]:38404 "EHLO mga01.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751505Ab1FOG2H convert rfc822-to-8bit (ORCPT ); Wed, 15 Jun 2011 02:28:07 -0400 Received: from fmsmga002.fm.intel.com ([10.253.24.26]) by fmsmga101.fm.intel.com with ESMTP; 14 Jun 2011 23:28:07 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="4.65,369,1304319600"; d="scan'208";a="16388520" Received: from orsmsx604.amr.corp.intel.com ([10.22.226.87]) by fmsmga002.fm.intel.com with ESMTP; 14 Jun 2011 23:28:06 -0700 Received: from orsmsx151.amr.corp.intel.com (10.22.226.38) by orsmsx604.amr.corp.intel.com (10.22.226.87) with Microsoft SMTP Server (TLS) id 8.2.255.0; Tue, 14 Jun 2011 23:28:06 -0700 Received: from orsmsx101.amr.corp.intel.com ([169.254.8.26]) by ORSMSX151.amr.corp.intel.com ([169.254.5.218]) with mapi id 14.01.0289.001; Tue, 14 Jun 2011 23:28:06 -0700 From: "Hefty, Sean" To: "linux-rdma (linux-rdma@vger.kernel.org)" Subject: [PATCH 13/17] rdma/cm: Support XRC QPs Thread-Topic: [PATCH 13/17] rdma/cm: Support XRC QPs Thread-Index: AcwrJBiCCo9TrPpbRdqYYA/p+oraaw== Date: Wed, 15 Jun 2011 06:28:05 +0000 Message-ID: <1828884A29C6694DAF28B7E6B8A82373021046@ORSMSX101.amr.corp.intel.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-originating-ip: [10.9.131.214] MIME-Version: 1.0 Sender: linux-rdma-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-rdma@vger.kernel.org X-Greylist: IP, sender and recipient auto-whitelisted, not delayed by milter-greylist-4.2.6 (demeter2.kernel.org [140.211.167.43]); Wed, 15 Jun 2011 06:28:17 +0000 (UTC) Allow users to connect XRC QPs through the rdma_cm. Because XRC QPs connect INI -> TGT QPs, we need to convert from the local qp type to the destination qp type when calling the ib_cm. Signed-off-by: Sean Hefty --- drivers/infiniband/core/cma.c | 10 +++++++++- 1 files changed, 9 insertions(+), 1 deletions(-) -- To unsubscribe from this list: send the line "unsubscribe linux-rdma" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html diff --git a/drivers/infiniband/core/cma.c b/drivers/infiniband/core/cma.c index d9b18f5..3017888 100644 --- a/drivers/infiniband/core/cma.c +++ b/drivers/infiniband/core/cma.c @@ -2464,6 +2464,14 @@ out: return ret; } +static enum ib_qp_type cma_get_dest_qpt(struct rdma_id_private *id_priv) +{ + if (id_priv->id.qp_type == IB_QPT_XRC_INI) + return IB_QPT_XRC_TGT; + + return id_priv->id.qp_type; +} + static int cma_connect_ib(struct rdma_id_private *id_priv, struct rdma_conn_param *conn_param) { @@ -2503,7 +2511,7 @@ static int cma_connect_ib(struct rdma_id_private *id_priv, req.service_id = cma_get_service_id(id_priv->id.ps, (struct sockaddr *) &route->addr.dst_addr); req.qp_num = id_priv->qp_num; - req.qp_type = IB_QPT_RC; + req.qp_type = cma_get_dest_qpt(id_priv); req.starting_psn = id_priv->seq_num; req.responder_resources = conn_param->responder_resources; req.initiator_depth = conn_param->initiator_depth;