From patchwork Wed Jun 15 17:36:19 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Hefty, Sean" X-Patchwork-Id: 882982 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 p5FHZPow029777 for ; Wed, 15 Jun 2011 17:36:22 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751710Ab1FORgW (ORCPT ); Wed, 15 Jun 2011 13:36:22 -0400 Received: from mga09.intel.com ([134.134.136.24]:25470 "EHLO mga09.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751779Ab1FORgV convert rfc822-to-8bit (ORCPT ); Wed, 15 Jun 2011 13:36:21 -0400 Received: from orsmga002.jf.intel.com ([10.7.209.21]) by orsmga102.jf.intel.com with ESMTP; 15 Jun 2011 10:36:21 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="4.65,370,1304319600"; d="scan'208";a="13915260" Received: from orsmsx603.amr.corp.intel.com ([10.22.226.49]) by orsmga002.jf.intel.com with ESMTP; 15 Jun 2011 10:36:21 -0700 Received: from orsmsx102.amr.corp.intel.com (10.22.225.129) by orsmsx603.amr.corp.intel.com (10.22.226.49) with Microsoft SMTP Server (TLS) id 8.2.255.0; Wed, 15 Jun 2011 10:36:21 -0700 Received: from orsmsx101.amr.corp.intel.com ([169.254.8.26]) by ORSMSX102.amr.corp.intel.com ([169.254.1.6]) with mapi id 14.01.0289.001; Wed, 15 Jun 2011 10:36:20 -0700 From: "Hefty, Sean" To: "linux-rdma (linux-rdma@vger.kernel.org)" Subject: [PATCH 2/8] librdmacm: Add support for XRC qp types Thread-Topic: [PATCH 2/8] librdmacm: Add support for XRC qp types Thread-Index: AcwrgrwRVz83ioByRy27h4Y7GIy1BA== Date: Wed, 15 Jun 2011 17:36:19 +0000 Message-ID: <1828884A29C6694DAF28B7E6B8A823730212C8@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 17:36:22 +0000 (UTC) Support XRC send/receive qp types. Signed-off-by: Sean Hefty --- src/addrinfo.c | 29 ++++++++++++++++++++++------- 1 files changed, 22 insertions(+), 7 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/src/addrinfo.c b/src/addrinfo.c index 428baf6..d659d43 100755 --- a/src/addrinfo.c +++ b/src/addrinfo.c @@ -45,6 +45,14 @@ #include #include +#ifdef IBV_XRC_OPS +#define RDMA_QPT_XRC_SEND IBV_QPT_XRC_SEND +#define RDMA_QPT_XRC_RECV IBV_QPT_XRC_RECV +#else +#define RDMA_QPT_XRC_SEND 0 +#define RDMA_QPT_XRC_RECV 0 +#endif + static void ucma_convert_to_ai(struct addrinfo *ai, struct rdma_addrinfo *rai) { memset(ai, 0, sizeof *ai); @@ -54,6 +62,9 @@ static void ucma_convert_to_ai(struct addrinfo *ai, struct rdma_addrinfo *rai) switch (rai->ai_qp_type) { case IBV_QPT_RC: + case IBV_QPT_UC: + case RDMA_QPT_XRC_SEND: + case RDMA_QPT_XRC_RECV: ai->ai_socktype = SOCK_STREAM; break; case IBV_QPT_UD: @@ -96,13 +107,17 @@ static int ucma_convert_to_rai(struct rdma_addrinfo *rai, rai->ai_family = ai->ai_family; - switch (ai->ai_socktype) { - case SOCK_STREAM: - rai->ai_qp_type = IBV_QPT_RC; - break; - case SOCK_DGRAM: - rai->ai_qp_type = IBV_QPT_UD; - break; + if (hints && hints->ai_qp_type) { + rai->ai_qp_type = hints->ai_qp_type; + } else { + switch (ai->ai_socktype) { + case SOCK_STREAM: + rai->ai_qp_type = IBV_QPT_RC; + break; + case SOCK_DGRAM: + rai->ai_qp_type = IBV_QPT_UD; + break; + } } if (hints && hints->ai_port_space) {