From patchwork Mon Oct 19 07:43:00 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Muneendra Kumar M X-Patchwork-Id: 11844493 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 2BF6B157C for ; Mon, 19 Oct 2020 14:37:02 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 06048222E9 for ; Mon, 19 Oct 2020 14:36:59 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=broadcom.com header.i=@broadcom.com header.b="Tvn38TO7" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729555AbgJSOg7 (ORCPT ); Mon, 19 Oct 2020 10:36:59 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:42556 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729549AbgJSOg7 (ORCPT ); Mon, 19 Oct 2020 10:36:59 -0400 Received: from mail-pf1-x441.google.com (mail-pf1-x441.google.com [IPv6:2607:f8b0:4864:20::441]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 5F52CC0613CE for ; Mon, 19 Oct 2020 07:36:59 -0700 (PDT) Received: by mail-pf1-x441.google.com with SMTP id h7so79365pfn.2 for ; Mon, 19 Oct 2020 07:36:59 -0700 (PDT) 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=MsJwffUCiWZCEpUbXtNYFUd3Vitznru2ospVARU8NzM=; b=Tvn38TO7Yrv2WEXw0HzOE8dJlyFx9ts+7dp2Nny0Tay0+a6Pp23o3XFh88JJupV03H 0zJZCRQyUTO50qZXDWmStsKoL2VoW/iPjQ2W5PCD1xSKgdLtyx4YamocWvdjzHSr6p3+ 0UbOZlQPxejalEG5EGoilxJ02CSLGCKG4AiXI= 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=MsJwffUCiWZCEpUbXtNYFUd3Vitznru2ospVARU8NzM=; b=dEkf9Ahcgdmu30s8duDQnI7MgeqMnEFu1M0XKPzqeLoe1DDYibJXcZhq29CDEnz2XU kj3+h9+1Wm9BLjUvEN2WK7JE5u32c4SDUw5H+iEk9lLUaUvlvQbKomd7wVKRw7yyESjJ PB/W0Wl8EH8E2gA8FVp4DDJ29raHJEMFs5SFSdh1y5vko4iH/wjgQkoudqMXh1ByqM97 AtgjoLYxlYBaXqugAqQfP4xiVIM4GhIl38RX5p2V1o30LGoLVCvUjRpnYwR2wlZRplpK i//9o6PDuJ5MJP4t16IYEZXXoiWvDZLM4cmVBIcvAE5r4ze3q6bQz+uo32sVfu2cfSTw YFRQ== X-Gm-Message-State: AOAM533H2ZDHk1aNP/nunNSmDLd7WuEQGFNTsEI4vhqXICLpvP4MN0g4 l6F483cvz3Cg7nVfmeU3p+3a1g== X-Google-Smtp-Source: ABdhPJx3Lh8LlHLVm6zUGHQE6NKwmZolZJ1aLe3/SLdEvKLWcMoj+Z+6q1u4XsBFenisdkhw43SQDg== X-Received: by 2002:a65:44cd:: with SMTP id g13mr14248023pgs.259.1603118218809; Mon, 19 Oct 2020 07:36:58 -0700 (PDT) Received: from localhost.localdomain ([192.19.234.250]) by smtp.gmail.com with ESMTPSA id kb15sm53377pjb.17.2020.10.19.07.36.55 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Mon, 19 Oct 2020 07:36:58 -0700 (PDT) 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: [RFC v2 05/18] lpfc: vmid: API to check if VMID is enabled. Date: Mon, 19 Oct 2020 13:13:00 +0530 Message-Id: <1603093393-12875-6-git-send-email-muneendra.kumar@broadcom.com> X-Mailer: git-send-email 1.8.3.1 In-Reply-To: <1603093393-12875-1-git-send-email-muneendra.kumar@broadcom.com> References: <1603093393-12875-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 --- 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; +}