From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id 71F6D459D8; Thu, 19 Sep 2024 20:02:56 +0200 (CEST) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 1F652406FF; Thu, 19 Sep 2024 20:02:55 +0200 (CEST) Received: from mx0b-0016f401.pphosted.com (mx0b-0016f401.pphosted.com [67.231.156.173]) by mails.dpdk.org (Postfix) with ESMTP id 518CB4026B for ; Thu, 19 Sep 2024 20:02:53 +0200 (CEST) Received: from pps.filterd (m0045851.ppops.net [127.0.0.1]) by mx0b-0016f401.pphosted.com (8.18.1.2/8.18.1.2) with ESMTP id 48JEnrce024124 for ; Thu, 19 Sep 2024 11:02:52 -0700 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=marvell.com; h= cc:content-transfer-encoding:content-type:date:from:in-reply-to :message-id:mime-version:references:subject:to; s=pfpt0220; bh=1 hBTBRplTjawTAcYWLhLDYLBFRh6Ij/NPIM9dHBcZgw=; b=IJ6vQscI4aSgewKBu UaAyaKWvxk2FwZ5hwF799ykDXBOrzdJJdwvBoorACVwPvzTmlWJ8bUAsvdlavI9K UvLaXLWDRysXaQ7S9PXbrJ5cxjegVAM5HvUeMUqb69taLaEtm9Gt6wcCt7bsAmGx rVpZBqzb2wYTMkyvsdlIlaWOsEr9E7mypimlJnMk4+HFeYv1M5TJL6OBFGqoar9I VFS17MAkY+i3SEx3e+lQ/2LL8qJRvvqA/GTIqmyXykkEVX5GFTiU3gwb4c+LtP+1 17ORXc1ducGfOC0PdyLP/VJKUcXxq1q/O209K+72lls6QbwedW2FbLv4LK1y1Sqs 0Owrw== Received: from dc5-exch05.marvell.com ([199.233.59.128]) by mx0b-0016f401.pphosted.com (PPS) with ESMTPS id 41rh5mjd4p-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT) for ; Thu, 19 Sep 2024 11:02:50 -0700 (PDT) Received: from DC5-EXCH05.marvell.com (10.69.176.209) by DC5-EXCH05.marvell.com (10.69.176.209) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.1544.4; Thu, 19 Sep 2024 11:02:48 -0700 Received: from maili.marvell.com (10.69.176.80) by DC5-EXCH05.marvell.com (10.69.176.209) with Microsoft SMTP Server id 15.2.1544.4 via Frontend Transport; Thu, 19 Sep 2024 11:02:48 -0700 Received: from MININT-80QBFE8.corp.innovium.com (unknown [10.28.164.106]) by maili.marvell.com (Postfix) with ESMTP id 137653F7084; Thu, 19 Sep 2024 11:02:45 -0700 (PDT) From: To: , Nithin Dabilpuram , "Kiran Kumar K" , Sunil Kumar Kori , Satha Rao , Harman Kalra CC: , Pavan Nikhilesh Subject: [PATCH v2] common/cnxk: unregister IRQ before reconfigure Date: Thu, 19 Sep 2024 23:32:43 +0530 Message-ID: <20240919180243.1255-1-pbhagavatula@marvell.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20240906142557.13893-1-pbhagavatula@marvell.com> References: <20240906142557.13893-1-pbhagavatula@marvell.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Type: text/plain X-Proofpoint-ORIG-GUID: hzE38ntNcY7r3dOcas9L6vNkHIfyMAOi X-Proofpoint-GUID: hzE38ntNcY7r3dOcas9L6vNkHIfyMAOi X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.293,Aquarius:18.0.1039,Hydra:6.0.680,FMLib:17.12.60.29 definitions=2024-09-06_09,2024-09-06_01,2024-09-02_01 X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org From: Pavan Nikhilesh Unregister SSO device and NPA IRQs before resizing them. Signed-off-by: Pavan Nikhilesh --- v2 Changes: - Reorder npa interrupt un-registration. drivers/common/cnxk/roc_dev.c | 16 +++++++--------- drivers/common/cnxk/roc_dev_priv.h | 2 ++ drivers/common/cnxk/roc_sso.c | 7 +++++++ 3 files changed, 16 insertions(+), 9 deletions(-) diff --git a/drivers/common/cnxk/roc_dev.c b/drivers/common/cnxk/roc_dev.c index daf7684d8e..4a5787e7f9 100644 --- a/drivers/common/cnxk/roc_dev.c +++ b/drivers/common/cnxk/roc_dev.c @@ -1017,8 +1017,8 @@ mbox_unregister_vf_irq(struct plt_pci_device *pci_dev, struct dev *dev) RVU_VF_INT_VEC_MBOX); } -static void -mbox_unregister_irq(struct plt_pci_device *pci_dev, struct dev *dev) +void +dev_mbox_unregister_irq(struct plt_pci_device *pci_dev, struct dev *dev) { if (dev_is_vf(dev)) mbox_unregister_vf_irq(pci_dev, dev); @@ -1096,8 +1096,8 @@ roc_pf_vf_flr_irq(void *param) } } -static int -vf_flr_unregister_irqs(struct plt_pci_device *pci_dev, struct dev *dev) +void +dev_vf_flr_unregister_irqs(struct plt_pci_device *pci_dev, struct dev *dev) { struct plt_intr_handle *intr_handle = pci_dev->intr_handle; int i; @@ -1113,8 +1113,6 @@ vf_flr_unregister_irqs(struct plt_pci_device *pci_dev, struct dev *dev) dev_irq_unregister(intr_handle, roc_pf_vf_flr_irq, dev, RVU_PF_INT_VEC_VFFLR1); - - return 0; } int @@ -1600,7 +1598,7 @@ dev_init(struct dev *dev, struct plt_pci_device *pci_dev) iounmap: dev_vf_mbase_put(pci_dev, vf_mbase); mbox_unregister: - mbox_unregister_irq(pci_dev, dev); + dev_mbox_unregister_irq(pci_dev, dev); if (dev->ops) plt_free(dev->ops); mbox_fini: @@ -1636,10 +1634,10 @@ dev_fini(struct dev *dev, struct plt_pci_device *pci_dev) if (dev->lmt_mz) plt_memzone_free(dev->lmt_mz); - mbox_unregister_irq(pci_dev, dev); + dev_mbox_unregister_irq(pci_dev, dev); if (!dev_is_vf(dev)) - vf_flr_unregister_irqs(pci_dev, dev); + dev_vf_flr_unregister_irqs(pci_dev, dev); /* Release PF - VF */ mbox = &dev->mbox_vfpf; if (mbox->hwbase && mbox->dev) diff --git a/drivers/common/cnxk/roc_dev_priv.h b/drivers/common/cnxk/roc_dev_priv.h index 50e12cbf17..df7dc222ed 100644 --- a/drivers/common/cnxk/roc_dev_priv.h +++ b/drivers/common/cnxk/roc_dev_priv.h @@ -131,6 +131,8 @@ int dev_irqs_disable(struct plt_intr_handle *intr_handle); int dev_irq_reconfigure(struct plt_intr_handle *intr_handle, uint16_t max_intr); int dev_mbox_register_irq(struct plt_pci_device *pci_dev, struct dev *dev); +void dev_mbox_unregister_irq(struct plt_pci_device *pci_dev, struct dev *dev); int dev_vf_flr_register_irqs(struct plt_pci_device *pci_dev, struct dev *dev); +void dev_vf_flr_unregister_irqs(struct plt_pci_device *pci_dev, struct dev *dev); #endif /* _ROC_DEV_PRIV_H */ diff --git a/drivers/common/cnxk/roc_sso.c b/drivers/common/cnxk/roc_sso.c index 293b0c81a1..7d45b06dda 100644 --- a/drivers/common/cnxk/roc_sso.c +++ b/drivers/common/cnxk/roc_sso.c @@ -842,7 +842,14 @@ sso_update_msix_vec_count(struct roc_sso *roc_sso, uint16_t sso_vec_cnt) return dev_irq_reconfigure(pci_dev->intr_handle, mbox_vec_cnt + npa_vec_cnt); } + /* Before re-configuring unregister irqs */ npa_vec_cnt = (dev->npa.pci_dev == pci_dev) ? NPA_LF_INT_VEC_POISON + 1 : 0; + if (npa_vec_cnt) + npa_unregister_irqs(&dev->npa); + + dev_mbox_unregister_irq(pci_dev, dev); + if (!dev_is_vf(dev)) + dev_vf_flr_unregister_irqs(pci_dev, dev); /* Re-configure to include SSO vectors */ rc = dev_irq_reconfigure(pci_dev->intr_handle, mbox_vec_cnt + npa_vec_cnt + sso_vec_cnt); -- 2.25.1