Message ID | 1521636712-30608-2-git-send-email-Michal.Kalderon@cavium.com (mailing list archive) |
---|---|
State | Accepted |
Delegated to: | Jason Gunthorpe |
Headers | show
Return-Path: <linux-rdma-owner@kernel.org> Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id E13EB600F6 for <patchwork-linux-rdma@patchwork.kernel.org>; Wed, 21 Mar 2018 12:52:33 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id C72C128B78 for <patchwork-linux-rdma@patchwork.kernel.org>; Wed, 21 Mar 2018 12:52:33 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id BC02329775; Wed, 21 Mar 2018 12:52:33 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.8 required=2.0 tests=BAYES_00,DKIM_SIGNED, RCVD_IN_DNSWL_HI,T_DKIM_INVALID autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 3D49A2973F for <patchwork-linux-rdma@patchwork.kernel.org>; Wed, 21 Mar 2018 12:52:33 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751502AbeCUMwc (ORCPT <rfc822;patchwork-linux-rdma@patchwork.kernel.org>); Wed, 21 Mar 2018 08:52:32 -0400 Received: from mail-by2nam03on0089.outbound.protection.outlook.com ([104.47.42.89]:57960 "EHLO NAM03-BY2-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1751405AbeCUMwb (ORCPT <rfc822;linux-rdma@vger.kernel.org>); Wed, 21 Mar 2018 08:52:31 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=CAVIUMNETWORKS.onmicrosoft.com; s=selector1-cavium-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version; bh=VOuuHsfb3X0fc4BmefHV4q4ZWpuWdG4wWdvASdHu9B4=; b=URggALfg20gqkCkCd+X4sHy2UmVVAZA8hsWy2ioJpepjkWwSNQwOgmCg2OocPypzPp7IfftHZMlaaPHlOMEbXktVXHxYruqEJycCM/jf9ZGJFKHbuwthWBtJXjwwlcD3lc4W/fAh+yLGUfad8Nm/bPi3OHn/CxBnZ37JhwAuKg4= Received: from SN4PR0701CA0016.namprd07.prod.outlook.com (2603:10b6:803:28::26) by SN6PR07MB4224.namprd07.prod.outlook.com (2603:10b6:805:62::17) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P256) id 15.20.588.14; Wed, 21 Mar 2018 12:52:30 +0000 Received: from BN1AFFO11FD014.protection.gbl (2a01:111:f400:7c10::139) by SN4PR0701CA0016.outlook.office365.com (2603:10b6:803:28::26) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384) id 15.20.609.10 via Frontend Transport; Wed, 21 Mar 2018 12:52:29 +0000 Received-SPF: Fail (protection.outlook.com: domain of cavium.com does not designate 50.232.66.26 as permitted sender) receiver=protection.outlook.com; client-ip=50.232.66.26; helo=CAEXCH02.caveonetworks.com; Received: from CAEXCH02.caveonetworks.com (50.232.66.26) by BN1AFFO11FD014.mail.protection.outlook.com (10.58.52.74) with Microsoft SMTP Server (version=TLS1_0, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA_P384) id 15.20.527.18 via Frontend Transport; Wed, 21 Mar 2018 12:52:29 +0000 Received: from lb-tlvb-michal.il.qlogic.com.com (10.185.6.89) by CAEXCH02.caveonetworks.com (10.17.4.29) with Microsoft SMTP Server id 14.2.347.0; Wed, 21 Mar 2018 05:52:27 -0700 From: Michal Kalderon <Michal.Kalderon@cavium.com> To: <michal.kalderon@cavium.com>, <dledford@redhat.com>, <jgg@mellanox.com> CC: <yuval.bason@cavium.com>, <linux-rdma@vger.kernel.org>, Michal Kalderon <Michal.Kalderon@cavium.com>, Ariel Elior <Ariel.Elior@cavium.com> Subject: [PATCH v3 for-rc 1/3] RDMA/qedr: fix QP's ack timeout configuration Date: Wed, 21 Mar 2018 14:51:50 +0200 Message-ID: <1521636712-30608-2-git-send-email-Michal.Kalderon@cavium.com> X-Mailer: git-send-email 1.9.3 In-Reply-To: <1521636712-30608-1-git-send-email-Michal.Kalderon@cavium.com> References: <1521636712-30608-1-git-send-email-Michal.Kalderon@cavium.com> MIME-Version: 1.0 Content-Type: text/plain X-EOPAttributedMessage: 0 X-Forefront-Antispam-Report: CIP:50.232.66.26; IPV:NLI; CTRY:US; EFV:NLI; SFV:NSPM; SFS:(10009020)(376002)(346002)(396003)(39860400002)(39380400002)(2980300002)(1110001)(1109001)(339900001)(189003)(199004)(6346003)(106466001)(104016004)(105606002)(86362001)(26005)(2906002)(186003)(316002)(72206003)(356003)(478600001)(336012)(5660300001)(8936002)(8676002)(2201001)(305945005)(16586007)(77096007)(81166006)(54906003)(110136005)(50226002)(51416003)(2950100002)(36756003)(69596002)(81156014)(50466002)(4326008)(76176011)(48376002)(107886003)(6666003)(47776003); DIR:OUT; SFP:1101; SCL:1; SRVR:SN6PR07MB4224; H:CAEXCH02.caveonetworks.com; FPR:; SPF:Fail; PTR:50-232-66-26-static.hfc.comcastbusiness.net; MX:1; A:1; LANG:en; X-Microsoft-Exchange-Diagnostics: 1; BN1AFFO11FD014; 1:V5ibSqQD7x+W6mbYpkanfkUJVkyjqEQR2wnr4E0lNxvHabnt6sjj4ojSKovYrKCNu0F9m0hax9bt4oOb2hpL7OI5OqH0uavs9uU/HMKcI0OO3y0+e1vJMNWOTqr9FefN X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: a1bbcf66-8630-4e4e-2b6c-08d58f2a9b4f X-Microsoft-Antispam: UriScan:; BCL:0; PCL:0; RULEID:(7020095)(4652020)(5600026)(4604075)(4534165)(4627221)(201703031133081)(201702281549075)(2017052603328)(7153060); SRVR:SN6PR07MB4224; X-Microsoft-Exchange-Diagnostics: 1; SN6PR07MB4224; 3:ZyJXweThxSVYyAZGiAwAVj8Vp5oIJ/NRZmx1meMI9expm/CAjpQC822Mqg1aL8PF8vUgitdEpRrsjF1FjY+re9Fvm0Nv7bsH8qidh4H3H9kSNz1V4mKZ7kNjVe+hNX4fNotwnfp9TuX+VDqCJAo5TfEjr7egFvFA7gQMnPqgxqAu6WwmKvd68hYZkAb8ubooi29ewTfger4NESJjLBaNYoEohv/qkSpLe3e+c11Qxzki0HEiSKSVQyWA8yogz3kNWsNHYT7xUmF/ogIXzoChg3WvMnSZT8p5ZHAPgVWrZaKIgpg1/U86Hsq7GpQwJgN0GfLi++N5PXMFJUiJbQ1YwoVr4y3phnty8Kqn28/d5z8=; 25:xM7IrDsdy/o7ne1Smb1YPiU/KIun+eqRwvKPsBsLSpaQKjG5iNQPZKHxnIFl7WzFNM8csJERu87CN4HXMPaaHxBCCS4b+9LJOdIHX40KgkgkMA4ZDi8yqL4iSwOWEq8COe113vlnrDjwkfF2kdEnQ1fJO4Ze6RQaZnkDuLCQPfe4fKSa6sEO+wOWNI0wtawXHyfnCP5xLysygmVZdcmo16KqjOk6JkAvL5Jt6gpyWfXl0bLkVU/TCyY0kTpGxTwz+Y9tI34GQ1yixlnyyvUL7aynbXB3EB6dGk/cb0yOfkRf7PzbUfCYmVWE8/7GAp1hCfDCIbWmcvwwqG3k9hjGOg== X-MS-TrafficTypeDiagnostic: SN6PR07MB4224: X-Microsoft-Exchange-Diagnostics: 1; SN6PR07MB4224; 31:0JtUeHV0v0NnEqwQ1Y+MPq7mroH/cl4V7eEj/tnIz9TbZCTP0HXCylxF8MR/kUFDESmndf3kSmYfj+Kr4mwU4R5C8RdPPmgsPZBW3HQJde6MzZ/IuqpJ1GBVxs5omxLFRc1OpFp3nPX440zNVb8bypWisW2dS8qekvl5lzRg58CHHsCNTs/7VSTiNJl8e53Zqnyyey+gwf1guET5sUNWw1i8sfWPVkZdbEnd/fKr2x4=; 20:VYy6JH3WXPjpMlA8sIWP/mKQbBCSLqk5QIZb8vARKN4BmSrKIQ7/864ywrD01IkpiPcjErI4PoyybepYWPFH1qDUN2lcOaB28x3NxN0aayP6HKDx2doMx1pE+F5OFZgTxLPbvDwRHZfCr3bCr7jmSSxudjPAGNzeg5ZWoTD1R4OAP6L3CHbKOSHAX+Vzs5jmGiKKKTbDfpxz3fXLNpysL3trV2ZilSGXO3Gwi/tun/JhHjcQ+TUsXfq66eF9TkleiV5u2FDhHqaMv3acmqPhBk1RnKwBIurX0/v01sWVaVbCE4KlJdsZfkMC8HKR7Db0p8JBBTNgPausxwZvxf7isONZeGCs30+oLQ+2MZc2Do7DKWRjehL6VEfqQaWSViaP2aB1EmfSOUo2xk3+Ns5T83SRjlMltiY32+dzjChTscAf521AQ30aCHbYzsB4osiuzd5VVusxeCgQeZGXs4pcCO1KTxDEjEQAwexc3ACP9FNp4A6nB3mUWuI56UbBZWfa X-Microsoft-Antispam-PRVS: <SN6PR07MB4224B2B76D58D466C2ACEE1988AA0@SN6PR07MB4224.namprd07.prod.outlook.com> X-Exchange-Antispam-Report-Test: UriScan:; X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(8211001083)(6040522)(2401047)(5005006)(8121501046)(93006095)(93001095)(3231221)(944501323)(52105095)(10201501046)(3002001)(6041310)(20161123560045)(20161123564045)(20161123558120)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(20161123562045)(6072148)(201708071742011); SRVR:SN6PR07MB4224; BCL:0; PCL:0; RULEID:; SRVR:SN6PR07MB4224; X-Microsoft-Exchange-Diagnostics: 1; SN6PR07MB4224; 4:lC0KyeTGJUHeAx2pbIzCyi2P8uljhJe9dKrb0oi2MvWHJJ+TyClH4P4V16TJi5F5I5YhpAy9qG3og4b293JZok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CTNhc8y6h9+ycCdWz9AiKVGdH3aXr/uD5OWvNmfzMqGe4?= =?us-ascii?Q?uBgaw5BY2jZRgwsSe2CRHbs1EI6CkgXQBkAdv7rt1EeeCE/is2iEPmzWG1Zg?= =?us-ascii?Q?CEvIOpDfnQUI+Yg6ckwCc4rPQDEe+WIBy6E2DT74pOwrz67uRYbEKEhpMrES?= =?us-ascii?Q?opyLAMNz1UATVgiQkrccP/Hja2jriZ4n69pIXJWqh7GtWqcJ9Fgaed3ex+kC?= =?us-ascii?Q?aQhGKr7lRkduWQ2boMN/HnXp8WtD1xSX169JHqqaG0ADzIOGHgihSy8TdfzE?= =?us-ascii?Q?qsyYkxe7Js7KHNqvlnST2ZFNjOhNp9p1JNTad9L7IsNv2Nsi6zzkDpnAe7ed?= =?us-ascii?Q?6yMQY6edmb0bRyQ5m+qeVd5kKrb6U0Y7AeKH8IHcr4978ewspMjTMRENW8Xp?= =?us-ascii?Q?8x2GKjbXqW469u/PniWC3z2Ord+J9MtSrdFoWi466uhr4wwPg=3D=3D?= X-Microsoft-Antispam-Message-Info: Wo5dHoVvDUlrerHB9mvRMhf79ZRWPe4W57jOuR+tprzjd0fwbDrqESFSqO/pBqK8RZNQJw/0h5GzIBbes1tEz30lIV6aN7+Br3EX0mCybOrGtOJJZarcKJwKew/76N1/MTdILfnXy+J+AePBB2TrULrsczNwNk068mcPn8b4k44IqEX1u+oL3ilxJCGc6CQa X-Microsoft-Exchange-Diagnostics: 1; SN6PR07MB4224; 6:+9EkkOJh3jguLJsfHvV/mvYdcrHHja3oHty3ATKeTAk3yRSJf5Yx6Hp4WgoZCUdnRYHP5WqII2x0/lEiIc5Txi6lljTI7o3Fok1JtPfAXLw1C3uug251//1XIrsUlnGZH5yjXvHyT+5NftZfyq0mhyADoA5ne7BKdg/bkYB9UsyRBWKUNYtXfASZXaBBSGUHrLNSpL9ilIAserya7czweNi/Qygeax04mxisVmHL/BFi8EnSiH6lSvvHRLho3KrjFSV2nDDVAGbjk/zvAwTnn0Xpkcl+Dt0Ot9TojeUuVf/7ck9vXfGpxKsXOFGHhRrhJAXtvhvVf2ZpjLF6ctMHTWl1tdhIw4vDtqtVDrrwx38=; 5:k/P2AaqnkqsC4FZ9eng9qEXW2HtZfSfWW98nWZ+yBCDH/fMuLYHBFjESVHuzmbYS9jBbtgrIvGHap4mGosFek7YMk93/41YBcya27KvbajO9wtSffsLMdMoJgcPkAS4cZSAe/i3o4WAtA9ZGHJTa3/1AFlER/hoNopvBJT66kvE=; 24:ubjHlqp2gp52Nqk/eq/YJhdQ1l4BPzcLD8XpG1PSmQdbKQKoKQOODjrjn5IGFKEUFNr/cpK7zDSDgwlt/bvU0cv1nr911Rvpzn5PtHdkLaM=; 7:84zm5kEo2S0wRjPsTHb19rsFJ4tpAGXHD/EytTibkZmfDvtOpF3FTjxYZgisv7KWMS4H0eotpe2h1130SVEA/cHVT1f67CwbCTATpjDrDZhweH9wHIR4f6RHomLyLJ+1dcZx173guYOZCaM/0Lmo0FAO1M3vWyU7P9zUbGJiM610uCT8myhLYgtOziaD4ua9yavPd0PNhAqodMCcg635XtPiVWRaz6/yZE/+M/67AT4MtFvzc+vSA2P18oRB9RBv SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-OriginatorOrg: cavium.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 21 Mar 2018 12:52:29.6416 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: a1bbcf66-8630-4e4e-2b6c-08d58f2a9b4f X-MS-Exchange-CrossTenant-Id: 711e4ccf-2e9b-4bcf-a551-4094005b6194 X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=711e4ccf-2e9b-4bcf-a551-4094005b6194; Ip=[50.232.66.26]; Helo=[CAEXCH02.caveonetworks.com] X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: SN6PR07MB4224 Sender: linux-rdma-owner@vger.kernel.org Precedence: bulk List-ID: <linux-rdma.vger.kernel.org> X-Mailing-List: linux-rdma@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP |
diff --git a/drivers/infiniband/hw/qedr/verbs.c b/drivers/infiniband/hw/qedr/verbs.c index 875b172..716fae0 100644 --- a/drivers/infiniband/hw/qedr/verbs.c +++ b/drivers/infiniband/hw/qedr/verbs.c @@ -2086,18 +2086,23 @@ int qedr_modify_qp(struct ib_qp *ibqp, struct ib_qp_attr *attr, SET_FIELD(qp_params.modify_flags, QED_ROCE_MODIFY_QP_VALID_ACK_TIMEOUT, 1); - qp_params.ack_timeout = attr->timeout; - if (attr->timeout) { - u32 temp; - - temp = 4096 * (1UL << attr->timeout) / 1000 / 1000; - /* FW requires [msec] */ - qp_params.ack_timeout = temp; - } else { - /* Infinite */ + /* The received timeout value is an exponent used like this: + * "12.7.34 LOCAL ACK TIMEOUT + * Value representing the transport (ACK) timeout for use by + * the remote, expressed as: 4.096 * 2^timeout [usec]" + * The FW expects timeout in msec so we need to divide the usec + * result by 1000. We'll approximate 1000~2^10, and 4.096 ~ 2^2, + * so we get: 2^2 * 2^timeout / 2^10 = 2^(timeout - 8). + * The value of zero means infinite so we use a 'max_t' to make + * sure that sub 1 msec values will be configured as 1 msec. + */ + if (attr->timeout) + qp_params.ack_timeout = + 1 << max_t(int, attr->timeout - 8, 0); + else qp_params.ack_timeout = 0; - } } + if (attr_mask & IB_QP_RETRY_CNT) { SET_FIELD(qp_params.modify_flags, QED_ROCE_MODIFY_QP_VALID_RETRY_CNT, 1);