From patchwork Tue Dec 22 00:11:56 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: 11985985 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,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 A968FC4361A for ; Tue, 22 Dec 2020 07:07:08 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 9162F23130 for ; Tue, 22 Dec 2020 07:07:08 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726330AbgLVHG7 (ORCPT ); Tue, 22 Dec 2020 02:06:59 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:56372 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726317AbgLVHG6 (ORCPT ); Tue, 22 Dec 2020 02:06:58 -0500 Received: from mail-pj1-x102c.google.com (mail-pj1-x102c.google.com [IPv6:2607:f8b0:4864:20::102c]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 99409C0619D9 for ; Mon, 21 Dec 2020 23:05:57 -0800 (PST) Received: by mail-pj1-x102c.google.com with SMTP id v1so829780pjr.2 for ; Mon, 21 Dec 2020 23:05:57 -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=ZSpRhTERQijECkK/5+Ql1TcUfiS//HI/sJpcVAbuq+g=; b=WOjgBuCtb6V8vydEqRGORb5VRZIxZ0WomHDk/H7tYg3tJrsx7bjBLn2CgFYILDKaSr FXahZN2opl8ky98Zn4IoyEX5T1Ywh5Z1rquumkBd4WOOTd5AKfxr3nVh2oNTf4plW9C+ OBSoNGVmWPJPoiBQuLxShw0OjLrfKKazd3Swc= 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=ZSpRhTERQijECkK/5+Ql1TcUfiS//HI/sJpcVAbuq+g=; b=WDbsCEHaEjbWi18TwesjCZTn0KvphFQy2+KCOP7g92hxDenXdR5svz2F5+ChUtlmiP xBBQ6gLu5R9XSkTn7MioYqrtHSLoKOJN/o/hi5bcLtaY+E2lohdiWQoEsBkW46Yq/ttM JDQqmn8W/NunUm3hWIlCPDWpOzisaCBPVPzvdftXV5aZbUbMC8P6uJSJvJtjaJ3otKQc Emy4npwbJhz8oAeC0937czZEP357hB9i+PzMqi6LxLuCOBgH1Xp4ckId6GV5JZmhYmwZ sjAtsot5OPLZXG5eg95ZCVrZRHnh9ZRJdGFhGcK0blIiptiPmekesqzAeka8KfLPkaZV wiRg== MIME-Version: 1.0 X-Gm-Message-State: AOAM531gB0pNoUql8zlkkyqnQu361hbhMLGJNawf400kONEpALPCmLTr AZg07aAsPITQEbrzXQ6wUYNVaTnS4CAbhT4Zb+TVLrMspMRRFcL6bcXxVjhk+ou9MWR7VwVdOit 4CVNI1tq86Qaf X-Google-Smtp-Source: ABdhPJxtEuRNLtVeHUhKz59CxIZq+x/70eZ/Y2zGhM8VOuYD2F4WyuHy20A7Lzkpf15VWlaRX2+ucA== X-Received: by 2002:a17:90a:8985:: with SMTP id v5mr20378406pjn.27.1608620756981; Mon, 21 Dec 2020 23:05:56 -0800 (PST) Received: from localhost.localdomain ([192.19.234.250]) by smtp.gmail.com with ESMTPSA id t9sm12466082pgh.41.2020.12.21.23.05.52 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Mon, 21 Dec 2020 23:05:56 -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 14/16] lpfc: vmid: Adding qfpa and vmid timeout check in worker thread Date: Tue, 22 Dec 2020 05:41:56 +0530 Message-Id: <1608595918-21954-15-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 add the periodic check for issuing of qfpa command and vmid timeout in the worker thread. The inactivity timeout check is added via the timer function. Reported-by: kernel test robot Signed-off-by: Gaurav Srivastava Signed-off-by: James Smart --- v6: Added Forward declarations and removed unused variable v5: No change v4: No change v3: No change v2: Ported the patch on top of 5.10/scsi-queue --- drivers/scsi/lpfc/lpfc_hbadisc.c | 43 ++++++++++++++++++++++++++++++++ 1 file changed, 43 insertions(+) diff --git a/drivers/scsi/lpfc/lpfc_hbadisc.c b/drivers/scsi/lpfc/lpfc_hbadisc.c index ed2d65cfd3e3..46dad0780368 100644 --- a/drivers/scsi/lpfc/lpfc_hbadisc.c +++ b/drivers/scsi/lpfc/lpfc_hbadisc.c @@ -73,6 +73,7 @@ static void lpfc_unregister_fcfi_cmpl(struct lpfc_hba *, LPFC_MBOXQ_t *); static int lpfc_fcf_inuse(struct lpfc_hba *); static void lpfc_mbx_cmpl_read_sparam(struct lpfc_hba *, LPFC_MBOXQ_t *); static void lpfc_check_inactive_vmid(struct lpfc_hba *phba); +static void lpfc_check_vmid_qfpa_issue(struct lpfc_hba *phba); /* The source of a terminate rport I/O is either a dev_loss_tmo * event or a call to fc_remove_host. While the rport should be @@ -429,6 +430,32 @@ lpfc_dev_loss_tmo_handler(struct lpfc_nodelist *ndlp) return fcf_inuse; } +static void lpfc_check_vmid_qfpa_issue(struct lpfc_hba *phba) +{ + struct lpfc_vport *vport; + struct lpfc_vport **vports; + int i; + + vports = lpfc_create_vport_work_array(phba); + if (!vports) + return; + + for (i = 0; i <= phba->max_vports; i++) { + if ((!vports[i]) && (i == 0)) + vport = phba->pport; + else + vport = vports[i]; + if (!vport) + break; + + if (vport->vmid_flag & LPFC_VMID_ISSUE_QFPA) { + lpfc_issue_els_qfpa(vport); + vport->vmid_flag &= ~LPFC_VMID_ISSUE_QFPA; + } + } + lpfc_destroy_vport_work_array(phba, vports); +} + /** * lpfc_sli4_post_dev_loss_tmo_handler - SLI4 post devloss timeout handler * @phba: Pointer to hba context object. @@ -749,6 +776,22 @@ lpfc_work_done(struct lpfc_hba *phba) if (ha_copy & HA_LATT) lpfc_handle_latt(phba); + /* Handle VMID Events */ + if (lpfc_is_vmid_enabled(phba)) { + if (phba->pport->work_port_events & + WORKER_CHECK_VMID_ISSUE_QFPA) { + lpfc_check_vmid_qfpa_issue(phba); + phba->pport->work_port_events &= + ~WORKER_CHECK_VMID_ISSUE_QFPA; + } + if (phba->pport->work_port_events & + WORKER_CHECK_INACTIVE_VMID) { + lpfc_check_inactive_vmid(phba); + phba->pport->work_port_events &= + ~WORKER_CHECK_INACTIVE_VMID; + } + } + /* Process SLI4 events */ if (phba->pci_dev_grp == LPFC_PCI_DEV_OC) { if (phba->hba_flag & HBA_RRQ_ACTIVE)