Received: by 2002:a05:6a10:5bc5:0:0:0:0 with SMTP id os5csp3725347pxb; Wed, 13 Oct 2021 11:37:14 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyWkvtO27Vi0pmTdkiYFf+HyLd1ubS+7NgSpPOe8lQKICnf47A2wUGkTzbJtkEH8lTm1C3S X-Received: by 2002:a17:906:5f8e:: with SMTP id a14mr996411eju.155.1634150234503; Wed, 13 Oct 2021 11:37:14 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1634150234; cv=none; d=google.com; s=arc-20160816; b=wZBGJVjDjH65w2vS+P0XTYjO38ZG9nmtjpN+c2gZnG/RgsvUfPcwh6LBN/2M/2k9q2 NfDlX9UnBuf48aRr0H6alJXSihu5wmi/6xeOG1w0V7yNZQluQxSxTUbOvPXzZ8jIL6fR cClqTloyhSBbrqYm2mkmPnc5WDRyvmpHEC/zJVLdKO2sVBaQLc9O4mZJdgvaMuEO3Bbs S6hn7swfiQyEVC3b70JOUN4z/CaW/RYWmMTHnaJpzfpniAQ/Cpqp23d5v3SOnS9+Mc72 +DNDO03nFrIbEmaTeZuxaGn43nu2P0t6FpTtLDB6OQYNI9IupTnKc1IbGVMwUqm6MQVw 418A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:content-language :in-reply-to:mime-version:user-agent:date:message-id:from:references :cc:to:subject; bh=4XmJ1jC9DPXCMuf8a+fhehsw5ASjCFlKX2CL8Hazd58=; b=EBJqGDcX+t3AdbFyKpBuOvTc+CADHerhCO5jsbwcamsATevn5veoUYIfxdhXBGda/d mIcD81kJpMFVmS7p1rVCHC/tu6Zo8QTeDV8GyorJkhPTRouL4ZeB9+nmEAmeid0DRUGg LwltEP8Vco/dNTpSa6dg6JZCJGSGms1yXZSJI7jSh53pQCe8rYmg48XXejP0xXZxNg+o k55FAYVDNOMvgdnQf6L2S7dc9DolaQPbStrIti9gBhhUNzpNljS88vRYV/UMejOQJ+Jn tLyNuLqu7Igc10SKa7U1BslwKJSx0C7+odGhw5SCjU1V+V19Kfa2DvL5xCvA2OzPrZA3 jTBA== ARC-Authentication-Results: i=1; mx.google.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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id hs16si646254ejc.107.2021.10.13.11.36.40; Wed, 13 Oct 2021 11:37:14 -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; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S236782AbhJMSft (ORCPT + 99 others); Wed, 13 Oct 2021 14:35:49 -0400 Received: from mail-pj1-f45.google.com ([209.85.216.45]:56210 "EHLO mail-pj1-f45.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231234AbhJMSfn (ORCPT ); Wed, 13 Oct 2021 14:35:43 -0400 Received: by mail-pj1-f45.google.com with SMTP id om14so2894555pjb.5; Wed, 13 Oct 2021 11:33:40 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:subject:to:cc:references:from:message-id:date :user-agent:mime-version:in-reply-to:content-language :content-transfer-encoding; bh=4XmJ1jC9DPXCMuf8a+fhehsw5ASjCFlKX2CL8Hazd58=; b=lSvBR0WCHxZ+4vaWxQSwOO+ehKuzawMWIXlhqMi5SDp095XMPLQvxWBdd4DbxwXsqX U1qkP0zu/floAT8r8ErVB1BV0Z2pvAWv1FDjgKCKrvaTYMdCEdpKPuecv+hHOOJIlPpZ hw9Ri0nzUlkZpPCojvxgOsVAgS9F7Y0Bry864l1EF40Eo3AwU9/LDWK6SuZJu1uEgg6+ TSCuIhnzrhu7wUEndineBcyTytajVrp0w1OxB+dTJaaLfyQqkD4kCkSTAkyWLzfzvIVC +pMVtr9X385pLdRJD0X8N/4DuwsHLQBsaW6Cg2UBaCHk39vUvAHmux9C/kKWuVN2fAu4 zPDg== X-Gm-Message-State: AOAM533HYabEDZ05EOsyQYftRvIfBGFHJUzAadsZ2VJrYQfja8+oSuVH if7ymVZm/tZTD0vDJRlspYM= X-Received: by 2002:a17:90b:1c82:: with SMTP id oo2mr1003840pjb.53.1634150018223; Wed, 13 Oct 2021 11:33:38 -0700 (PDT) Received: from bvanassche-linux.mtv.corp.google.com ([2620:15c:211:201:ae3:1dc1:f2a3:9c06]) by smtp.gmail.com with ESMTPSA id u24sm223779pfm.27.2021.10.13.11.33.37 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Wed, 13 Oct 2021 11:33:37 -0700 (PDT) Subject: Re: [PATCH] RDMA/core: Set sgtable nents when using ib_dma_virt_map_sg() To: Logan Gunthorpe , linux-rdma@vger.kernel.org, Jason Gunthorpe Cc: linux-kernel@vger.kernel.org, Doug Ledford References: <20211013165942.89806-1-logang@deltatee.com> From: Bart Van Assche Message-ID: <5eec6b1b-726e-b26d-bd82-f03fd5462b8f@acm.org> Date: Wed, 13 Oct 2021 11:33:36 -0700 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.14.0 MIME-Version: 1.0 In-Reply-To: <20211013165942.89806-1-logang@deltatee.com> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 10/13/21 9:59 AM, 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 Does this patch need a "Fixes:" tag? Thanks, Bart.