Received: by 10.213.65.68 with SMTP id h4csp1770708imn; Thu, 29 Mar 2018 10:41:12 -0700 (PDT) X-Google-Smtp-Source: AIpwx49+XqDH4h39msp7OxKyaFvfzGDUYGbVT8HqXMFXfEJOREsFfwjrgj54PNd/5A6yEljrXOPs X-Received: by 10.99.127.82 with SMTP id p18mr6147501pgn.188.1522345272062; Thu, 29 Mar 2018 10:41:12 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1522345272; cv=none; d=google.com; s=arc-20160816; b=SyoOjwXLJWFN/GmCiqngvxwqmsu0RuBTIqXr/iffOXqTUJKNibsML6ic+fOAvRrpO2 u+u2x0tyuRgIId3Mk7vor0Uy9Hz8WER7h0gjTOZa418Wg474lyulUhItZwOir/s5Lejr pek2Uvx2yxGace2f7eWoGCLMNN75+wXQArLYM8ZcoKJUE8dQl5OHY9JB7eyht2GKV0Yu f1/Q8FQ8CdPcaXrVJUwPNrz60ZOJOPAOiJsmwreah21g8CG7UYTeeme+Bp2AOekyXTt4 p1nKgIZ1mpL1a3BU63Cb7djwLdM89+4N3b4LPJ+eKdvcgkn3ininidmn8/06XAMtM36D 6dJQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-language :content-transfer-encoding:in-reply-to:mime-version:user-agent:date :message-id:from:references:cc:to:subject:dkim-signature :arc-authentication-results; bh=HgXNkvpMmUSwDXu5wUnWs6BwjGuAmdJpeFDLt9bGT6U=; b=ONLgZJj1AwEBqvPL1FG62YL4Tw+V32nndDF4q/A1L2C7FlN0PiFYpEW6fNdTGubygB a+QOzfpGR1NAvQ9mPERTE5wcHYSkSidKLT0sWTYwXZPx7YOPWb29T233fddySrc/QX2Q 0lHRwzO2wMf6+3TZwd2/vLpePBdEZNHL8pPdv3v7g7KsQAxmG2+hWFDQW/1yaCn6aSqy zyeQ1wJb+iWfqX+sLjc7xDSAILk0aOiK6FZYnFIjIJikOKn7dbMY//i7kOxQMkjoy3Bo OzWr4loGe29KCTXJ4Lvg29IE4LiUB/0tmgtZZ/iCVW0YX8jjedzEMAKKUOX0iL7LFp2A AjKg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@broadcom.com header.s=google header.b=KVi/6oMg; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=broadcom.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id e133si4658225pfh.410.2018.03.29.10.40.58; Thu, 29 Mar 2018 10:41:12 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@broadcom.com header.s=google header.b=KVi/6oMg; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=broadcom.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751893AbeC2Rjx (ORCPT + 99 others); Thu, 29 Mar 2018 13:39:53 -0400 Received: from mail-qt0-f171.google.com ([209.85.216.171]:42356 "EHLO mail-qt0-f171.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751164AbeC2Rjw (ORCPT ); Thu, 29 Mar 2018 13:39:52 -0400 Received: by mail-qt0-f171.google.com with SMTP id j3so7036622qtn.9 for ; Thu, 29 Mar 2018 10:39:51 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=broadcom.com; s=google; h=subject:to:cc:references:from:message-id:date:user-agent :mime-version:in-reply-to:content-transfer-encoding:content-language; bh=HgXNkvpMmUSwDXu5wUnWs6BwjGuAmdJpeFDLt9bGT6U=; b=KVi/6oMgCeYWbQPdq6HtGG/WqM6bX5E6ev69/97VmqGeGqocTVZ81KUrCjmqVU/424 wORWK+XPG1D3/Kuisefoly6xQfdsGc5vuQlKW5LWdI22x+ojmKR7ZuCmw4CXELiPHRI/ nUop6CXQLifQYTBGS1ltOqAdRThWria7ZH+uA= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:to:cc:references:from:message-id:date :user-agent:mime-version:in-reply-to:content-transfer-encoding :content-language; bh=HgXNkvpMmUSwDXu5wUnWs6BwjGuAmdJpeFDLt9bGT6U=; b=DBMzwOEqJ3sYXX5JUXmZB0Rv9VF43HSQv9VbZQ6QAo5BUpKYNcxBacAQtez5TZgqxA P+LK+MnbtKSMDOhFmq6hSSq/CcEn9qe6ltp9oG1qx9c1M9uOuYSU3+p2OMCyAIF8I2jq WHxVvRcjyBuCT2S2JVMUz6y0I/DZna1k2+LCLSe7Y75kbAB2W3dIwSc49OqwTmyFGkKe 4EX506AVk8g3deKmrsa7djzeOMpuq6uuQrQHzZNLlGLoq05lBTpFIj/56rw9py5vYN7x uWUVJWXv9DvURUEjJtFEpu+iEZ+uf9VlYnVboYn5wqp/SsUy9yEo0284NHSTLD0yrU0z 8DHA== X-Gm-Message-State: ALQs6tD8uYDlYx2IX1RGVZJqeKC9UTXcGsvAAELM4zMXWxYZxH8uaOf8 HlLApI4yQsV/JiZeZ24cxGe8mQ== X-Received: by 10.200.53.164 with SMTP id k33mr12626491qtb.37.1522345191439; Thu, 29 Mar 2018 10:39:51 -0700 (PDT) Received: from [10.10.116.214] ([192.19.218.250]) by smtp.gmail.com with ESMTPSA id 1sm5165269qtr.85.2018.03.29.10.39.49 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 29 Mar 2018 10:39:50 -0700 (PDT) Subject: Re: [PATCH 4/4] nvmet-fc: Use new SGL alloc/free helper for requests To: Logan Gunthorpe , linux-kernel@vger.kernel.org, linux-nvme@lists.infradead.org Cc: Christoph Hellwig , Sagi Grimberg References: <20180329160721.4691-1-logang@deltatee.com> <20180329160721.4691-5-logang@deltatee.com> <15f4d135-7600-02b3-f50f-ed8deddd7b98@broadcom.com> From: James Smart Message-ID: Date: Thu, 29 Mar 2018 10:39:48 -0700 User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:52.0) Gecko/20100101 Thunderbird/52.6.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit Content-Language: en-US Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 3/29/2018 10:02 AM, Logan Gunthorpe wrote: > Per the bug in the previous patch, I don't think that was ever a valid > assumption. It doesn't have anything to do with the sgl_alloc change > either. The dma_map interface is allowed to merge SGLs and that's why it > can return fewer nents than it was passed. I'm not sure how many or > which DMA ops actually do this which is why it hasn't actually > manifested itself as a bug; but it is part of how the interface is > specified to work. Argh.. yep. I'll have to correct that assumption. The bug would have only shown up on i/o sizes beyond a particular length. > > I think we need to store the sg_map_cnt separately and use it instead of > the calculation based on the transfer length. But this is really a fix > that should be rolled in with the previous patch. If you can point me to > where this needs to change I can update my patch, or if you want to fix > it yourself go ahead. I'll fix it as it's part of the assumption fix. With the nulling/zeroing, I'm good with your patch. -- james.