From patchwork Wed Dec 16 05:29:44 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Muneendra Kumar X-Patchwork-Id: 344748 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 C7C91C2BBCA for ; Wed, 16 Dec 2020 12:24:43 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 92535233CF for ; Wed, 16 Dec 2020 12:24:43 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1725835AbgLPMY3 (ORCPT ); Wed, 16 Dec 2020 07:24:29 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:49002 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725913AbgLPMY3 (ORCPT ); Wed, 16 Dec 2020 07:24:29 -0500 Received: from mail-pl1-x636.google.com (mail-pl1-x636.google.com [IPv6:2607:f8b0:4864:20::636]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 22A18C0617B0 for ; Wed, 16 Dec 2020 04:23:38 -0800 (PST) Received: by mail-pl1-x636.google.com with SMTP id x12so12365863plr.10 for ; Wed, 16 Dec 2020 04:23:38 -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=raaiNC2aUgLI6XSppMyQ3otEOuMSUkrslKgIeCHIcwo=; b=XRjMWssNfVCsRFH4bGtfeXtqhXHKUvRwBkTZmxYZT85Yer5gOBSKVjz25KR9PuSqpx B7Df3REHjsogK1hIz7x70u50g+T5S3qxnlVSEo/d1CLyDb8GRTnsSIdrU3VzdTe/0LHL lVhSdPO9qfYEdeYlmOgLWlCI9bjbvYKU3LqhM= 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=raaiNC2aUgLI6XSppMyQ3otEOuMSUkrslKgIeCHIcwo=; b=YwrFuFCWAq7wtsYOd+J/K6SYi9bsh767FP2VY3x9pkRwW00RQ+VM6ssf01gnNcH536 3HnJNDNNI3xnP3jpRLLgC4lvPo1zIavv/QYbrh4gyc4eS8WnC8L/bXLMj4YIP9a5GsLD irEfY1G1QfqLAdBCixnAMs9cZ2XhXweFFdI4P6n3BDjl24JbuZCTSuBHYu2k1xVmLwaK UjQGKJc7+rZnlQqgNDITXznyWYrf8XuqBideTJOoQuPgXiCPv9WdmUl/l44wmek1KMbS O2ImviNpvpZQzOAxwb8o74cufElq8VV5DeUSN0nB+73h4y3sQD1bh89TChQQRvsLshLn ZfQw== MIME-Version: 1.0 X-Gm-Message-State: AOAM533c3HyWf+/NKUdFN1tC6WkJCgKsoDGC3Uu+F/vI7TV7NbW20SOE i7J34/EcCBVI4hVzHi+9GTocVnuXn4r9lXZaj/pgAoooifiop1qjIwI2yDiLpRvSZBEQYVVWaQC fK+pmqHH2m8lw X-Google-Smtp-Source: ABdhPJzfANd4GQ/vzf4VQAEATIz1HM1EpQEVfwXNtVWIvJvCHUOKjN8sSvxnf1GA4HcrWUVlJJeXug== X-Received: by 2002:a17:90a:72c6:: with SMTP id l6mr2865336pjk.233.1608121417454; Wed, 16 Dec 2020 04:23:37 -0800 (PST) Received: from localhost.localdomain ([192.19.234.250]) by smtp.gmail.com with ESMTPSA id s7sm2477296pfh.207.2020.12.16.04.23.34 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Wed, 16 Dec 2020 04:23:36 -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 v5 14/16] lpfc: vmid: Adding qfpa and vmid timeout check in worker thread Date: Wed, 16 Dec 2020 10:59:44 +0530 Message-Id: <1608096586-21656-15-git-send-email-muneendra.kumar@broadcom.com> X-Mailer: git-send-email 1.8.3.1 In-Reply-To: <1608096586-21656-1-git-send-email-muneendra.kumar@broadcom.com> References: <1608096586-21656-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. Signed-off-by: Gaurav Srivastava Signed-off-by: James Smart Reported-by: kernel test robot --- 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 | 42 ++++++++++++++++++++++++++++++++ 1 file changed, 42 insertions(+) diff --git a/drivers/scsi/lpfc/lpfc_hbadisc.c b/drivers/scsi/lpfc/lpfc_hbadisc.c index be71f3a47c95..3b36710cd47e 100644 --- a/drivers/scsi/lpfc/lpfc_hbadisc.c +++ b/drivers/scsi/lpfc/lpfc_hbadisc.c @@ -428,6 +428,32 @@ lpfc_dev_loss_tmo_handler(struct lpfc_nodelist *ndlp) return fcf_inuse; } +void lpfc_check_vmid_qfpa_issue(struct lpfc_hba *phba) +{ + struct lpfc_vport *vport; + struct lpfc_vport **vports; + int i, ret; + + 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) { + ret = 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. @@ -748,6 +774,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)