From patchwork Thu Nov 14 23:01:26 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Long Li X-Patchwork-Id: 11244567 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 714F317E6 for ; Thu, 14 Nov 2019 23:01:38 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 524B220706 for ; Thu, 14 Nov 2019 23:01:38 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=linuxonhyperv.com header.i=@linuxonhyperv.com header.b="gvWYGLht" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727192AbfKNXBe (ORCPT ); Thu, 14 Nov 2019 18:01:34 -0500 Received: from linux.microsoft.com ([13.77.154.182]:33242 "EHLO linux.microsoft.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726319AbfKNXBd (ORCPT ); Thu, 14 Nov 2019 18:01:33 -0500 Received: by linux.microsoft.com (Postfix, from userid 1004) id 6CA9120110BD; Thu, 14 Nov 2019 15:01:32 -0800 (PST) DKIM-Filter: OpenDKIM Filter v2.11.0 linux.microsoft.com 6CA9120110BD DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linuxonhyperv.com; s=default; t=1573772492; bh=Ckk87F5MC07qtgzW/3HfYOthBvz6QWmpl5e5thFSOf8=; h=From:To:Cc:Subject:Date:From; b=gvWYGLhtDUn3goNXxVYHrRg6RqeoknZZwUWDSqtNOAi8FQsp4UTKYSLg5E2Gt+cDj BbQsZf/bWA2znltYAEoUbUPpUJPnDMK53Pr2W+iBz0Kt7lSnpwdhvgCFpmrXOnqJYi DVustrb2a3jo8O+KNwoJMHZumxPbjv94qlPODxfI= From: longli@linuxonhyperv.com To: "K. Y. Srinivasan" , Haiyang Zhang , Stephen Hemminger , Sasha Levin , "James E.J. Bottomley" , "Martin K. Petersen" , linux-hyperv@vger.kernel.org, linux-scsi@vger.kernel.org, linux-kernel@vger.kernel.org Cc: Long Li Subject: [PATCH] storvsc: Properly set queue depth for scsi disk Date: Thu, 14 Nov 2019 15:01:26 -0800 Message-Id: <1573772486-40662-1-git-send-email-longli@linuxonhyperv.com> X-Mailer: git-send-email 1.8.3.1 Sender: linux-scsi-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-scsi@vger.kernel.org From: Long Li The disk queue depth should be set based on host queue depth. While it's possible that we may have multiple disks on the host, the combined queue depths from those disks may exceed host queue depth. It's still better than hard-coding them. Signed-off-by: Long Li --- drivers/scsi/storvsc_drv.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/drivers/scsi/storvsc_drv.c b/drivers/scsi/storvsc_drv.c index 542d2bac2922..12c499f5da44 100644 --- a/drivers/scsi/storvsc_drv.c +++ b/drivers/scsi/storvsc_drv.c @@ -1442,6 +1442,8 @@ static int storvsc_device_configure(struct scsi_device *sdevice) sdevice->no_write_same = 0; } + scsi_change_queue_depth(sdevice, sdevice->host->can_queue); + return 0; } @@ -1691,7 +1693,6 @@ static struct scsi_host_template scsi_driver = { .eh_timed_out = storvsc_eh_timed_out, .slave_alloc = storvsc_device_alloc, .slave_configure = storvsc_device_configure, - .cmd_per_lun = 2048, .this_id = -1, /* Make sure we dont get a sg segment crosses a page boundary */ .dma_boundary = PAGE_SIZE-1,