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 Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 21444ECAAD2 for ; Mon, 29 Aug 2022 12:23:49 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230036AbiH2MXr (ORCPT ); Mon, 29 Aug 2022 08:23:47 -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: Precedence: bulk List-ID: X-Mailing-List: linux-rdma@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!