Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp2974733imu; Mon, 17 Dec 2018 10:55:50 -0800 (PST) X-Google-Smtp-Source: AFSGD/VQfnAelM07KW769qu03Go6Ch3AEZ6pxY64ywlnqE1WpIKMYFqzdHDd6u3+qKujg0ej4y+b X-Received: by 2002:a17:902:227:: with SMTP id 36mr13804101plc.140.1545072950115; Mon, 17 Dec 2018 10:55:50 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1545072950; cv=none; d=google.com; s=arc-20160816; b=XwdaJGBvKpDaoMsG2uoLxVP/D4FPN/9HsL6tDZ5ydqdAvzZtre/X+oLFfVYI9RzLwW UdGEhayc/wjahmTMzC+lZQfUeHVYHbNdbHVlQ6mAm2J8Oxu2enfd8J6AWbiSbL8WwNuE Hs+PW/na8OBmMhiA6BpwugXEORnCHunEaa8LIeGDXrMhGvJvu2uHAYGXEo9NRV/gb7kZ WMFE5uvnQhUp3dbR25ZxXhEoi+R1K5bwqOM9LWzvU4XTpEJShQ/mSebCqjjGV/pf0vUy dJyi5lX/EMFkezWkukNXBPudXaVMsMDGnp9W6JCnI3P0U9neqzNuaUQvU7H80wu9CkE1 yvjg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:in-reply-to :mime-version:user-agent:date:message-id:from:cc:references:to :subject; bh=GBbkoIZHBAZTh/2J/RToczoLW5/e+EFuE5YuUGsBbbQ=; b=WT9J1O2lW6hbOEtRW8YQbRmloLhdH29/ftH4VDOaA3DXP0ePgnXGHQId3RYDDlK1r4 maZ38AWtwMUEEqLBI22AlK1oe5tmeBgRgTh9AGu9FUK4RyhdLk64DFB8DR5C8qIsvYfK T7TI7fAnTX0wpd+hFYIOAJrNSOaKZ2BqFlhUplWcfbsgej61BHJ7o8sWofep+uNUooUi GvCb+XaZrepDhRqJGumyEIDjnnl2ZOorRwYV/jGDBufXRH8fbKTakZVLRFERUu6YWGD7 e0zuW7QDuxNQh+xr8JKwO9VljB2PJyDbF7+UxWEpF4iLmg8DStnNCngu59kTaX1PLGtR VlcA== ARC-Authentication-Results: i=1; mx.google.com; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id h188si12094779pfg.44.2018.12.17.10.55.33; Mon, 17 Dec 2018 10:55:50 -0800 (PST) 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; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1733231AbeLQOv4 (ORCPT + 99 others); Mon, 17 Dec 2018 09:51:56 -0500 Received: from szxga07-in.huawei.com ([45.249.212.35]:50784 "EHLO huawei.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1727643AbeLQOvy (ORCPT ); Mon, 17 Dec 2018 09:51:54 -0500 Received: from DGGEMS410-HUB.china.huawei.com (unknown [172.30.72.59]) by Forcepoint Email with ESMTP id 8DFE9C530F0C8; Mon, 17 Dec 2018 22:51:49 +0800 (CST) Received: from [127.0.0.1] (10.202.226.41) by DGGEMS410-HUB.china.huawei.com (10.3.19.210) with Microsoft SMTP Server id 14.3.408.0; Mon, 17 Dec 2018 22:51:40 +0800 Subject: Re: [PATCH v4 4/5] scsi: hisi_sas: Add support for DIF feature for v3 hw To: "Martin K. Petersen" References: <1544103284-100497-1-git-send-email-john.garry@huawei.com> <1544103284-100497-5-git-send-email-john.garry@huawei.com> <4752be71-f39c-ac55-0e51-36c146108a38@huawei.com> CC: , , , , Xiang Chen From: John Garry Message-ID: Date: Mon, 17 Dec 2018 14:51:36 +0000 User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:45.0) Gecko/20100101 Thunderbird/45.3.0 MIME-Version: 1.0 In-Reply-To: <4752be71-f39c-ac55-0e51-36c146108a38@huawei.com> Content-Type: text/plain; charset="windows-1252"; format=flowed Content-Transfer-Encoding: 7bit X-Originating-IP: [10.202.226.41] X-CFilter-Loop: Reflected Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 13/12/2018 13:35, John Garry wrote: > >> >> to set your controller flags. >> >> + if (prot_op == SCSI_PROT_WRITE_INSERT) { >> + unsigned int interval = scsi_prot_interval(scsi_cmnd); >> + unsigned int ilog2_interval = ilog2(interval); >> + >> + len = (task->total_xfer_len >> ilog2_interval) * 8; >> >> scsi_transfer_length(struct scsi_cmnd *scmd) > > ok Hi Martin, We have an issue with using scsi_transfer_length(). As I understand, for our controller we need to set the host structure data transfer size to the size of data to write to the disk for WRITE type command, and at size of info received to host memory for READ type command. As such, for READ STRIP, we only want the SCSI buf len, and not the scsi buf len and PI (this is what scsi_transfer_length() provides). Thanks, John