From patchwork Mon Nov 11 18:46:49 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Hefty, Sean" X-Patchwork-Id: 3169181 Return-Path: X-Original-To: patchwork-linux-rdma@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork2.web.kernel.org (Postfix) with ESMTP id 9CAF9C045B for ; Mon, 11 Nov 2013 18:46:54 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id BC907201BE for ; Mon, 11 Nov 2013 18:46:53 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id A9E81201B7 for ; Mon, 11 Nov 2013 18:46:52 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754838Ab3KKSqv (ORCPT ); Mon, 11 Nov 2013 13:46:51 -0500 Received: from mga14.intel.com ([143.182.124.37]:45712 "EHLO mga14.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754197Ab3KKSqv convert rfc822-to-8bit (ORCPT ); Mon, 11 Nov 2013 13:46:51 -0500 Received: from azsmga001.ch.intel.com ([10.2.17.19]) by azsmga102.ch.intel.com with ESMTP; 11 Nov 2013 10:46:50 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="4.93,535,1378882800"; d="scan'208";a="387842746" Received: from orsmsx109.amr.corp.intel.com ([10.22.240.7]) by azsmga001.ch.intel.com with ESMTP; 11 Nov 2013 10:46:50 -0800 Received: from orsmsx153.amr.corp.intel.com (10.22.226.247) by ORSMSX109.amr.corp.intel.com (10.22.240.7) with Microsoft SMTP Server (TLS) id 14.3.123.3; Mon, 11 Nov 2013 10:46:50 -0800 Received: from orsmsx109.amr.corp.intel.com ([169.254.2.186]) by ORSMSX153.amr.corp.intel.com ([169.254.12.126]) with mapi id 14.03.0123.003; Mon, 11 Nov 2013 10:46:49 -0800 From: "Hefty, Sean" To: Christoph Lameter CC: Or Gerlitz , "linux-rdma (linux-rdma@vger.kernel.org)" Subject: RE: failure to get gid with rdma_bind_addr with >= 3.10 kernels Thread-Topic: failure to get gid with rdma_bind_addr with >= 3.10 kernels Thread-Index: AQHO3gTbc8hjt+RxB0WbB8+oFFGcTpoe1Q6AgAF1AKCAAJPVgP//e1XQ Date: Mon, 11 Nov 2013 18:46:49 +0000 Message-ID: <1828884A29C6694DAF28B7E6B8A8237388CF6FD0@ORSMSX109.amr.corp.intel.com> References: <527F6896.1080802@mellanox.com> <527F69B1.9070701@mellanox.com> <1828884A29C6694DAF28B7E6B8A8237388CF6F78@ORSMSX109.amr.corp.intel.com> <00000142485f86e5-c3027528-9892-4d5c-8d72-0ed5f98666c4-000000@email.amazonses.com> In-Reply-To: <00000142485f86e5-c3027528-9892-4d5c-8d72-0ed5f98666c4-000000@email.amazonses.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-originating-ip: [10.22.254.139] MIME-Version: 1.0 Sender: linux-rdma-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-rdma@vger.kernel.org X-Spam-Status: No, score=-6.9 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_HI, RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP > > As part of the AF_IB changes, additional queries were introduced that > > separated out retrieving the different kernel data -- assigned address, > > GID mappings, and IB PR data. (New queries were necessary, since > > sockaddr_ib is larger than sockaddr_in6, and we want to eventually > > handle non-reversible paths.) The librdmacm 1.0.17 changed which query > > was called after rdma_bind_addr was invoked to only retrieve the > > assigned address, versus retrieving everything. I think this is why you > > see an SGID of all 0's after calling rdma_bind_addr. > > Is there another call that allows the retrieval of the SGID? Yes - something like this patch should help, but I don't think this is the correct behavior when the IP address is 'any' addresss. Retrieve SGID after calling rdma_bind_addr From: Sean Hefty A change was made to rdma_bind_addr when AF_IB is enabled to only retrieve the resulting bound address. Previously, rdma_bind_addr would retrieve the corresponding SGID as well. This breaks some apps which were checking the SGID after binding to an IP address. Revert to the previous behavior of also retrieving the SGID after calling rdma_bind_addr. Tested-by: Christoph Lameter --- src/cma.c | 5 ++++- 1 files changed, 4 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/src/cma.c b/src/cma.c index 4f41879..0cf4203 100644 --- a/src/cma.c +++ b/src/cma.c @@ -753,7 +753,10 @@ static int rdma_bind_addr2(struct rdma_cm_id *id, struct sockaddr *addr, if (ret != sizeof cmd) return (ret >= 0) ? ERR(ENODATA) : -1; - return ucma_query_addr(id); + ret = ucma_query_addr(id); + if (!ret) + ret = ucma_query_gid(id); + return ret; } int rdma_bind_addr(struct rdma_cm_id *id, struct sockaddr *addr)