Message ID | 20231027180302.418676-1-kartilak@cisco.com |
---|---|
Headers |
Return-Path: <linux-kernel-owner@vger.kernel.org> Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:d641:0:b0:403:3b70:6f57 with SMTP id cy1csp788447vqb; Fri, 27 Oct 2023 11:03:52 -0700 (PDT) X-Google-Smtp-Source: AGHT+IHk3uVbEUAhwLZyKH/MfiiRpsVq2ejAqPO1+eWGsX6dBWu6vr7Yz/tkG0We/d4yX8npyAcB X-Received: by 2002:a81:c806:0:b0:59b:14ca:4316 with SMTP id n6-20020a81c806000000b0059b14ca4316mr3303726ywi.43.1698429832050; Fri, 27 Oct 2023 11:03:52 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1698429832; cv=none; d=google.com; s=arc-20160816; b=CK7xjWrv6ZObIaEyz9USJogzBTHPIf8RPGUcLZXZae05PdQszWO+WUW3jljKEyeEgr mNz7HRnpNfMoR4eWmxxaUQq0YOvMwD977UeQLkJemGWcIbEOG0wjt9LiySH7zfqooM9x BVy3i9atT5SIcXGECd/eMMX4LCuZ3oH2rGUtsukBQSB79fVdI79FciRXrjIutMEyJTmn 52OkAN+cZXmPnfSSarZTDjgCC16YIKOAYi7B2N8br/z+DnEgQGeCO+66586LdPC0vqPg CxlJKKIO+k3hWtzKR/0/sFJDHxxIYdG8Fy24L7X0jpKNKE3OtAZP5t269UqhMcI0sNPa rJXw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :message-id:date:subject:cc:to:from:dkim-signature; bh=9iMh8GJTXYAvIvoFNViIi3d5TXOC7qZXh6RZi9mW6U8=; fh=bKSAdOD9sjDLFpuVEw2QY/iOhn17PgYAzgX/PkCBS1w=; b=oW1jhdTttgQoh1CEYRsUSqB+/klOC52hIYOLNMTLrXw6QVdPx9pBr3yLBvpQy/b46g IhRb1J84EihqEdewrwX7c/xg4TyRyfKD8eGDeT93Qk4EwOAt0b9BzcVWs8C+hn4Nl1Ug RhyR7EXvggMY0T2SBa8VlRNS9nei1ldyuS/fRuN7WS5oWV/uToYf/rODfuj9cu0npzoQ v5kD6HZNBLADQnU/QhKfS3G6dck6V8f5i3QtAaUe6ntfZr50tHrvA3moPLLwqsXgB5Vt rfSdxwsqonN4K4YSwLOYjbFmp8Xf79WrtxDws2WujKav4TIdAzjuADPNcjTgbMTPn6aP 5wRw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@cisco.com header.s=iport header.b=fZrdJ9av; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:2 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=NONE dis=NONE) header.from=cisco.com Received: from agentk.vger.email (agentk.vger.email. [2620:137:e000::3:2]) by mx.google.com with ESMTPS id l6-20020a0dc906000000b005a7a80a94cfsi2969198ywd.346.2023.10.27.11.03.51 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 27 Oct 2023 11:03:52 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:2 as permitted sender) client-ip=2620:137:e000::3:2; Authentication-Results: mx.google.com; dkim=pass header.i=@cisco.com header.s=iport header.b=fZrdJ9av; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:2 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=NONE dis=NONE) header.from=cisco.com Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by agentk.vger.email (Postfix) with ESMTP id EAAC58301511; Fri, 27 Oct 2023 11:03:43 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at agentk.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1346142AbjJ0SDa (ORCPT <rfc822;a1648639935@gmail.com> + 25 others); Fri, 27 Oct 2023 14:03:30 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:59750 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231461AbjJ0SD3 (ORCPT <rfc822;linux-kernel@vger.kernel.org>); Fri, 27 Oct 2023 14:03:29 -0400 Received: from alln-iport-3.cisco.com (alln-iport-3.cisco.com [173.37.142.90]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 783D0F3; Fri, 27 Oct 2023 11:03:26 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=cisco.com; i=@cisco.com; l=4701; q=dns/txt; s=iport; t=1698429806; x=1699639406; h=from:to:cc:subject:date:message-id:mime-version: content-transfer-encoding; bh=MLltXISI9Lx12xFxYGsiVUPlQvDHPNkLyDHkpW9D4rQ=; b=fZrdJ9av41R/Zwc7cVRoJfyWqy73iivgrRIWxEpDBR22VCP1MxULNjPV G7Q9cqJPmrnrlpm9MKYxhARPFwfwRz9Xx/kpUZmJOiNSOeQus7XElenRP 1+3VmAvgdzC6E9ziiuwzdj0sxwC+FkJHYQvD2aq0pJUdFaTqiFCc7pPbR 4=; X-CSE-ConnectionGUID: Av0DtP0+THaiR8uRkvJYDA== X-CSE-MsgGUID: w2Aw8V5SREiUjrboMXrEcg== X-IronPort-AV: E=Sophos;i="6.03,256,1694736000"; d="scan'208";a="173159750" Received: from rcdn-core-11.cisco.com ([173.37.93.147]) by alln-iport-3.cisco.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 27 Oct 2023 18:03:20 +0000 Received: from localhost.cisco.com ([10.193.101.253]) (authenticated bits=0) by rcdn-core-11.cisco.com (8.15.2/8.15.2) with ESMTPSA id 39RI39Oc029226 (version=TLSv1.2 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO); Fri, 27 Oct 2023 18:03:19 GMT From: Karan Tilak Kumar <kartilak@cisco.com> To: sebaddel@cisco.com Cc: arulponn@cisco.com, djhawar@cisco.com, gcboffa@cisco.com, mkai2@cisco.com, satishkh@cisco.com, jejb@linux.ibm.com, martin.petersen@oracle.com, linux-scsi@vger.kernel.org, linux-kernel@vger.kernel.org, Karan Tilak Kumar <kartilak@cisco.com> Subject: [PATCH v2 00/13] Introduce support for multiqueue (MQ) in fnic Date: Fri, 27 Oct 2023 11:02:49 -0700 Message-Id: <20231027180302.418676-1-kartilak@cisco.com> X-Mailer: git-send-email 2.31.1 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Authenticated-User: kartilak@cisco.com X-Outbound-SMTP-Client: 10.193.101.253, [10.193.101.253] X-Outbound-Node: rcdn-core-11.cisco.com X-Spam-Status: No, score=-8.4 required=5.0 tests=DKIMWL_WL_HIGH,DKIMWL_WL_MED, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,USER_IN_DEF_DKIM_WL autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on agentk.vger.email Precedence: bulk List-ID: <linux-kernel.vger.kernel.org> X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (agentk.vger.email [0.0.0.0]); Fri, 27 Oct 2023 11:03:44 -0700 (PDT) X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1780932759338233408 X-GMAIL-MSGID: 1780932759338233408 |
Series |
Introduce support for multiqueue (MQ) in fnic
|
|
Message
Karan Tilak Kumar (kartilak)
Oct. 27, 2023, 6:02 p.m. UTC
Hi Martin, This cover letter describes the feature: add support for multiqueue (MQ) to fnic driver. Background: The Virtual Interface Card (VIC) firmware exposes several queues that can be configured for sending IOs and receiving IO responses. Unified Computing System Manager (UCSM) and Intersight Manager (IMM) allows users to configure the number of queues to be used for IOs. The number of IO queues to be used is stored in a configuration file by the VIC firmware. The fNIC driver reads the configuration file and sets the number of queues to be used. Previously, the driver was hard-coded to use only one queue. With this set of changes, the fNIC driver will configure itself to use multiple queues. This feature takes advantage of the block multiqueue layer to parallelize IOs being sent out of the VIC card. Here's a brief description of some of the salient patches: - vnic_scsi.h needs to be in sync with VIC firmware to be able to read the number of queues from the firmware config file. A patch has been created for this. - In an environment with many fnics (like we see in our customer environments), it is hard to distinguish which fnic is printing logs. Therefore, an fnic number has been included in the logs. - read the number of queues from the firmware config file. - include definitions in fnic.h to support multiqueue. - modify the interrupt service routines (ISRs) to read from the correct registers. The numbers that are used here come from discussions with the VIC firmware team. - track IO statistics for different queues. - remove usage of host_lock, and only use fnic_lock in the fnic driver. - use a hardware queue based spinlock to protect io_req. - replace the hard-coded zeroth queue with a hardware queue number. This presents a bulk of the changes. - modify the definition of fnic_queuecommand to accept multiqueue tags. - improve log messages, and indicate fnic number and multiqueue tags for effective debugging. Even though the patches have been made into a series, some patches are heavier than others. But, every effort has been made to keep the purpose of each patch as a single-purpose, and to compile cleanly. This patchset has been tested as a whole. Therefore, the tested-by fields have been added only to the last two patches in the set. All the individual patches compile cleanly. However, I've refrained from adding tested-by to most of the patches, so as to not mislead the reviewer/reader. A brief note on the unit tests: 1. Increase number of queues to 64. Load driver. Run IOs via Medusa. 12+ hour run successful. 2. Configure multipathing, and run link flaps on single link. IOs drop briefly, but pick up as expected. 3. Configure multipathing, and run link flaps on two links, with a 30 second delay in between. IOs drop briefly, but pick up as expected. Repeat the above tests with single queue. All tests were successful. Please consider this patch series for the next merge window. Changes between v1 and v2: Suppress a warning raised by a kernel test bot, Incorporate the following review comments from Bart: Remove outdated comment, Remove unnecessary out of range tag checks, Remove unnecessary local variable, Modify function name. Thanks and regards, Karan Karan Tilak Kumar (13): scsi: fnic: Modify definitions to sync with VIC firmware scsi: fnic: Add and use fnic number scsi: fnic: Add and improve log messages scsi: fnic: Rename wq_copy to hw_copy_wq scsi: fnic: Get copy workqueue count and interrupt mode from config scsi: fnic: Refactor and redefine fnic.h for multiqueue scsi: fnic: Modify ISRs to support multiqueue(MQ) scsi: fnic: Define stats to track multiqueue (MQ) IOs scsi: fnic: Remove usage of host_lock scsi: fnic: Add support for multiqueue (MQ) in fnic_main.c scsi: fnic: Use fnic_lock to protect fnic structures in queuecommand scsi: fnic: Add support for multiqueue (MQ) in fnic driver scsi: fnic: Improve logs and add support for multiqueue (MQ) drivers/scsi/fnic/fnic.h | 42 +- drivers/scsi/fnic/fnic_debugfs.c | 2 +- drivers/scsi/fnic/fnic_fcs.c | 36 +- drivers/scsi/fnic/fnic_io.h | 2 + drivers/scsi/fnic/fnic_isr.c | 166 +++++-- drivers/scsi/fnic/fnic_main.c | 156 ++++-- drivers/scsi/fnic/fnic_res.c | 48 +- drivers/scsi/fnic/fnic_scsi.c | 789 ++++++++++++++++++------------- drivers/scsi/fnic/fnic_stats.h | 3 + drivers/scsi/fnic/fnic_trace.c | 11 + drivers/scsi/fnic/vnic_dev.c | 4 + drivers/scsi/fnic/vnic_scsi.h | 13 +- 12 files changed, 823 insertions(+), 449 deletions(-)
Comments
On 27/10/2023 19:02, Karan Tilak Kumar wrote: > The number of IO queues to be used is stored in a configuration file > by the VIC firmware. The fNIC driver reads the configuration file and sets > the number of queues to be used. Previously, the driver was hard-coded > to use only one queue. In looking at commit aec95e3a8ded ("scsi: fnic: Refactor code in fnic probe to initialize SCSI layer"), support to set shost->nr_hw_queues > 1 to enable MQ seems to have sneaked in already - what's going on there? John
On Thursday, November 2, 2023 2:00 AM, John Garry <john.g.garry@oracle.com> wrote: > > On 27/10/2023 19:02, Karan Tilak Kumar wrote: > > The number of IO queues to be used is stored in a configuration file > > by the VIC firmware. The fNIC driver reads the configuration file and sets > > the number of queues to be used. Previously, the driver was hard-coded > > to use only one queue. > > In looking at commit aec95e3a8ded ("scsi: fnic: Refactor code in fnic > probe to initialize SCSI layer"), support to set shost->nr_hw_queues > 1 > to enable MQ seems to have sneaked in already - what's going on there? > > John Thanks for your review comments, John. This was a defensive check and code to show that fnic does not have support for MQ when the user tries to configure multiple IO queues. The support for MQ is being added only now. Regards, Karan