Received: by 2002:ad5:4acb:0:0:0:0:0 with SMTP id n11csp1255821imw; Tue, 5 Jul 2022 06:31:19 -0700 (PDT) X-Google-Smtp-Source: AGRyM1swjcayem2TaMobIuWeTkNEBHAIQrOhshRSDhLE8ft6iCKGUahcqb63ax6kgIjNXohlXdOn X-Received: by 2002:a05:6a00:a1f:b0:525:3ad6:fb7e with SMTP id p31-20020a056a000a1f00b005253ad6fb7emr31372025pfh.68.1657027879667; Tue, 05 Jul 2022 06:31:19 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1657027879; cv=none; d=google.com; s=arc-20160816; b=vd+DyLaQhrod7KLXii51N5+bMfmP5np43n4KvYLILB1UDMfIeFh4XXi11hdVt4oZpA kr167zLLXHR+rNpB+MqMQbPB9uM8WUZFEetfOcdTlGcMXklGh2KYo6BqkB61mWbz6wDS rkAt6NnQJo8F8Pfrl5NbwvU6nm/9aNgkbiMlqesgxHAESXAtpvDq1xKS+Vs9vf61ZpgR GwfWbcjlYiey45KOw8YDOQwnGbAjFoNyFov0+DZgg8k9oFOAX2Y23QN39v1Rbf9wcTbE 2FRvZU1rBpntrtHS1ZsYgs9YTQ5Rr5pOnV0HivXhhmVliSw7nkNmW93z/EQTTAxLq8Z2 nxUA== 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=qyQICEA+MA30roLRZN8TLcUCQQw17gMDw/vOpUIp0So=; b=S6CkcwMZl6L5uj3hzJRL2z2JoAL4fTTN/prK3JyBlE336SE4HegLQFK7XKk8vA9dHW 7mMvh688N0q45ZB7JaOQyik7qR0yujheFG+/vYAt3MAdQYudflsHNtD6rcPzKkgWEdev A38DocU+724mB9IYifGtAYYdR52yb1G1rCJHFZYaKRMZ4TVehvTN0XCYbvQW/TOXRiHW lWq93mveCcutOZcc2+tk0h8CBUNn3CmEe2YQyIO1pViOxxGm5L5hlwVYWsFsgOp1ge+H RBsqQIKWSXOMENciuye2dsZZJ3aEtfUVwi19atzpVsUBFroDpboiZ4wdA0UHIXgGrG0a KWrg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=HYTX0HS8; 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 Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id n3-20020a170902f60300b00164027788e8si45345705plg.254.2022.07.05.06.31.07; Tue, 05 Jul 2022 06:31:19 -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=HYTX0HS8; 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 S235484AbiGEMN4 (ORCPT + 99 others); Tue, 5 Jul 2022 08:13:56 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:47574 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234775AbiGEMH6 (ORCPT ); Tue, 5 Jul 2022 08:07:58 -0400 Received: from ams.source.kernel.org (ams.source.kernel.org [145.40.68.75]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id ECEB2193FC; Tue, 5 Jul 2022 05:07:01 -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 ams.source.kernel.org (Postfix) with ESMTPS id 99A2DB817D2; Tue, 5 Jul 2022 12:07:00 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 00DA2C341C7; Tue, 5 Jul 2022 12:06:58 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1657022819; bh=pCXAk4k3e529OArICjAe1YJg2OztYxZ7W0/Z47I8aRY=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=HYTX0HS8QhDUb3Eah2U+tWzfRLey8FxJuWwidZmXlVdnwNSEQoEqdCVZA5yjn7e7C gqCbXTZdIK8JL7MhQSvpOTNyk5yJlhUyTAFec8Ica9fJQmUzFH9LXH/Z2yCZhTSIpO zGKKn/G28GP1RC5yEhdVS3gUXThdtnY0vnp00xBc= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Kamal Heib , =?UTF-8?q?Michal=20Kalderon=C2=A0?= , Leon Romanovsky Subject: [PATCH 5.10 21/84] RDMA/qedr: Fix reporting QP timeout attribute Date: Tue, 5 Jul 2022 13:57:44 +0200 Message-Id: <20220705115615.945867944@linuxfoundation.org> X-Mailer: git-send-email 2.37.0 In-Reply-To: <20220705115615.323395630@linuxfoundation.org> References: <20220705115615.323395630@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-7.8 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,T_SCC_BODY_TEXT_LINE 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 From: Kamal Heib commit 118f767413ada4eef7825fbd4af7c0866f883441 upstream. Make sure to save the passed QP timeout attribute when the QP gets modified, so when calling query QP the right value is reported and not the converted value that is required by the firmware. This issue was found while running the pyverbs tests. Fixes: cecbcddf6461 ("qedr: Add support for QP verbs") Link: https://lore.kernel.org/r/20220525132029.84813-1-kamalheib1@gmail.com Signed-off-by: Kamal Heib Acked-by: Michal KalderonĀ  Signed-off-by: Leon Romanovsky Signed-off-by: Greg Kroah-Hartman --- drivers/infiniband/hw/qedr/qedr.h | 1 + drivers/infiniband/hw/qedr/verbs.c | 4 +++- 2 files changed, 4 insertions(+), 1 deletion(-) --- a/drivers/infiniband/hw/qedr/qedr.h +++ b/drivers/infiniband/hw/qedr/qedr.h @@ -418,6 +418,7 @@ struct qedr_qp { u32 sq_psn; u32 qkey; u32 dest_qp_num; + u8 timeout; /* Relevant to qps created from kernel space only (ULPs) */ u8 prev_wqe_size; --- a/drivers/infiniband/hw/qedr/verbs.c +++ b/drivers/infiniband/hw/qedr/verbs.c @@ -2622,6 +2622,8 @@ int qedr_modify_qp(struct ib_qp *ibqp, s 1 << max_t(int, attr->timeout - 8, 0); else qp_params.ack_timeout = 0; + + qp->timeout = attr->timeout; } if (attr_mask & IB_QP_RETRY_CNT) { @@ -2781,7 +2783,7 @@ int qedr_query_qp(struct ib_qp *ibqp, rdma_ah_set_dgid_raw(&qp_attr->ah_attr, ¶ms.dgid.bytes[0]); rdma_ah_set_port_num(&qp_attr->ah_attr, 1); rdma_ah_set_sl(&qp_attr->ah_attr, 0); - qp_attr->timeout = params.timeout; + qp_attr->timeout = qp->timeout; qp_attr->rnr_retry = params.rnr_retry; qp_attr->retry_cnt = params.retry_cnt; qp_attr->min_rnr_timer = params.min_rnr_nak_timer;