From patchwork Tue Sep 6 21:25:41 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Long Li X-Patchwork-Id: 9317881 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 35093607D3 for ; Tue, 6 Sep 2016 19:37:40 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 1106C28D58 for ; Tue, 6 Sep 2016 19:37:40 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 05EA228E98; Tue, 6 Sep 2016 19:37:40 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.9 required=2.0 tests=BAYES_00,RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id A943228D58 for ; Tue, 6 Sep 2016 19:37:39 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1756365AbcIFThC (ORCPT ); Tue, 6 Sep 2016 15:37:02 -0400 Received: from p3plsmtps2ded03.prod.phx3.secureserver.net ([208.109.80.60]:39118 "EHLO p3plsmtps2ded03.prod.phx3.secureserver.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755902AbcIFThB (ORCPT ); Tue, 6 Sep 2016 15:37:01 -0400 Received: from linuxonhyperv.com ([72.167.245.219]) by : HOSTING RELAY : with SMTP id hMA3bYjxYmuNMhMA4bfacW; Tue, 06 Sep 2016 12:36:00 -0700 x-originating-ip: 72.167.245.219 Received: by linuxonhyperv.com (Postfix, from userid 511) id C772419028A; Tue, 6 Sep 2016 14:26:29 -0700 (PDT) From: Long Li To: "K. Y. Srinivasan" , Haiyang Zhang , "James E.J. Bottomley" , "Martin K. Petersen" Cc: devel@linuxdriverproject.org, linux-scsi@vger.kernel.org, linux-kernel@vger.kernel.org, Long Li Subject: [PATCH 1/3] storvsc: use tagged SRB requests if supported by the device Date: Tue, 6 Sep 2016 14:25:41 -0700 Message-Id: <1473197143-16760-2-git-send-email-longli@exchange.microsoft.com> X-Mailer: git-send-email 1.7.4.1 In-Reply-To: <1473197143-16760-1-git-send-email-longli@exchange.microsoft.com> References: <1473197143-16760-1-git-send-email-longli@exchange.microsoft.com> X-CMAE-Envelope: MS4wfLgehNTugP/7k6rwyfvOuqtf4p22Kq2h70SKe5aTjgFmfsOvxSz8Pysezh3dNYPiQPPGz5ZJInztsqLerqpm2FYvwrxdDPkaTf9jIL56NSthPfDc4OJt nXVUXE8/QWPbb9PG6x7sWK/5e2bqr1ZjTV85D5Seomq6ZIO0FJdmmr3N/xUFRK3Lq0a/Ug/tSsfuSFzf+Iuq1TfbpZeRUcuuMG5jZDS0M/sYwsfDI3zghTza TykbLJn60d6pmEfAoD5yDH5CUzZsZ/Uet6M3qIkOsjDDYrO3GffLFSkJYPwSRdt+vf40A8V6HJNKLfdS7evlbXS/49Br2ay1vEQlG6riE74KIhVv6EMvqq+Z eFwqBnMFMyTMGYN/h1tyYdrEp69YZj2q8D6/zKaUtiGxmUzbDKReFYwKMvLQExg7iGeFIr1yUE/7IYLvJa9P0i/vRvshPw== Sender: linux-scsi-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-scsi@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP From: Long Li Properly set SRB flags when hosting device supports tagged queuing. This patch improves the performance on Fiber Channel disks. --- drivers/scsi/storvsc_drv.c | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/drivers/scsi/storvsc_drv.c b/drivers/scsi/storvsc_drv.c index 8ccfc9e..a8f3e4c 100644 --- a/drivers/scsi/storvsc_drv.c +++ b/drivers/scsi/storvsc_drv.c @@ -136,6 +136,8 @@ struct hv_fc_wwn_packet { #define SRB_FLAGS_PORT_DRIVER_RESERVED 0x0F000000 #define SRB_FLAGS_CLASS_DRIVER_RESERVED 0xF0000000 +#define SP_UNTAGGED ((unsigned char) ~0) +#define SRB_SIMPLE_TAG_REQUEST 0x20 /* * Platform neutral description of a scsi request - @@ -1451,6 +1453,12 @@ static int storvsc_queuecommand(struct Scsi_Host *host, struct scsi_cmnd *scmnd) vm_srb->win8_extension.srb_flags |= SRB_FLAGS_DISABLE_SYNCH_TRANSFER; + if(scmnd->device->tagged_supported) { + vm_srb->win8_extension.srb_flags |= (SRB_FLAGS_QUEUE_ACTION_ENABLE | SRB_FLAGS_NO_QUEUE_FREEZE); + vm_srb->win8_extension.queue_tag = SP_UNTAGGED; + vm_srb->win8_extension.queue_action = SRB_SIMPLE_TAG_REQUEST; + } + /* Build the SRB */ switch (scmnd->sc_data_direction) { case DMA_TO_DEVICE: