Received: by 10.192.165.156 with SMTP id m28csp61735imm; Tue, 10 Apr 2018 16:25:28 -0700 (PDT) X-Google-Smtp-Source: AIpwx497msR+GfXfsctW2E7sL9Ft0+pDLl+6AyJYcSvUSJiQ5eQtwscnVlGF5iEozbGg3fHbMBY6 X-Received: by 2002:a17:902:ab94:: with SMTP id f20-v6mr2465505plr.375.1523402728222; Tue, 10 Apr 2018 16:25:28 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1523402728; cv=none; d=google.com; s=arc-20160816; b=0CTyeJSLKLpHryTMs2Xf7JYZyjlV3mwFtAUAWE2IAAjBYgSubMuCRKDO3ECfujiEYc k7Gll6XnCEKR9dWfafONctAfBZbU3Yaak3CafK4ZC3ax7ltd95S9yWxoxjYdWq7JW59p ARv8GS35dtBr6CVwkdkHgwUDNQ0l56Tpxmb1Wc3dHpmoTqc+okO/A5cLZd9yBvXFSX7i yaWndWmpEZ4KW79yIS+Y2CcyXMpcJSxhuU0WepNI0l3JgEyFOAV2Iec6LH/j6nGbxPT2 qMSSjo5rvlbcS+0GhkzYVb+KWoB973aYkDB3MAu7Oo+k2DqD3p2CMXpuGRlHHOZQSCnx Iybw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:user-agent:references :in-reply-to:message-id:date:subject:cc:to:from :arc-authentication-results; bh=mpBI5Am+kqg/bKyEgRHzsTqX9ecmo0rrH6wEFJk8uGs=; b=twg7COzJHa2K4udLrt2dikCV7SReFtYvLt0igKerrfcxM0I+OLuWTVzewdpcUSrSk9 n3+hj6/UY6Mx6kq05XTBlyMuvaP4w+627TAf5+j7ldP2o6HyW7W7yRReMAj6aMFsa0Nr ztAM8XqnmvLGakkyR1eQ4k1R2pFE/FZolmBnO1CZhHEMBJJjH1sYJzraIf0GL8Mc1EoJ W+MQK6di4jbxS5yJvVo9t98Av2CDZpdtoFCMcWI4gLLTTOl/9x9iHD24jjbOZpkFL+Mj 1G4BKzXGwZVqfB2dijGkmH7GXJyPGpPeltsRm4hMcbJlfFsbiu0gLSVum0R3oNHUIY20 uwmw== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id e3si2456303pgq.231.2018.04.10.16.24.51; Tue, 10 Apr 2018 16:25:28 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752768AbeDJWbA (ORCPT + 99 others); Tue, 10 Apr 2018 18:31:00 -0400 Received: from mail.linuxfoundation.org ([140.211.169.12]:40206 "EHLO mail.linuxfoundation.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752785AbeDJWa4 (ORCPT ); Tue, 10 Apr 2018 18:30:56 -0400 Received: from localhost (LFbn-1-12247-202.w90-92.abo.wanadoo.fr [90.92.61.202]) by mail.linuxfoundation.org (Postfix) with ESMTPSA id 9F534DE0; Tue, 10 Apr 2018 22:30:55 +0000 (UTC) From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Parav Pandit , Mark Bloch , Leon Romanovsky , Jason Gunthorpe , Sasha Levin Subject: [PATCH 4.15 096/168] RDMA/cma: Fix rdma_cm path querying for RoCE Date: Wed, 11 Apr 2018 00:23:58 +0200 Message-Id: <20180410212804.335965237@linuxfoundation.org> X-Mailer: git-send-email 2.17.0 In-Reply-To: <20180410212800.144079021@linuxfoundation.org> References: <20180410212800.144079021@linuxfoundation.org> User-Agent: quilt/0.65 X-stable: review MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 4.15-stable review patch. If anyone has any objections, please let me know. ------------------ From: Parav Pandit [ Upstream commit 89838118a515847d3e5c904d2e022779a7173bec ] The 'if' logic in ucma_query_path was broken with OPA was introduced and started to treat RoCE paths as as OPA paths. Invert the logic of the 'if' so only OPA paths are treated as OPA paths. Otherwise the path records returned to rdma_cma users are mangled when in RoCE mode. Fixes: 57520751445b ("IB/SA: Add OPA path record type") Signed-off-by: Parav Pandit Reviewed-by: Mark Bloch Signed-off-by: Leon Romanovsky Signed-off-by: Jason Gunthorpe Signed-off-by: Sasha Levin Signed-off-by: Greg Kroah-Hartman --- drivers/infiniband/core/ucma.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) --- a/drivers/infiniband/core/ucma.c +++ b/drivers/infiniband/core/ucma.c @@ -914,13 +914,14 @@ static ssize_t ucma_query_path(struct uc resp->path_data[i].flags = IB_PATH_GMP | IB_PATH_PRIMARY | IB_PATH_BIDIRECTIONAL; - if (rec->rec_type == SA_PATH_REC_TYPE_IB) { - ib_sa_pack_path(rec, &resp->path_data[i].path_rec); - } else { + if (rec->rec_type == SA_PATH_REC_TYPE_OPA) { struct sa_path_rec ib; sa_convert_path_opa_to_ib(&ib, rec); ib_sa_pack_path(&ib, &resp->path_data[i].path_rec); + + } else { + ib_sa_pack_path(rec, &resp->path_data[i].path_rec); } }