From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-16.2 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 94A45C2B9F4 for ; Tue, 22 Jun 2021 08:18:27 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 7FBFF6128C for ; Tue, 22 Jun 2021 08:18:27 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229853AbhFVIUl (ORCPT ); Tue, 22 Jun 2021 04:20:41 -0400 Received: from mail.kernel.org ([198.145.29.99]:44760 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229844AbhFVIUl (ORCPT ); Tue, 22 Jun 2021 04:20:41 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id 72E3B61289; Tue, 22 Jun 2021 08:18:25 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1624349906; bh=YKkHSdb0LbYZAmTQIOolpaiHX/VvCwVJWMLowJswj/Q=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=AsxSC9ZR5JxiVS1KyL4uV+hC8C83jZWds5X0ATvW9ELOkg92sxf1kfdS6WTQOXzxY hxTY1Xo3idLwgrafysmSUgIVlXvBsi+VLt+K9Q+SPhHXyPbfN+0Tvmhf6n5MhdvGJd D+RxdZCdV5cVZaDuz/4Vw+SynYn+XoQqj3ToHYFAtPOBGO7nD2mFpRR2JcVhi0as88 2GsP7WwL0X7yAOn3DHj64N0PDAfUUSq4ul64WF+3/etozwjL0SyigXagJzPuzwNIZl mgPWcrvw5/YU65KVk75MbBEyLDdY0e7fZKUybBHgACRZq14b5Nrh31xdQGXUw3I+s/ Ba10HnNm/YQvQ== Date: Tue, 22 Jun 2021 11:18:22 +0300 From: Leon Romanovsky To: =?iso-8859-1?Q?H=E5kon?= Bugge Cc: Doug Ledford , Jason Gunthorpe , linux-rdma@vger.kernel.org, Hans Westgaard Ry Subject: Re: [PATCH for-next] RDMA/cma: Fix incorrect Packet Lifetime calculation Message-ID: References: <1624281537-5573-1-git-send-email-haakon.bugge@oracle.com> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <1624281537-5573-1-git-send-email-haakon.bugge@oracle.com> Precedence: bulk List-ID: X-Mailing-List: linux-rdma@vger.kernel.org On Mon, Jun 21, 2021 at 03:18:57PM +0200, Håkon Bugge wrote: > An approximation for the PacketLifeTime is half the local ACK timeout. > The encoding for both timers are logarithmic. The PacketLifeTime > calculation is wrong when local ACK timeout is zero. In that case, > PacketLifeTime is set to the incorrect value 255. > > Fixed by explicitly testing for timeout being zero. > > Fixes: e1ee1e62bec4 ("RDMA/cma: Use ACK timeout for RoCE packetLifeTime") > Signed-off-by: Håkon Bugge > > --- > > * Note: This commit must be merged after ("RDMA/cma: Replace > RMW with atomic bit-ops") > --- > drivers/infiniband/core/cma.c | 8 +++++--- > 1 file changed, 5 insertions(+), 3 deletions(-) > Thanks, Reviewed-by: Leon Romanovsky