From patchwork Tue Oct 29 19:12:01 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Marcelo Henrique Cerri X-Patchwork-Id: 1186250 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=none (no SPF record) smtp.mailfrom=lists.ubuntu.com (client-ip=91.189.94.19; helo=huckleberry.canonical.com; envelope-from=kernel-team-bounces@lists.ubuntu.com; receiver=) Authentication-Results: ozlabs.org; dmarc=fail (p=none dis=none) header.from=canonical.com Received: from huckleberry.canonical.com (huckleberry.canonical.com [91.189.94.19]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 472h6W1WJkz9sPh; Wed, 30 Oct 2019 06:12:19 +1100 (AEDT) Received: from localhost ([127.0.0.1] helo=huckleberry.canonical.com) by huckleberry.canonical.com with esmtp (Exim 4.86_2) (envelope-from ) id 1iPWub-0004C8-Fl; Tue, 29 Oct 2019 19:12:13 +0000 Received: from youngberry.canonical.com ([91.189.89.112]) by huckleberry.canonical.com with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.86_2) (envelope-from ) id 1iPWua-0004Bw-GA for kernel-team@lists.ubuntu.com; Tue, 29 Oct 2019 19:12:12 +0000 Received: from mail-qt1-f199.google.com ([209.85.160.199]) by youngberry.canonical.com with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.86_2) (envelope-from ) id 1iPWua-0003xA-8W for kernel-team@lists.ubuntu.com; Tue, 29 Oct 2019 19:12:12 +0000 Received: by mail-qt1-f199.google.com with SMTP id k53so15470301qtk.0 for ; Tue, 29 Oct 2019 12:12:12 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=xolskb79dm4Xy4kBw+BfJlBb2gYb72gtamJ0SxI4Z8U=; b=COupSJ4Ot2ubLd+N+v01qP0H1LygWTDf38kULyvzi0t8/jGQo2le6dQ7gB3cMxFftr QUoouPKT3bSE86a9D56UIzx+KULEkyTiPpNi8xsFZEqtnrKoZnEt+YNzExJ4N/ZIOhll H6Zh8DQJzr9cr2Pze2LnJn2IFlzSqhllvE9Ry+ymbSTmlWypvowCF6DOo+53GpRAX0Wx XMhbRHK+uouXmEpylU5hWDvL3hACgHKXU5NA5cf0Wx1JtXVlQFg1EBl3YFqdK9mDXBk3 dRc7Nfv3+iYmlR0EKRx5EkGh7ZMnirEN+x7650MEZB8wV1oiiuxMbKyyeYG6uHmh19Ej wUgQ== X-Gm-Message-State: APjAAAWtcN9TFAt21p0rIq8u9bPKqCF1JA8KtNmnRKn34t4ARza21GgB 9L4QQq8uzYE0KqNmfcjK33q6wNFrViKCgtMJKrRxFjeBXBajobWSntl3Qm63+H7MyGwFDxC78cE PgCqp/mh9ZWPYesWjMIatokGLxEeedRF+yZ/GFkBs X-Received: by 2002:ac8:7188:: with SMTP id w8mr638382qto.211.1572376330708; Tue, 29 Oct 2019 12:12:10 -0700 (PDT) X-Google-Smtp-Source: APXvYqxamq9C/KFqvX3jTJUnrkuifg9SnWcf+77j31ZfmkaIM7YeKjdbX8dFNWDK1hwCKVERYgKOjQ== X-Received: by 2002:ac8:7188:: with SMTP id w8mr638337qto.211.1572376330367; Tue, 29 Oct 2019 12:12:10 -0700 (PDT) Received: from gallifrey.lan ([2804:14c:4e6:443:7972:30a2:2d6c:a505]) by smtp.gmail.com with ESMTPSA id h44sm9388504qtc.1.2019.10.29.12.12.08 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 29 Oct 2019 12:12:09 -0700 (PDT) From: Marcelo Henrique Cerri To: kernel-team@lists.ubuntu.com Subject: [xenial:linux-azure][PATCH 1/1] scsi: storvsc: Add ability to change scsi queue depth Date: Tue, 29 Oct 2019 16:12:01 -0300 Message-Id: <20191029191202.18925-2-marcelo.cerri@canonical.com> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20191029191202.18925-1-marcelo.cerri@canonical.com> References: <20191029191202.18925-1-marcelo.cerri@canonical.com> MIME-Version: 1.0 X-BeenThere: kernel-team@lists.ubuntu.com X-Mailman-Version: 2.1.20 Precedence: list List-Id: Kernel team discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: kernel-team-bounces@lists.ubuntu.com Sender: "kernel-team" From: Branden Bonaby BugLink: https://bugs.launchpad.net/bugs/1849495 Adding functionality to allow the SCSI queue depth to be changed by utilizing the "scsi_change_queue_depth" function. [mkp: checkpatch] Signed-off-by: Branden Bonaby Reviewed-by: Michael Kelley Reviewed-by: K. Y. Srinivasan Signed-off-by: Martin K. Petersen (cherry picked from commit adfbd028e155fca3bbe33d458f2f27cb657e5792) Signed-off-by: Marcelo Henrique Cerri Acked-by: Colin Ian King --- drivers/scsi/storvsc_drv.c | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/drivers/scsi/storvsc_drv.c b/drivers/scsi/storvsc_drv.c index b9eabd098419..697cc209aedf 100644 --- a/drivers/scsi/storvsc_drv.c +++ b/drivers/scsi/storvsc_drv.c @@ -387,6 +387,7 @@ enum storvsc_request_type { static int storvsc_ringbuffer_size = (256 * PAGE_SIZE); static u32 max_outstanding_req_per_channel; +static int storvsc_change_queue_depth(struct scsi_device *sdev, int queue_depth); static int storvsc_vcpus_per_sub_channel = 4; @@ -1674,6 +1675,7 @@ static struct scsi_host_template scsi_driver = { .dma_boundary = PAGE_SIZE-1, .no_write_same = 1, .track_queue_depth = 1, + .change_queue_depth = storvsc_change_queue_depth, }; enum { @@ -1885,6 +1887,15 @@ static int storvsc_probe(struct hv_device *device, return ret; } +/* Change a scsi target's queue depth */ +static int storvsc_change_queue_depth(struct scsi_device *sdev, int queue_depth) +{ + if (queue_depth > scsi_driver.can_queue) + queue_depth = scsi_driver.can_queue; + + return scsi_change_queue_depth(sdev, queue_depth); +} + static int storvsc_remove(struct hv_device *dev) { struct storvsc_device *stor_device = hv_get_drvdata(dev);