From patchwork Tue Nov 3 07:18:09 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Muneendra Kumar X-Patchwork-Id: 315365 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=-11.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_PATCH,MAILING_LIST_MULTI, MIME_HEADER_CTYPE_ONLY,SIGNED_OFF_BY,SPF_HELO_NONE,SPF_PASS, T_TVD_MIME_NO_HEADERS,URIBL_BLOCKED,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 03957C55178 for ; Tue, 3 Nov 2020 14:12:56 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id BA2F522370 for ; Tue, 3 Nov 2020 14:12:55 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=broadcom.com header.i=@broadcom.com header.b="fs1zc5DD" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729624AbgKCOMx (ORCPT ); Tue, 3 Nov 2020 09:12:53 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:44500 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729579AbgKCOMD (ORCPT ); Tue, 3 Nov 2020 09:12:03 -0500 Received: from mail-pg1-x544.google.com (mail-pg1-x544.google.com [IPv6:2607:f8b0:4864:20::544]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id D5733C0613D1 for ; Tue, 3 Nov 2020 06:12:03 -0800 (PST) Received: by mail-pg1-x544.google.com with SMTP id g12so13773466pgm.8 for ; Tue, 03 Nov 2020 06:12:03 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=broadcom.com; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=mkEHQfd3kShudm1V4soGyWUgQkd3UQoXe4Be/jwZGrw=; b=fs1zc5DDn8cc2Eb8OvwqzclrsZpPPV8DrupOYp6rcaTikVCP5JsTqIKupztHv/uOCx b3sQ4QMkHnypBR2VB5rwLk1qsntH1bV9pxstE5NgixYlitwmFFizisXaftT9jf52xqQF AmC4CtcikJ11LY2PTmcjeho12qbxz2kPdz73U= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=mkEHQfd3kShudm1V4soGyWUgQkd3UQoXe4Be/jwZGrw=; b=cQ/FNk096aqCKtcJV+Xb+f90jN/DfhIFxAWCX8+/RNLcTODml3vHSVB4qyZsXtll52 57RuMTBNEm9onxxLgRhnmATanZvXC5vnEBuspQsobv7VH5yyYsiKQL3xuyQYMXYMMrJg nY6yagJS4JU2u1mh+tWk1g+YZEzonP3qSx02wSU2lbO90aJ0AZQgBMeTFSiENvLWo8Lq DTC/Pg6K5vu24qn1l+q/rDGvzmLERdwgzeCnehCzMkEjcvS9kbsMZqc+yfSw7c8hlOZS hsBepHim+LVy5EMaS4E8vk3RA975p37GURBYuE9p1wh2zO3xg6gDpMl8rMDUPghar7bG ZwWA== X-Gm-Message-State: AOAM531JO9QN0xXdxlnGpajhHH2tzyPXnfJKqT71iGAyvx8gkc4YuNj5 VPR9XhRmBfCv8m1vK2dz6q8qmA== X-Google-Smtp-Source: ABdhPJwkwMXvFcwfB6d73SczEgxSHF4XLzj33s/lFdu5axPK/qPvY5++dOieJnyj2wJUvmh1rUhZrQ== X-Received: by 2002:a17:90a:a505:: with SMTP id a5mr3984738pjq.76.1604412723309; Tue, 03 Nov 2020 06:12:03 -0800 (PST) Received: from localhost.localdomain ([192.19.234.250]) by smtp.gmail.com with ESMTPSA id t19sm3596691pgv.37.2020.11.03.06.12.00 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Tue, 03 Nov 2020 06:12:02 -0800 (PST) From: Muneendra To: linux-block@vger.kernel.org, linux-scsi@vger.kernel.org, tj@kernel.org, linux-nvme@lists.infradead.org Cc: jsmart2021@gmail.com, emilne@redhat.com, mkumar@redhat.com, pbonzini@redhat.com, Gaurav Srivastava Subject: [PATCH v3 05/19] lpfc: vmid: API to check if VMID is enabled. Date: Tue, 3 Nov 2020 12:48:09 +0530 Message-Id: <1604387903-20006-6-git-send-email-muneendra.kumar@broadcom.com> X-Mailer: git-send-email 1.8.3.1 In-Reply-To: <1604387903-20006-1-git-send-email-muneendra.kumar@broadcom.com> References: <1604387903-20006-1-git-send-email-muneendra.kumar@broadcom.com> Precedence: bulk List-ID: X-Mailing-List: linux-scsi@vger.kernel.org From: Gaurav Srivastava This API will determine if VMID is enabled by the user or not. Signed-off-by: Gaurav Srivastava Signed-off-by: James Smart --- v3: No change v2: Ported the patch on top of 5.10/scsi-queue --- drivers/scsi/lpfc/lpfc.h | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) diff --git a/drivers/scsi/lpfc/lpfc.h b/drivers/scsi/lpfc/lpfc.h index 8f0062d2b891..a62e985aa180 100644 --- a/drivers/scsi/lpfc/lpfc.h +++ b/drivers/scsi/lpfc/lpfc.h @@ -1506,3 +1506,27 @@ static const char *routine(enum enum_name table_key) \ } \ return name; \ } + +/** + * lpfc_is_vmid_enabled - returns if VMID is enabled for either switch types + * @phba: Pointer to HBA context object. + * + * Relationship between the enable, target support and if vmid tag is required + * for the particular combination + * --------------------------------------------------- + * Switch Enable Flag Target Support VMID Needed + * --------------------------------------------------- + * App Id 0 NA N + * App Id 1 0 N + * App Id 1 1 Y + * Pr Tag 0 NA N + * Pr Tag 1 0 N + * Pr Tag 1 1 Y + * Pr Tag 2 * Y + --------------------------------------------------- + * + **/ +static inline int lpfc_is_vmid_enabled(struct lpfc_hba *phba) +{ + return phba->cfg_vmid_app_header || phba->cfg_vmid_priority_tagging; +}