From patchwork Tue Dec 22 00:11:49 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Muneendra Kumar X-Patchwork-Id: 11985927 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-17.2 required=3.0 tests=BAYES_00,DATE_IN_PAST_06_12, DKIMWL_WL_HIGH,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 73306C433DB for ; Tue, 22 Dec 2020 07:06:21 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 47B782312E for ; Tue, 22 Dec 2020 07:06:21 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726045AbgLVHGU (ORCPT ); Tue, 22 Dec 2020 02:06:20 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:56204 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725881AbgLVHGU (ORCPT ); Tue, 22 Dec 2020 02:06:20 -0500 Received: from mail-pg1-x52d.google.com (mail-pg1-x52d.google.com [IPv6:2607:f8b0:4864:20::52d]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id CD872C0613D3 for ; Mon, 21 Dec 2020 23:05:25 -0800 (PST) Received: by mail-pg1-x52d.google.com with SMTP id e2so7804371pgi.5 for ; Mon, 21 Dec 2020 23:05:25 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=broadcom.com; s=google; h=mime-version:from:to:cc:subject:date:message-id:in-reply-to :references; bh=i91urXxyVHzg6B1M3D7eIIZQiT6XNR3//UiQV2siF54=; b=HwX8yE1OWbsRkmyv8+9b17+3Ho8mZ5J3HTtTksXGraXDKixLpMQEmJPtLJinnryojK nnmiuSFbLRgaGJ+qNOqjFYGskQrWI9mCDFZ+sMCTySSNVSnr7gWOjj4IvevwWh/JKfeO Qu/io+Y4qCAm6ebIoXzqDSkMnJ28mCOhCcrkc= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=mime-version:x-gm-message-state:from:to:cc:subject:date:message-id :in-reply-to:references; bh=i91urXxyVHzg6B1M3D7eIIZQiT6XNR3//UiQV2siF54=; b=h8EMj28VsuJ43M5Ji20QbrVrqH3vnmxhAd7rVL4Ga7aYSWvBsCdIH6El8v2w0wQqf+ cgunJnkfcmWLR+otULajfaNptEoJkr49t/KS1Ms1Aqq2oWdQ9rmMNlWzgf8YMJsbihE1 eEZDJGMvWRC9VSboa8Cnq2dHm02Vwe4LYILK9hMj29QAnGtHV8sJJc+I6J4IeEbT6hl9 +w/6n6Jv9fy2qjRCkWhwbvAX/4TJkc7Vk1E/ms+JO+MI/j3duLOyAr1Zg3ugk3ttEX2X DoLEKPrIUsH2IUu1G+YzPs69t6Gz8lVJxAV4yhkHqqWjgPib50twyuuXDke4Znm+Zc+I Q1NQ== MIME-Version: 1.0 X-Gm-Message-State: AOAM531GaXFsWaVzNv+pV45YVPDpjR0O3ZaBCSyE5i2xqwQogMwOOYJM NFQlK7k6drnopYylNp2/ntZZrSqGpQ6XN02xHiOy+QD8D9Vo/SxvUVhHwMuMZpxFWPjwGSlLN6y x87izMy1ERVMY4xSfv8vNBq0= X-Google-Smtp-Source: ABdhPJwD0aF7YWOswWSg/MjSgm/Ea0GZO1zBEqaJqK3FwXYhEBO6UIxhPe6cDgNluhr3pvj6aV+BJA== X-Received: by 2002:aa7:8d86:0:b029:19e:cb57:2849 with SMTP id i6-20020aa78d860000b029019ecb572849mr18842062pfr.54.1608620725190; Mon, 21 Dec 2020 23:05:25 -0800 (PST) Received: from localhost.localdomain ([192.19.234.250]) by smtp.gmail.com with ESMTPSA id t9sm12466082pgh.41.2020.12.21.23.05.20 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Mon, 21 Dec 2020 23:05:24 -0800 (PST) From: Muneendra To: linux-block@vger.kernel.org, linux-scsi@vger.kernel.org, tj@kernel.org, linux-nvme@lists.infradead.org, hare@suse.de Cc: jsmart2021@gmail.com, emilne@redhat.com, mkumar@redhat.com, pbonzini@redhat.com, Gaurav Srivastava Subject: [PATCH v6 07/16] lpfc: vmid: VMID params initialization Date: Tue, 22 Dec 2020 05:41:49 +0530 Message-Id: <1608595918-21954-8-git-send-email-muneendra.kumar@broadcom.com> X-Mailer: git-send-email 1.8.3.1 In-Reply-To: <1608595918-21954-1-git-send-email-muneendra.kumar@broadcom.com> References: <1608595918-21954-1-git-send-email-muneendra.kumar@broadcom.com> Precedence: bulk List-ID: X-Mailing-List: linux-scsi@vger.kernel.org From: Gaurav Srivastava This patch initializes the VMID parameters like the type of vmid, max number of vmids supported and timeout value for the vmid registration based on the user input. Signed-off-by: Gaurav Srivastava Signed-off-by: James Smart --- v6: No change v5: No change v4: No change v3: No change v2: Ported the patch on top of 5.10/scsi-queue --- drivers/scsi/lpfc/lpfc_attr.c | 47 +++++++++++++++++++++++++++++++++++ 1 file changed, 47 insertions(+) diff --git a/drivers/scsi/lpfc/lpfc_attr.c b/drivers/scsi/lpfc/lpfc_attr.c index 4528166dee36..d8cca950fa3b 100644 --- a/drivers/scsi/lpfc/lpfc_attr.c +++ b/drivers/scsi/lpfc/lpfc_attr.c @@ -6151,6 +6151,44 @@ LPFC_ATTR_RW(enable_dpp, 1, 0, 1, "Enable Direct Packet Push"); */ LPFC_ATTR_R(enable_mi, 1, 0, 1, "Enable MI"); +/* + * lpfc_max_vmid: Maximum number of VMs to be tagged. This is valid only if + * either vmid_app_header or vmid_priority_tagging is enabled. + * 4 - 255 = vmid support enabled for 4-255 VMs + * Value range is [4,255]. + */ +LPFC_ATTR_RW(max_vmid, LPFC_MIN_VMID, LPFC_MIN_VMID, LPFC_MAX_VMID, + "Maximum number of VMs supported"); + +/* + * lpfc_vmid_inactivity_timeout: Inactivity timeout duration in hours + * 0 = Timeout is disabled + * Value range is [0,24]. + */ +LPFC_ATTR_RW(vmid_inactivity_timeout, 4, 0, 24, + "Inactivity timeout in hours"); + +/* + * lpfc_vmid_app_header: Enable App Header VMID support + * 0 = Support is disabled (default) + * 1 = Support is enabled + * Value range is [0,1]. + */ +LPFC_ATTR_RW(vmid_app_header, LPFC_VMID_APP_HEADER_DISABLE, + LPFC_VMID_APP_HEADER_DISABLE, LPFC_VMID_APP_HEADER_ENABLE, + "Enable App Header VMID support"); + +/* + * lpfc_vmid_priority_tagging: Enable Priority Tagging VMID support + * 0 = Support is disabled (default) + * 1 = Support is enabled + * Value range is [0,1].. + */ +LPFC_ATTR_RW(vmid_priority_tagging, LPFC_VMID_PRIO_TAG_DISABLE, + LPFC_VMID_PRIO_TAG_DISABLE, + LPFC_VMID_PRIO_TAG_ALL_TARGETS, + "Enable Priority Tagging VMID support"); + struct device_attribute *lpfc_hba_attrs[] = { &dev_attr_nvme_info, &dev_attr_scsi_stat, @@ -6269,6 +6307,10 @@ struct device_attribute *lpfc_hba_attrs[] = { &dev_attr_lpfc_enable_bbcr, &dev_attr_lpfc_enable_dpp, &dev_attr_lpfc_enable_mi, + &dev_attr_lpfc_max_vmid, + &dev_attr_lpfc_vmid_inactivity_timeout, + &dev_attr_lpfc_vmid_app_header, + &dev_attr_lpfc_vmid_priority_tagging, NULL, }; @@ -7328,6 +7370,11 @@ lpfc_get_cfgparam(struct lpfc_hba *phba) lpfc_enable_hba_heartbeat_init(phba, lpfc_enable_hba_heartbeat); lpfc_EnableXLane_init(phba, lpfc_EnableXLane); + /* VMID Inits */ + lpfc_max_vmid_init(phba, lpfc_max_vmid); + lpfc_vmid_inactivity_timeout_init(phba, lpfc_vmid_inactivity_timeout); + lpfc_vmid_app_header_init(phba, lpfc_vmid_app_header); + lpfc_vmid_priority_tagging_init(phba, lpfc_vmid_priority_tagging); if (phba->sli_rev != LPFC_SLI_REV4) phba->cfg_EnableXLane = 0; lpfc_XLanePriority_init(phba, lpfc_XLanePriority);