From patchwork Tue Apr 14 23:52:17 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Akinobu Mita X-Patchwork-Id: 6218511 Return-Path: X-Original-To: patchwork-linux-scsi@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork2.web.kernel.org (Postfix) with ESMTP id 82AF5BF4A6 for ; Tue, 14 Apr 2015 23:52:52 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id A933C20304 for ; Tue, 14 Apr 2015 23:52:51 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id CA86620328 for ; Tue, 14 Apr 2015 23:52:50 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932164AbbDNXwg (ORCPT ); Tue, 14 Apr 2015 19:52:36 -0400 Received: from mail-lb0-f172.google.com ([209.85.217.172]:35603 "EHLO mail-lb0-f172.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755425AbbDNXwU (ORCPT ); Tue, 14 Apr 2015 19:52:20 -0400 Received: by lbbuc2 with SMTP id uc2so21359724lbb.2; Tue, 14 Apr 2015 16:52:18 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type; bh=3sPQaEBoBnZkFnYdnNYcls45kOh6b+Qzkvz+zYMuaiI=; b=C+eXG156kMVMbDYqOW0WhM24J4CUzQHkuXuPTBpjdMdJeACSZ8p/OdcdZV2odcNdT/ gea8EiS5gGbKzZvDoD8OY3KyT7Y6KweygQT/OcBu1bFgWwZr8oCTd33u1z236R4aZI9o asWnkByO8qNPV557vO/KpwdfdE9JT5OJw5D0OORZA5/BdKxCMSVx2IC6/RwFSCu2yd0L t9Xo2UcZaZ1LkObSUdGOXYoXFey2TI1tKYyyLvqFeJftyuZj6+MNeeGAGRI6zOIVT0l9 rSNkO7dYgjkj93JAIVbeyYVMexL+403qLU289MpiUZJpo604mt5MSmAil4gsDuqsZGBY vRwg== MIME-Version: 1.0 X-Received: by 10.112.126.162 with SMTP id mz2mr7803882lbb.97.1429055538086; Tue, 14 Apr 2015 16:52:18 -0700 (PDT) Received: by 10.152.106.3 with HTTP; Tue, 14 Apr 2015 16:52:17 -0700 (PDT) In-Reply-To: <552D4C7B.9000402@dev.mellanox.co.il> References: <1428945575-30839-1-git-send-email-sagig@mellanox.com> <552D4C7B.9000402@dev.mellanox.co.il> Date: Wed, 15 Apr 2015 08:52:17 +0900 Message-ID: Subject: Re: [RFC] Simlify dif_verify routines and fixup fileio protection information code. From: Akinobu Mita To: Sagi Grimberg Cc: Sagi Grimberg , "Nicholas A. Bellinger" , target-devel@vger.kernel.org, "linux-scsi@vger.kernel.org" , "Martin K. Petersen" , Christoph Hellwig Sender: linux-scsi-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-scsi@vger.kernel.org X-Spam-Status: No, score=-6.8 required=5.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED, FREEMAIL_FROM, RCVD_IN_DNSWL_HI, T_DKIM_INVALID, T_RP_MATCHES_RCVD, T_TVD_MIME_EPI,UNPARSEABLE_RELAY autolearn=ham version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP 2015-04-15 2:20 GMT+09:00 Sagi Grimberg : > On 4/14/2015 3:17 PM, Akinobu Mita wrote: >> >> 2015-04-14 2:19 GMT+09:00 Sagi Grimberg : >>> >>> Hey All, >>> >>> This set follows the patchset from Akinobu Mita that addresses >>> DIF bounce buffer sgl construction. Instead of trying to fix these >>> bugs, this removes it altogether and work with cmd->t_prot_sg >>> directly. >>> >>> The first patch is a simplification of the DIF verify varius >>> routines leaving a single generic sbc_dif_verify that handles >>> the protection information sgl we are working on. >>> >>> The second patch uses this simplification to remove the local >>> prot_fd bounce buffer altogether. >>> >>> This passed minimal IO testing. >> >> >> Looks good... >> >> I'll test with these patches and check if the problems I met >> disappear. > > > Thanks Akinobu, > > Waiting to hear your verdict before sending a formal patchset. I hit a original bug in sbc_dif_verify() which is not introduced by your patch set, though. Please consider to include attached patch. I'm still seeing another problem and trying to find out a root cause, but it seems like it's caused by other change in -next. diff --git a/drivers/target/target_core_sbc.c b/drivers/target/target_core_sbc.c index 3d88c00..65a0b5f 100644 --- a/drivers/target/target_core_sbc.c +++ b/drivers/target/target_core_sbc.c @@ -1311,7 +1311,7 @@ sbc_dif_verify(struct se_cmd *cmd, sector_t start, unsigned int sectors, for_each_sg(cmd->t_data_sg, dsg, cmd->t_data_nents, i) { daddr = kmap_atomic(sg_page(dsg)) + dsg->offset; - paddr = kmap_atomic(sg_page(psg)) + sg->offset; + paddr = kmap_atomic(sg_page(psg)) + psg->offset; for (j = 0; j < dsg->length; j += dev->dev_attrib.block_size) {