Received: by 2002:a05:6358:45e:b0:b5:b6eb:e1f9 with SMTP id 30csp3075956rwe; Mon, 29 Aug 2022 05:32:50 -0700 (PDT) X-Google-Smtp-Source: AA6agR76PzpIhzvugRWCFJMujTm5erFl8vgS+B38BkFNjkv1KGdJmDprSiPXO1/IFbPWzaPrtXyB X-Received: by 2002:a17:902:a60f:b0:172:e476:fde with SMTP id u15-20020a170902a60f00b00172e4760fdemr16175508plq.104.1661776369590; Mon, 29 Aug 2022 05:32:49 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1661776369; cv=none; d=google.com; s=arc-20160816; b=GSFvVTvmRrtdFmsRizVR0vOsOQJ+1sRNLcjbRPMNrrYS38ycdr0yFbDZkal+eL2DSy DMqgPDUkq8b0clWp+xerFUa7Bm6ChIhDSZWY5Ul1WTz1Y+zCoo1ENnGsOK84W08dvq0W SdILvxDrAGR9lDgvYmNvyPhN/N2KC8N70Z4yH1ouXnUYV+eX0WRSR1WwMz6l34W264HQ MKmVxbxKCQQ05DsYNs0grKdkcaOWMr0YlvWnc+GurLkMWGeKTTAwcTHFcU7LMmDKB8wK E3O+ZPHItwhoMyHO1t5vcWJkbykVODjSR7VtOnrDZx6dzNeeTLR3SjPxJsM7FB4PhW1A E/hw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=+A55H4/yN096lsbW+Xyxrp0MBDYtZheP+ZVPe1zIMOI=; b=e0lPxJThcqF7ID2zjw0CBPTX+Tg7TSjgIyxUYFGhqPom6/ewYDEEmgkHU6ID8CvS7F OKQRoxuYkVipM7pK/WWsHNWRzb0AOduHkjmE+F+WvlP0BU4UqltksVx5nPfimzMRzSRC wCiGuu4Z/RExaphl4zarJ6/VRRzViRVqa9zFWAPwtGliPHs0WogCfnmRpmFjgLPWW8Ch YaApB48+X2wN/gvmooWrz+Ej8oh55PEizxrMmt61ERpzAd5vnjy98k48Nx1LoEb8isc0 GQJf78glCnzTKy5OTP/IdQfArs5UgQwdX9tb9lIC9MdgRuhXSp3xt6wyBT9rzrrpoDFO 6G+Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=sufZFZ5D; 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=kernel.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id h13-20020a63df4d000000b0042890f36264si9101161pgj.34.2022.08.29.05.32.38; Mon, 29 Aug 2022 05:32:49 -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=@kernel.org header.s=k20201202 header.b=sufZFZ5D; 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=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229930AbiH2MXs (ORCPT + 99 others); Mon, 29 Aug 2022 08:23:48 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:35750 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230136AbiH2MXO (ORCPT ); Mon, 29 Aug 2022 08:23:14 -0400 Received: from ams.source.kernel.org (ams.source.kernel.org [145.40.68.75]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id AF871A8301; Mon, 29 Aug 2022 05:07:23 -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 9E749B80DD5; Mon, 29 Aug 2022 12:06:49 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id BD369C433D6; Mon, 29 Aug 2022 12:06:47 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1661774808; bh=r910AOmdtzWh1T2nXLlZAY+q5vomdymJKiLIiX4kBxI=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=sufZFZ5DzLcRGkjvc6sMF8qxrF7bGVWN8CVZrBEX1dOcjQKvBCyfC7tqXEQWKPERV IqQ1/3VxVndXTW5AzIMHYdrmcLxkJboY7iRt7+C7EI2qsj69MtcHNrCv4ekDOfl8gP V2sroHLcenKcyK9NJc2wZgp60mRjpEFxHzHd74ApPiYGxNPgWM73hgfA5DzDmo2VdZ 6sNnrYjRNHzCyxloQyU3xiXL1WO3sAt9PLhAgIHjkatSghIOWLguVeg0JuYGxtrkep Nw2CUr3NagEKUnpat68AYXoL2S3tFRL6Emeopu0eg2VqNdPv+ch2T5PvEOEh8gPYtI GU33Rdgbg9LpA== Date: Mon, 29 Aug 2022 15:06:43 +0300 From: Leon Romanovsky To: Jinpu Wang Cc: jgg@ziepe.ca, linux-rdma@vger.kernel.org, Christoph Hellwig , linux-kernel@vger.kernel.org Subject: Re: [PATCH 2/2] RDMA: dma-mapping: Return an unsigned int from ib_dma_map_sg{,_attrs} Message-ID: References: <20220826095615.74328-1-jinpu.wang@ionos.com> <20220826095615.74328-3-jinpu.wang@ionos.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: X-Spam-Status: No, score=-7.1 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 On Mon, Aug 29, 2022 at 11:40:40AM +0200, Jinpu Wang wrote: > On Sun, Aug 28, 2022 at 1:09 PM Leon Romanovsky wrote: > > > > On Fri, Aug 26, 2022 at 11:56:15AM +0200, Jack Wang wrote: > > > Following 2a047e0662ae ("dma-mapping: return an unsigned int from dma_map_sg{,_attrs}") > > > change the return value of ib_dma_map_sg{,attrs} to unsigned int. > > > > > > Cc: Jason Gunthorpe > > > Cc: Leon Romanovsky > > > Cc: Christoph Hellwig > > > Cc: linux-rdma@vger.kernel.org > > > Cc: linux-kernel@vger.kernel.org > > > > > > Signed-off-by: Jack Wang > > > --- > > > drivers/infiniband/core/device.c | 2 +- > > > include/rdma/ib_verbs.h | 6 +++--- > > > 2 files changed, 4 insertions(+), 4 deletions(-) > > > > You forgot to change ib_dma_map_sgtable_attrs() and various > > ib_dma_map_sg*() callers. > No, they are different. > ib_dma_map_sgtable_attrs and dma_map_sgtable return negative on errors. It is not the point. You changed ib_dma_virt_map_sg() to be unsigned, so now the following lines are not correct: 4138 int nents; 4139 4140 if (ib_uses_virt_dma(dev)) { 4141 nents = ib_dma_virt_map_sg(dev, sgt->sgl, sgt->orig_nents); "int nents" should be changed to "unsigned int". Thanks > > > > Thanks > Thanks!