From patchwork Thu Aug 22 20:42:23 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Long Li X-Patchwork-Id: 11110115 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 D082F13B1 for ; Thu, 22 Aug 2019 20:42:39 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id AF0E0233FD for ; Thu, 22 Aug 2019 20:42:39 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=linuxonhyperv.com header.i=@linuxonhyperv.com header.b="CaRboXzk" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2389641AbfHVUmg (ORCPT ); Thu, 22 Aug 2019 16:42:36 -0400 Received: from linux.microsoft.com ([13.77.154.182]:44482 "EHLO linux.microsoft.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1731775AbfHVUmg (ORCPT ); Thu, 22 Aug 2019 16:42:36 -0400 Received: by linux.microsoft.com (Postfix, from userid 1004) id B00E720B7194; Thu, 22 Aug 2019 13:42:35 -0700 (PDT) DKIM-Filter: OpenDKIM Filter v2.11.0 linux.microsoft.com B00E720B7194 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linuxonhyperv.com; s=default; t=1566506555; bh=0Zboz7IezsskwftKIu5U3pBOOrQwc0AXxjzrYrjilVw=; h=From:To:Cc:Subject:Date:From; b=CaRboXzkQUnc0uEk0D4BLXLUmGsWmayC6RViDCgUnMW106Sz/jqKHuHNTEPjkLO5d DbCUw6WTc/WybBzmteq1AO5BbiA3oOhNRTVy/HqFEsrdZB4iIWrU9gx3eEu8nkpAiv yZy3KdP1yrGq3kWqBRl+bk1XA3dJJ+ZRbsUeOoLw= 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 v2] storvsc: setup 1:1 mapping between hardware queue and CPU queue Date: Thu, 22 Aug 2019 13:42:23 -0700 Message-Id: <1566506543-1090-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 storvsc doesn't use a dedicated hardware queue for a given CPU queue. When issuing I/O, it selects returning CPU (hardware queue) dynamically based on vmbus channel usage across all channels. This patch advertises num_possible_cpus() as number of hardware queues. This will have upper layer setup 1:1 mapping between hardware queue and CPU queue and avoid unnecessary locking when issuing I/O. Changes: v2: rely on default upper layer function to map queues. (suggested by Ming Lei ) Signed-off-by: Long Li --- drivers/scsi/storvsc_drv.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/drivers/scsi/storvsc_drv.c b/drivers/scsi/storvsc_drv.c index b89269120a2d..dfd3b76a4f89 100644 --- a/drivers/scsi/storvsc_drv.c +++ b/drivers/scsi/storvsc_drv.c @@ -1836,8 +1836,7 @@ static int storvsc_probe(struct hv_device *device, /* * Set the number of HW queues we are supporting. */ - if (stor_device->num_sc != 0) - host->nr_hw_queues = stor_device->num_sc + 1; + host->nr_hw_queues = num_possible_cpus(); /* * Set the error handler work queue.