From patchwork Thu Aug 20 23:17:13 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Nicholas A. Bellinger" X-Patchwork-Id: 7047311 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 C3EF9C05AC for ; Thu, 20 Aug 2015 23:17:20 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id E697A20585 for ; Thu, 20 Aug 2015 23:17:19 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 8EFAF20504 for ; Thu, 20 Aug 2015 23:17:18 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752909AbbHTXRR (ORCPT ); Thu, 20 Aug 2015 19:17:17 -0400 Received: from mail.linux-iscsi.org ([67.23.28.174]:34842 "EHLO linux-iscsi.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752756AbbHTXRQ (ORCPT ); Thu, 20 Aug 2015 19:17:16 -0400 Received: from [172.18.3.65] (unknown [157.22.22.146]) (using SSLv3 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) (Authenticated sender: nab) by linux-iscsi.org (Postfix) with ESMTPSA id 03A3522DA27; Thu, 20 Aug 2015 23:11:48 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=linux-iscsi.org; s=default.private; t=1440112309; bh=hdglx9QXdxS5UO9d5bSELZ4QNhRGaAj s7HgamogfddM=; h=Message-ID:Subject:From:To:Cc:Date:In-Reply-To: References:Content-Type:Mime-Version:Content-Transfer-Encoding; b=P0Zy8u3XaqTg+oIz5MiNr2t+wXwAqvLguZQkkNyYQTGFG2YI9ScxGI9yHI+t/XgFx v44W3KW/hV2Z8RB7Fshd5qX7C8CwwyMMngpcnDgx1gVD3VsukMM9Lcu9rZcdVKyKxNk 5AhMvey3j+SOI2jldkYH6dxjc9Nw3aBH0Uf/P44= Message-ID: <1440112633.14304.23.camel@haakon3.risingtidesystems.com> Subject: Re: [PATCH] target/qla2xxx: Honor max_data_sg_nents I/O transfer limit From: "Nicholas A. Bellinger" To: Arun Easi Cc: "Nicholas A. Bellinger" , target-devel , linux-scsi , Craig Watson , Roland Dreier , Giridhar Malavali , Andrew Vasquez , Christoph Hellwig , Himanshu Madhani , Hannes Reinecke , "Martin K. Petersen" Date: Thu, 20 Aug 2015 16:17:13 -0700 In-Reply-To: References: <1439455550-2626-1-git-send-email-nab@daterainc.com> X-Mailer: Evolution 3.4.4-1 Mime-Version: 1.0 Sender: linux-scsi-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-scsi@vger.kernel.org X-Spam-Status: No, score=-7.4 required=5.0 tests=BAYES_00,DKIM_SIGNED, RCVD_IN_DNSWL_HI,RP_MATCHES_RCVD,T_DKIM_INVALID,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 On Wed, 2015-08-19 at 17:48 -0700, Arun Easi wrote: > Hi nab, > > On Thu, 13 Aug 2015, 1:45am -0700, Nicholas A. Bellinger wrote: > > > From: Nicholas Bellinger > > > > Hi Arun, Roland & Co, > > > > Based upon the feedback from last week, here is a proper > > patch for target-core to honor a fabric provided SGL limit > > using residual count plus underflow response bit. > > > > Everything appears to be working as expected with tcm-loop > > LUNs with basic I/O and sg_raw to test CDB underflow, but > > still needs to be verified on real qla2xxx hardware over > > the next days for v4.2.0 code. > > > > Please review + test. > > Changes look good. I could not test the changes, though. I have requested > internally to test this patch. Himanshu (copied) will get back with the > test results (Thanks Himanshu). > Thanks for the update. Btw, this patch has been pushed to refs/heads/queue, atop the other recent v4.2-rc fixes here: https://git.kernel.org/cgit/linux/kernel/git/nab/target-pending.git/commit/?h=queue Just an FYI for Himanshu, for testing against Linux hosts that do honor EVPD block-limits, you'll want to include the following small hack to report a larger block-limits value so the new residual handling can actually get invoked. Also for testing, I'd recommend lowering tcm_qla2xxx's max_data_sg_nents to something arbitrarily small to exercise the new code. Craig, have you had a chance to test the new logic on your setup with hosts that don't honor EVPD block-limits..? --nab --- To unsubscribe from this list: send the line "unsubscribe linux-scsi" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html diff --git a/drivers/target/target_core_spc.c b/drivers/target/target_core_spc.c index 01421e9..f02767b 100644 --- a/drivers/target/target_core_spc.c +++ b/drivers/target/target_core_spc.c @@ -523,6 +523,7 @@ spc_emulate_evpd_b0(struct se_cmd *cmd, unsigned char *buf) if (cmd->se_tfo->max_data_sg_nents) { mtl = (cmd->se_tfo->max_data_sg_nents * PAGE_SIZE) / dev->dev_attrib.block_size; + mtl *= 2; } put_unaligned_be32(min_not_zero(mtl, dev->dev_attrib.hw_max_sectors), &buf[8]);