From patchwork Mon Oct 24 11:30:28 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Greg KH X-Patchwork-Id: 9121 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:6687:0:0:0:0:0 with SMTP id l7csp456294wru; Mon, 24 Oct 2022 06:33:56 -0700 (PDT) X-Google-Smtp-Source: AMsMyM7bpaN4gdujxlbY5UGJM0Tg18PPbFTl5whDjDnYDxB9sovHjNdyadymIzLDz8rOtQgNP1CW X-Received: by 2002:a05:6402:4029:b0:45b:d50c:b9b0 with SMTP id d41-20020a056402402900b0045bd50cb9b0mr30682311eda.126.1666618436556; Mon, 24 Oct 2022 06:33:56 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1666618436; cv=none; d=google.com; s=arc-20160816; b=HoqGgzIeguV//SSKGbcM0H0FNcvKFQie/fGiB/nITlzw/s+LiUHHo2ORge6clPQOpR 4J04XhdwT4KaC87L4yyVo0ip00EWSFk9W5ImpEfSqkpGkEeyZPTOn/Z1DeN2XKM34yvX G1mc4mKyEufzn/NENESVrv72ksKnJ6rj83cq9V/1AyTrgf9UCpg8SW8I10ux7F16WPVR o1INVjyFLoy6iAr8z6TTg/VqfLppN9wgbjNiV2bCQMUiV/NLExETfOs7j0Z6xEw+4jJV U9nhVUfIuat7G/cx4kPcpC/5FHx58mUy2KlXDw69doT6FlUB7H5NIDWmpMcbLP1IIVDN 006Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=VJZqEYS6mOjQ+lOS2PfAcWkaI+pPzr80W8SVByAzm0E=; b=ZZIGP1t2xrjx9RwBAdR/B4ckJjn6SF8KwIsWQIDEv+xDsL3scFBcV9NSqK04K0hjEL nxNkAGvf82jJpxBEctFKTZiMVzsNJ2oZgMFzGEmkswr2I//VU5bgPxRqpeXq4mgMDLl5 /AohkN46Y8rX+ufxZTiHd9yjIacVE8NrhqT4ZeCLwuySVIAn8G/jzfjyHw5gyXsVjJkZ qu+YwAwCprwpwuuh7Q6M33igUOzmvz2+RNk9ATvHNhae4AtlvAW7DAY+eTo/SFcbBuh9 oXpiUig/4trFt+DlvibbBWxrWFEdnqJ5k7V/OxpsVjxYfT15YZtJyKtKw1/hompf0Syd cIVg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=HyYwiGp6; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id d19-20020aa7d693000000b00461d3757951si1821163edr.607.2022.10.24.06.33.28; Mon, 24 Oct 2022 06:33:56 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=HyYwiGp6; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231425AbiJXNSH (ORCPT + 99 others); Mon, 24 Oct 2022 09:18:07 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:59474 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235932AbiJXNRQ (ORCPT ); Mon, 24 Oct 2022 09:17:16 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id AF9E7A3F44; Mon, 24 Oct 2022 05:26:16 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id A6B95612BC; Mon, 24 Oct 2022 12:25:58 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id BED1EC433D6; Mon, 24 Oct 2022 12:25:57 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1666614358; bh=kV9d18G9T/YjzHDps5KKzk5SgDYJImYmuS9j/QndjsQ=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=HyYwiGp6QGYu6Bl3wtWd7+b6rfDJZBjsqymKpROaRWVBQELztrC4zRBAsm09+R+KD c1DSZ1G0x4ZSBi6HD5zQJARMsrUXxzwqzwhFj6uPNIzN/2mT8cGtSTIwWvFyTpyM16 3fSedvyBrHCpzUTX5bAH4wqj6MwSn2kbz3Qhq3rU= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Mark Zhang , Mark Bloch , Leon Romanovsky , Sasha Levin Subject: [PATCH 5.10 231/390] RDMA/cm: Use SLID in the work completion as the DLID in responder side Date: Mon, 24 Oct 2022 13:30:28 +0200 Message-Id: <20221024113032.621977545@linuxfoundation.org> X-Mailer: git-send-email 2.38.1 In-Reply-To: <20221024113022.510008560@linuxfoundation.org> References: <20221024113022.510008560@linuxfoundation.org> User-Agent: quilt/0.67 MIME-Version: 1.0 X-Spam-Status: No, score=-7.6 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_HI, SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1747576093560849776?= X-GMAIL-MSGID: =?utf-8?q?1747576093560849776?= From: Mark Zhang [ Upstream commit b7d95040c13f61a4a6a859c5355faf583eff9658 ] The responder should always use WC's SLID as the dlid, to follow the IB SPEC section "13.5.4.2 COMMON RESPONSE ACTIONS": A responder always takes the following actions in constructing a response packet: - The SLID of the received packet is used as the DLID in the response packet. Fixes: ac3a949fb2ff ("IB/CM: Set appropriate slid and dlid when handling CM request") Signed-off-by: Mark Zhang Reviewed-by: Mark Bloch Link: https://lore.kernel.org/r/cd17c240231e059d2fc07c17dfe555d548b917eb.1662631201.git.leonro@nvidia.com Signed-off-by: Leon Romanovsky Signed-off-by: Sasha Levin --- drivers/infiniband/core/cm.c | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) --- a/drivers/infiniband/core/cm.c +++ b/drivers/infiniband/core/cm.c @@ -1643,14 +1643,13 @@ static void cm_path_set_rec_type(struct static void cm_format_path_lid_from_req(struct cm_req_msg *req_msg, struct sa_path_rec *primary_path, - struct sa_path_rec *alt_path) + struct sa_path_rec *alt_path, + struct ib_wc *wc) { u32 lid; if (primary_path->rec_type != SA_PATH_REC_TYPE_OPA) { - sa_path_set_dlid(primary_path, - IBA_GET(CM_REQ_PRIMARY_LOCAL_PORT_LID, - req_msg)); + sa_path_set_dlid(primary_path, wc->slid); sa_path_set_slid(primary_path, IBA_GET(CM_REQ_PRIMARY_REMOTE_PORT_LID, req_msg)); @@ -1687,7 +1686,8 @@ static void cm_format_path_lid_from_req( static void cm_format_paths_from_req(struct cm_req_msg *req_msg, struct sa_path_rec *primary_path, - struct sa_path_rec *alt_path) + struct sa_path_rec *alt_path, + struct ib_wc *wc) { primary_path->dgid = *IBA_GET_MEM_PTR(CM_REQ_PRIMARY_LOCAL_PORT_GID, req_msg); @@ -1745,7 +1745,7 @@ static void cm_format_paths_from_req(str if (sa_path_is_roce(alt_path)) alt_path->roce.route_resolved = false; } - cm_format_path_lid_from_req(req_msg, primary_path, alt_path); + cm_format_path_lid_from_req(req_msg, primary_path, alt_path, wc); } static u16 cm_get_bth_pkey(struct cm_work *work) @@ -2163,7 +2163,7 @@ static int cm_req_handler(struct cm_work if (cm_req_has_alt_path(req_msg)) work->path[1].rec_type = work->path[0].rec_type; cm_format_paths_from_req(req_msg, &work->path[0], - &work->path[1]); + &work->path[1], work->mad_recv_wc->wc); if (cm_id_priv->av.ah_attr.type == RDMA_AH_ATTR_TYPE_ROCE) sa_path_set_dmac(&work->path[0], cm_id_priv->av.ah_attr.roce.dmac);