Received: by 2002:a05:6a10:5bc5:0:0:0:0 with SMTP id os5csp3780140pxb; Wed, 13 Oct 2021 12:48:33 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyhV82Wn/lHrTVU3qojdAddySwQRE0EYPfID9LmGASoqC/3WtMU8fSL0kc9MN0w1GwXErGO X-Received: by 2002:a17:906:4c4a:: with SMTP id d10mr1382261ejw.391.1634154513047; Wed, 13 Oct 2021 12:48:33 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1634154513; cv=pass; d=google.com; s=arc-20160816; b=yChNd7kznyYWCLOryfYwa7AgtzxfDAUd3ny/m4DBNfCcWk02vEks0JExH7w5CyGhLM w+lXWweCA+GHUr8tYnNMcMpbEzjJE2LjHRiamlNiFlkWd0MSDTfcRVP+66WIAJ9dXC5j 2xH7/QxRYqIEAN0asPf3QNpXTJRIgSdBasf4i+/BR54HwBMu6vfYGJH5mRT/65zU/l8z c9939srCyyz7mU4jcbCz21GmfHSKg2UpxjNKW+FYllLnnOo1ZQ+f0PDV4v6MSEgjEs5w j58Wdr6XUJM+5L/EvJ2EpSdPA4BX2rNEevrZV8d47u/pH2ntF0HMIjbyYFbThOukJ8XG v4ew== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:in-reply-to:content-disposition :references:message-id:subject:cc:to:from:date:dkim-signature; bh=my4TCSz1X24KsYVpxqvOroGVmMws0oXIw1icSJg6kjY=; b=h0PEpGyZ5nWn/05rLSpieFQY0hlpW4Kbf847WN5vooKvGdC7b8wbVIeNTAyjVx+0eZ jqe/XxVK+Hha5FEb5k6fE1a4O6rQ61ar+PN/GTF+jXId281USjEYC4v+yf0CEwUcXc6K Tr4vwMT53BRqlX/NAxsU2Ea5ZMkoXbmsQHQXiHHm4YZlUBwszdabF5YEZUTJqzcZB1hd AE7oeYILTNsKyjvZ8MnMOk5Mk5HIdM7zyfdumYYLMIpa+MXEkli+hrR5EkUY1bJKlixs vDRR2dPNiQYIQDxGHjrlah+BasZE25TC/j4veEwOrfbJz34x02LBuCCmtvadc0q3QmOt GlQw== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@Nvidia.com header.s=selector2 header.b=kPJn7npC; arc=pass (i=1 spf=pass spfdomain=nvidia.com dkim=pass dkdomain=nvidia.com dmarc=pass fromdomain=nvidia.com); spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=nvidia.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id i10si608897edb.111.2021.10.13.12.48.09; Wed, 13 Oct 2021 12:48:33 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@Nvidia.com header.s=selector2 header.b=kPJn7npC; arc=pass (i=1 spf=pass spfdomain=nvidia.com dkim=pass dkdomain=nvidia.com dmarc=pass fromdomain=nvidia.com); spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=nvidia.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S239034AbhJMTrO (ORCPT + 99 others); Wed, 13 Oct 2021 15:47:14 -0400 Received: from mail-sn1anam02on2048.outbound.protection.outlook.com ([40.107.96.48]:56641 "EHLO NAM02-SN1-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S239103AbhJMTrH (ORCPT ); Wed, 13 Oct 2021 15:47:07 -0400 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=aC30MCULTqQ91yDbJttesI7Zshxf9+I8FmN35NCmglU0EbGrYi7jLUuZVI1vy9xKSDtlWDSRlC8F31T6DasUmHEmAnm0o1pP5JiURWBRuDJKmjxOyPLVQY9FgbKNiH48FtgHMIdG/CzFC5CiN0EKmfHI5iowqFnIE0P+LMqt8DHMN4/X3vgR+c740V9b0TuLOy4mi9rDaf/E2sL8UoPfEQokjPuKHVE8FLROF3SLK6HC0BSUOLWFncvMNhCwOstixHiYsF0VzHephkEXX8nYg3kPggPkw4b9J1Bzxw5Mij1l7WEJd+tH8yMrdjPoxCxUufINv9Ted0JUZ6cYVF8Okg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=my4TCSz1X24KsYVpxqvOroGVmMws0oXIw1icSJg6kjY=; b=n3w+utxjHbJ0n9qFCBIUNlzFqj4Z/5bSWbau/t5ENObeJy7kR5inwTiuLZI1jKBVRe7zBi6IHsDDyt2AgXwgyR+Ia/5mUA4+SLUO6UGSn0B6EFCsJfZGvxNpKIyFot9ZHurmc5pQWc7hFywSO/xs9KrGNE9e3UuTzzS88H8jZC+mLQKDCmvhPcHkcBlk1j+pPfvJ7D0k4yVRJHzfwyeCnd4jc+Q0UxhO8OAZMrqjqrw01/hGWS1ZI592l7isFXo1+wjns/h2fQ57cF5S7jylPQYz42OAjjY7+1NKAI+hhmymjomHXMRdRbnkq2pY4hGDbE3MvwNj2Xsx8W0QA6VWvA== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=nvidia.com; dmarc=pass action=none header.from=nvidia.com; dkim=pass header.d=nvidia.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=Nvidia.com; s=selector2; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=my4TCSz1X24KsYVpxqvOroGVmMws0oXIw1icSJg6kjY=; b=kPJn7npCZWSNKIzTh6dyjXnDlB5bLHzEaCCUwhhsCg0Nl48ryI3TwL98MHafWK8wzOZS7BCPfPc2LGcTX4ZTkv7j+Qx6AysXEisLsUR5SvYaI15SvVpiKCxFgY/Zdk9d9qRV4su4xw9A6URfqhSCa/9+C+z37ug96hu5OkDTQp0lbKo6h5MtGZIV6vBdupTwu7EMTG1J0/QizdeAtOmIYER8ViNZiMuuTXfNQZCKvvMIv9SP8trcyQ9ylih18yjlQjQBqPqe8mC4rafeRoInhOMyb+0plyeQ1u0H+Xz5yXV6vIMwYPGe3zJgBuqq7po12WovWBGi1vII/fGCXooIHw== Authentication-Results: deltatee.com; dkim=none (message not signed) header.d=none;deltatee.com; dmarc=none action=none header.from=nvidia.com; Received: from BL0PR12MB5506.namprd12.prod.outlook.com (2603:10b6:208:1cb::22) by BL1PR12MB5254.namprd12.prod.outlook.com (2603:10b6:208:31e::21) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4587.22; Wed, 13 Oct 2021 19:45:01 +0000 Received: from BL0PR12MB5506.namprd12.prod.outlook.com ([fe80::e8af:232:915e:2f95]) by BL0PR12MB5506.namprd12.prod.outlook.com ([fe80::e8af:232:915e:2f95%6]) with mapi id 15.20.4608.016; Wed, 13 Oct 2021 19:45:01 +0000 Date: Wed, 13 Oct 2021 16:45:00 -0300 From: Jason Gunthorpe To: Logan Gunthorpe Cc: linux-rdma@vger.kernel.org, linux-kernel@vger.kernel.org, Doug Ledford , Bart Van Assche Subject: Re: [PATCH] RDMA/core: Set sgtable nents when using ib_dma_virt_map_sg() Message-ID: <20211013194500.GA3494942@nvidia.com> References: <20211013165942.89806-1-logang@deltatee.com> Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20211013165942.89806-1-logang@deltatee.com> X-ClientProxiedBy: BL0PR0102CA0068.prod.exchangelabs.com (2603:10b6:208:25::45) To BL0PR12MB5506.namprd12.prod.outlook.com (2603:10b6:208:1cb::22) MIME-Version: 1.0 Received: from mlx.ziepe.ca (142.162.113.129) by BL0PR0102CA0068.prod.exchangelabs.com (2603:10b6:208:25::45) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4587.26 via Frontend Transport; Wed, 13 Oct 2021 19:45:00 +0000 Received: from jgg by mlx with local (Exim 4.94) (envelope-from ) id 1makBQ-00EfCk-66; Wed, 13 Oct 2021 16:45:00 -0300 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: a58de165-59fc-4c6b-65c8-08d98e81f1d9 X-MS-TrafficTypeDiagnostic: BL1PR12MB5254: X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:3513; X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: rMIwvuxju2h/+IFnVc0VPprKTPneNvGuw8JHSSv59enDFMg6Ns2U0rTusLklAnKj4j7sbuaXkWl2SpmYUnw2WBP++G54Rq/M2zzfuAUHeLJNNmwhxlf9KA9irZ0aLTzTBYdPwfQgHeUWlXbrT0+dOdp+6I9ORRpIQ3VgjhELLmtRusi05DHqHcNsWBuIlnNxURlRx0kQkVWHPcx/yW520rHVpfp6DPeZ0ZvjhEoSOQLvZ6Rfu1spzzCrB7JLRlm6t2njeHEW9qNxIabLwA15wOSNFukfI3fIn8DbI4Gif/fE6/7Vjg/fCrpAP580Zm90aSruQqiFgY2J/dYAkzLBG8tWDSJtt7j1Iqlx5TIblEUoeiw+wcNO3D5yUPUFPTnnle9dDFi5q8iFS2hFjmMoon6hFh8ysacdFluVIOiM5IxEOtIvASi9rv6esGLc4d0DOX6t4kjp8ePkoYPcvSw8J9jNBOpYIMMqxP8KNn8g8prc8+3bzuP93nJ37/lxS/aK9hvcWdKKoRLC+9dUhr3LdBq7vT8n3scw5i/BDiAoC5EWtVEdb/hNzUeqEgVwfreZlsB/PX4yo8Nm4t0z4/sXSRUl8WP5tkARxp8Pzx9PsGjVfu0fcs+Q9dMIzCy65wpnku4gfPP5m/hLJtMecdr5MF5V61YGvjzD8Qzht/HXvJwPxtBYaIaIjRqwc6xdhYGYVGi5c2mp7NKDBcPUBfrQ0Ay8Kt63d6g23ngpnTiJ97w= X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:BL0PR12MB5506.namprd12.prod.outlook.com;PTR:;CAT:NONE;SFS:(4636009)(366004)(26005)(2906002)(1076003)(38100700002)(186003)(966005)(8936002)(36756003)(86362001)(54906003)(6916009)(83380400001)(66946007)(66556008)(66476007)(33656002)(4744005)(9746002)(426003)(5660300002)(4326008)(8676002)(316002)(9786002)(508600001)(2616005);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?us-ascii?Q?hlj+KruDWjcqHGQ0d6PMkimzIoVmVBAz6n9/AanqzcUqXeD06b0p235mJ/0z?= =?us-ascii?Q?KyMbg0pFRrGaxCLUWu9E7VUh+gsoOHfJ77FxxV6tKc/0ncQRxfLTPTQCWHM5?= =?us-ascii?Q?rXxmcJXJPM64+X6BCmhQZDc3ArJNqzp2knt+TT4pGI2V/rK+Fhfr/6AOsOEo?= =?us-ascii?Q?XuF562MtUB5O7ZTcMK5kkH8vDHh0nbf3x4fRvRpHUqQ8aJfe851rllSY4nPG?= =?us-ascii?Q?jldzMU7UGXKbMCcD7LhA8FRHizznmjBxxcQjfWHMcFo1/8rQ6IWLVhVvr5O3?= =?us-ascii?Q?lC8fPlNziIuii1Sp5yiKQkBW05oD5TNU9D8pQMMwrxgpndtCyHClmrs8TZSm?= =?us-ascii?Q?/+uIl0wGSG9HKIoxOJK+PQWdEu5vP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ii?Q?S2LLTT79XzL58JsSeUYPtY+pALts5/Jt0Stn1P5ZmGSGgj51qTiJFZK31tqf?= =?us-ascii?Q?ZQ4HvufwspbuGiINZjWMxuon8FMcK+ebxW5/tzr1f4B3+g=3D=3D?= X-OriginatorOrg: Nvidia.com X-MS-Exchange-CrossTenant-Network-Message-Id: a58de165-59fc-4c6b-65c8-08d98e81f1d9 X-MS-Exchange-CrossTenant-AuthSource: BL0PR12MB5506.namprd12.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 13 Oct 2021 19:45:01.1696 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 43083d15-7273-40c1-b7db-39efd9ccc17a X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: kUTAYwnUm5xVBgoHlxRybsGPIEcgU6TM32rhNznhRXCaKEiHzN3YE8NEgRs6zEPh X-MS-Exchange-Transport-CrossTenantHeadersStamped: BL1PR12MB5254 Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, Oct 13, 2021 at 10:59:42AM -0600, Logan Gunthorpe wrote: > ib_dma_map_sgtable_attrs() should be mapping the sgls and setting nents > but the ib_uses_virt_dma() path falls back to ib_dma_virt_map_sg() > which will not set the nents in the sgtable. > > Check the return value (per the map_sg calling convention) and set > sgt->nents appropriately on success. > > Link: https://lore.kernel.org/all/996fa723-18ef-d35b-c565-c9cb9dc2d5e1@acm.org/T/#u > Reported-by: Bart Van Assche > Signed-off-by: Logan Gunthorpe > Tested-by: Bart Van Assche > --- > include/rdma/ib_verbs.h | 7 ++++++- > 1 file changed, 6 insertions(+), 1 deletion(-) Applied to for-next, thanks Jason